View previous topic :: View next topic |
Author |
Message |
Camdog
Joined: 08 Aug 2003 Posts: 606
|
Posted: Fri Sep 26, 2008 1:52 pm Post subject: Question about use npc |
|
|
Is there anyway to get the functionality of this command without forcing a wait of 1 tick? |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Wed Oct 01, 2008 2:31 am Post subject: |
|
|
Oh man, I hate those implicit waits. I'm looking for some excuse to remove them in a backwards compatible way. Maybe with script multitasking.
You can write a script to interpret all the NPC's data. Here's part of a similiar script I'm using. You'll have to expand (or just ask) it to do what you want. You can find details about the NPC data at 'N'
Code: | ref := npc at pixel (x, y, i)
if (read npc (ref, NPCstat:activation) == NPCactivation:use) then (
trigger script := read npc (ref, NPCstat:script)
if (trigger script) then (
run script by ID (trigger script, read npc (ref, NPCstat:script argument), ref)
)
if (read npc (ref, NPCstat:display text)) then (show textbox (read npc (ref, NPCstat:display text)))
if (read npc (ref, 11)) then (set tag (read npc (ref, 11) + 1000, true))
)
| Most noticeably, this doesn't make the NPC turn. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Tue Oct 07, 2008 9:29 am Post subject: |
|
|
Yeah, I've tried messing with plotscripted npc activation, and it is less than fun. I wish I could help more than that... _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
Back to top |
|
 |
Camdog
Joined: 08 Aug 2003 Posts: 606
|
Posted: Wed Oct 08, 2008 5:50 am Post subject: |
|
|
TMC:
This is, in fact, what I ended up doing. I had just wanted to use 'use npc' so that use only once npcs would disappear. Of course, reading your code, I can see that it is possible to access the usability data in an npc with read npc! I had assumed it wasn't, because it isn't listed in the read/alter npc documentation. Why doesn't it have a constant!? Anyway, thanks. This will work beautifully. |
|
Back to top |
|
 |
Camdog
Joined: 08 Aug 2003 Posts: 606
|
Posted: Wed Oct 08, 2008 10:09 am Post subject: |
|
|
Oh, and I meant to mention earlier... why not just add an optional argument to the use npc function that could turn off the implicit wait? That would solve the backwards compatibility issue, wouldn't it? |
|
Back to top |
|
 |
|