New here. I ran into a scripting conundrum in my module that I can't seem to solve with my limited scripting experience (usually I rely on Lilac Souls' script wizard to do everything), so I thought I'd bring the issue here.
Basically, I have two NPCs that start to banter back and forth (speaking strings of text that float above their heads) when the PC enters an area (I scripted this using Gestalt's custom functions, though it is not a true cutscene--the PC can move around, leave if he wants, or, if he gets too close, get spotted by the NPCs and get attacked). This part was pretty easy, and it makes use of an ExecuteScript function in an OnEnter event.
Here's the hard part: I want to make it so that if the PC eavesdrops on the conversation long enough, an entry will be added to the player's journal. However, if the PC leaves the conversation too early and doesn't see the pertinent line of text, the entry will not be added.
I am having trouble doing this. I have it so that when the player enters the area and the cutscene fires, he also sets an integer to 1. If the player exits the area, the integer is set to 0. I then set up a conditional so that if the integer is 1 after 80 seconds have elapsed (about the time it takes for the pertinent line to be spoken), the player gets a new journal entry. However, testing the script, I notice that even if the player leaves the area and the integer is set to 0, the journal entry gets added, which I do not want.
I see why this is happening. Setting the integer to 0 does not cancel the delaycommand journal function. I'm not sure what to do. Any suggestions?
tl;dr: I'm trying to make a script that will add an entry to the player's journal if he eavesdrops on a conversation between two NPCs for long enough. I also want to make it so the entry will not be added if he leaves too soon. How do I do this?
Thanks!
Modifié par dr. b, 03 août 2013 - 12:37 .





Retour en haut







