PDA

View Full Version : Is this possible? (temporarily blocking dialog)


Mindtwistah
06-13-2007, 01:23 PM
Is it possible to make so you must wait 2 minutes after accesing a nod to initiate a dialog again?

Like this:

-Welcome fellow human. How are you today?[NPC]
- I am good thank you.[PC]
- Oh no, the sith are coming. We cannot talk to eachother for two minutes or else they will think we are dealing with drugs. [NPC] [Inject script that "locks" the ability to open a dialog with the NPC for two minutes]

You try to open a dialog with the NPC but it doesn't work.

After two minutes you try to open a dialog with him. It works.


You get the point..

Master Zionosis
06-13-2007, 01:27 PM
I think you could go one further and use the delay function so the dialog will end then after 2 minutes the dialog will automatically start again, if you are within a certain distance of course.

But I've never done that so it might not work.

stoffe
06-13-2007, 02:04 PM
Is it possible to make so you must wait 2 minutes after accesing a nod to initiate a dialog again?
(snip)
You try to open a dialog with the NPC but it doesn't work.
(snip)
After two minutes you try to open a dialog with him. It works.


Add a new entry at the top (important!) of the dialog file that should be used as a blocker: this node should only have an entry and nothing else. This will prevent you from being put in conversation mode when the dialog starts, the text will just be floated in a bubble over the head of the NPC.

Then put a conditional script on this node that checks if a local boolean value has been set. And put an action script on the "talk to you later" node that sets this local boolean value, with a delayed unset 2 minutes later, on the NPC to make the first entry you added trigger.

// Conditional script for the first node:

int StartingConditional() {
return GetLocalBoolean(OBJECT_SELF, 51);
}


// Action script for the "Oh noes! Talk to you later!" node...

void main() {
SetLocalBoolean(OBJECT_SELF, 51, TRUE);
DelayCommand(TurnsToSeconds(2), SetLocalBoolean(OBJECT_SELF, 51, FALSE));
}