Jump to content

Trouble scripting delays


KazFoxsen

Recommended Posts

I have a quest in which the PC brings gecko hides to my vendor and after a day, the PC can return and pick up a new eyepatch made from them. I've got this on a timer which seems to work okay unless the PC drops off more hides (different species) and is waiting for two or more patches simultaneously. I did something like this with separate variables for each variety of gecko:

 

int GeckoFireCustom ;1 = waiting, 2 = done 3 = picked up

float GeckoFireCustomDelay ;my timer variable

 

begin GameMode

 

if GeckoFireCustomDelay == 0

set GeckoFireCustomDelay to -1

 

if GeckoFireCustom == 1 ;choosing a certain topic will set this in results script

if GeckoFireCustomDelay == -1

set GeckoFireCustomDelay to GameDaysPassed + 1

elseif GameDaysPassed > GeckoFireCustomDelay

Set GeckoFireCustom to 2 ;this unlocks the topic response which adds patch.

endif

 

etc.

 

I even have a separate topic for each type of patch, but it still won't work. Anyone have any ideas what would cause a timer to malfunction?

Edited by KazFoxsen
Link to comment
Share on other sites

Hard to tell from what you've posted. Missing endit after the first if? You didn't wait a full 24hrs?

 

If you're running result scripts and you have conditionals on your dialog, then it may be easier to do it all there rather than having a running main quest script.

 

The quest script is still handy though used as a 'Variable Resource'. It doesn't have to contain any blocks.

 

scn MyVRQuestScr

int GeckoFireCustom ;1 = waiting, 2 = done 3 = picked up
float GeckoFireCustomDelay ;my timer variable

 

You're already setting GeckoFireCustom from a result script, so set the Delay variable there too.

 

Conditions for the next dialog...

GetQuestVariable( 'MyQuest.GeckoFireCustom' == 1 ) AND

GetQuestVariable( 'MyQuest.GeckoFireCustomDelay' != 0 ) AND <-- Should not really need this conditional as will be set before GFCustom == 1

GetQuestVariable( 'MyQuest.GeckoFireCustomDelay' < Global(GameDaysPassed) ) <-- Use the 'Global' checkbox in the conditional popup box

 

Hope that makes sense.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...