Trigger Scripts not firing. - by New Horizon
Ziemanskye on 2/9/2005 at 13:51
There's always the uber-evil version - give the keyring all the scripts normally, but lock them so that they need a "key has been picked up" message to unlock the script on the ring.
New Horizon on 2/9/2005 at 13:53
Still no luck. I've been trying to find a way to make the KeyRing inherit the Triggerscripts from the Keys being picked up with no luck.
Perhaps I need to add all the key scripts to the KeyRing and find a way of only activating them if the corresponding key is picked up. Not sure if that's possible though.
rujuro on 2/9/2005 at 15:12
I think that's exactly what you should do. I think it should be possible to create flags like:
Key1acquired
Key2acquired
etc.
When key1 is picked up, it sets key1acquired->true
When the keyring is used and it tries to open the door, the door checks if Key1acquire=true AND the other necessary conditions.
Anyone please correct where I'm off here.
New Horizon on 2/9/2005 at 15:16
Quote Posted by rujuro
I think that's exactly what you should do. I think it should be possible to create flags like:
Key1acquired
Key2acquired
etc.
When key1 is picked up, it sets key1acquired->true
When the keyring is used and it tries to open the door, the door checks if Key1acquire=true AND the other necessary conditions.
Anyone please correct where I'm off here.
Hmmm, okay. Not sure how to go about that. I've been trying to figure it out of course...but with little luck. LOL I'm really glad you guys are so willing to help because I would never figure this out on my own.
rujuro on 2/9/2005 at 15:59
Well, I must say I haven't yet created any flags, but I'm pretty sure I saw a menu to do it in the editor. And I know I saw an action to change a flags state. Hopefully someone who has used this element of the editor can help out a little more. Sorry I can't be more specific. I'm at work and don't have the editor handy.
Another nice little touch might be to flash a non blocking message "key added to keyring" for 1 second just for a little extra feedback (I'm a little concerned that players who have never used the keyring won't know what happened to their keys or why doors won't open). Might get annoying though, so I don't know. A keyring jingle sound would be more elegant, but possibly too vague.
New Horizon on 2/9/2005 at 16:07
Quote Posted by rujuro
Well, I must say I haven't yet created any flags, but I'm pretty sure I saw a menu to do it in the editor. And I know I saw an action to change a flags state. Hopefully someone who has used this element of the editor can help out a little more. Sorry I can't be more specific. I'm at work and don't have the editor handy.
Another nice little touch might be to flash a non blocking message "key added to keyring" for 1 second just for a little extra feedback (I'm a little concerned that players who have never used the keyring won't know what happened to their keys or why doors won't open). Might get annoying though, so I don't know. A keyring jingle sound would be more elegant, but possibly too vague.
I might just have that message popup the very first time it happens. That way it won't get annoying. I'll poke around the editor a bit more and see about making some custom flags. :)
New Horizon on 2/9/2005 at 18:02
GAH! I'm getting so discouraged. LOL
I really wanted to get this settled before I leave on my trip to Toronto. I'm going to be gone for 8 days.
Anyway, I've poked around the editor and created some flags for the keys.
Key1Destroyed
Key2Destroyed
I then create the trigger scripts using the same name and apply them to the keys. They look like this.
Conditions:
When linked objects [Myself] are destroyed.
Actions:
Set flag [key1destroyed] to [True] expires on map change [True] expires on Mission 20
Then the InvKeyRing archetype is given this modified triggerscript.
Name: Key1OnKeyRing
Conditions:
When [key1destroyed] is set to [True]
When I am used in a way from the inventory.
Actions:
Send Trigger Message [Key1]
Reset conditions and actions.
As far as I know, that should work...but again, I'm not very good at this so I might be missing something simple. I hope I can gain a better understanding of this system through all of this trial and error. :)
Can anyone think what might be missing?
rujuro on 2/9/2005 at 19:36
I might be wrong here, but I think in that case you might want to use "query if" flag=false, instead of "when", since "when" might only be looking for the moment it changes.
New Horizon on 2/9/2005 at 19:52
Quote Posted by rujuro
I might be wrong here, but I think in that case you might want to use "query if" flag=false, instead of "when", since "when" might only be looking for the moment it changes.
Ahhh, ok. I had considered using that one but the comment on it said that it was only for conversations or something like that. I should try it all the same.
:Edit
Damn, still not working. I just don't understand why. It's seems logical enough to me that it should work.
Does the logic and/or operator funtion need to be used with Query?
ascottk on 2/9/2005 at 20:12
I think the condition should be when the key is frobbed then the flag is set.