Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Question about use npc

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Camdog




Joined: 08 Aug 2003
Posts: 606

PostPosted: Fri Sep 26, 2008 1:52 pm    Post subject: Question about use npc Reply with quote

Is there anyway to get the functionality of this command without forcing a wait of 1 tick?
Back to top
View user's profile Send private message
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Wed Oct 01, 2008 2:31 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Tue Oct 07, 2008 9:29 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Camdog




Joined: 08 Aug 2003
Posts: 606

PostPosted: Wed Oct 08, 2008 5:50 am    Post subject: Reply with quote

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
View user's profile Send private message
Camdog




Joined: 08 Aug 2003
Posts: 606

PostPosted: Wed Oct 08, 2008 10:09 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group