Delay timer for myMarkerREF.enable in quest result script?

Post » Fri May 13, 2011 1:35 pm

I currently have a ton of objects set up in stages to be enabled separately and at different times to simulate 7 different phases of construction. Right now I have them all set to enable via the result script box for each corresponding quest stage with the simple myMarkerREF.enable in the script box.

I would like to have those enables put on a delay of a day or two to make it more realistic as construction does not happen instantly. Is there a simple addition I can just put in the result script where the enable is or is this going to be more complicated and require multiple scripts and so forth?

If it requires multiple scripts, is there another instance in the game I can look at to see if I can figure it out and use it? Or, if you already have some scripts that will do this would you be so kind as to paste them here for me?

Thanks!
User avatar
Kelsey Hall
 
Posts: 3355
Joined: Sat Dec 16, 2006 8:10 pm

Post » Sat May 14, 2011 12:01 am

http://cs.elderscrolls.com/constwiki/index.php/Scripting_Tutorial:_Creating_a_Simple_Timer
http://www.thenexusforums.com/index.php?/topic/280328-coordinating-multiple-npc-actions/page__view__findpost__p__2538366 at newvegasnexus where I learned about doing this, with helpful example by rickerhk.
User avatar
Nana Samboy
 
Posts: 3424
Joined: Thu Sep 14, 2006 4:29 pm

Post » Fri May 13, 2011 12:25 pm

Sounds like what you will need is at the very least a quest script attached to the quest, or an object script attached to something in the area. You can use the function http://geck.gamesas.com/index.php/Special_Variables to make delays like you seem to want. Basically in your script set a float variable to GameDaysPassed then use that to track the days like so...

scn MyScriptfloat MyDayfloat CurrentDayshort onceBegin GameModeif once == 0 If getstage MyQuest == 100  ; use your quest name and stage number here   set MyDay to GameDaysPassed   set once to 1 endifendifif once == 1   set CurrentDay to GameDaysPassed if  CurrentDay - MyDay >= 1   MyRef01.enable   set once to 2 endifendifif once == 2   set CurrentDay to GameDaysPassed if  CurrentDay - MyDay >= 2   MyRef02.enable   set once to 3 endifendifend


The above will enable the first reference 24 hours after the quest hits the desired stage, then the second reference 24 hours later. You can just keep going with this for as many days as you have references for.
User avatar
Brιonα Renae
 
Posts: 3430
Joined: Mon Oct 22, 2007 3:10 am

Post » Fri May 13, 2011 5:51 pm

Sounds like what you will need is at the very least a quest script attached to the quest, or an object script attached to something in the area. You can use the function http://geck.gamesas.com/index.php/Special_Variables to make delays like you seem to want. Basically in your script set a float variable to GameDaysPassed then use that to track the days like so...

The above will enable the first reference 24 hours after the quest hits the desired stage, then the second reference 24 hours later. You can just keep going with this for as many days as you have references for.


Thank you David and b3w4r3!

b3w4r3, that looks almost exactly like what I need with one little exception. In stead of each reference enabling after one certain stage (stage 100 the way you have it), I need each reference enabled after each of their corresponding stages in my quest. In other words stage 30 enables my first ref 24 hours later. stage 50 enables my second ref 24 hours later, stage 75 my third ref and so on. I can mostly see how what is there is doing what it does for the most part, but just don't see how to make each stage independent of one another as opposed to enabling after stage 100 in your example. There is a separate mission for each stage, and the player could complete stage 30, take a break from my quest and do other stuff for a couple of game weeks even, and then start my quest back up. But the other ref's would already be enabled if I'm reading this correctly?

Thank you very much, as this is VERY close I think!
User avatar
adame
 
Posts: 3454
Joined: Wed Aug 29, 2007 2:57 am

Post » Fri May 13, 2011 9:02 pm

Would this work or am I insane? Also, if I use GetStageDone that would allow the player to do the stages in a random order too, right? In other words, they could do stage 40 first, enable the REF for stage 40 a day later, and do stage 30 next if they choose to? I'm trying to make it non linear in some places if I can.

scn MyScriptfloat MyDayfloat CurrentDayshort onceBegin GameModeif once == 0 If getstage MyQuest == 30  ; use your quest name and stage number here   set MyDay to GameDaysPassed   set once to 1 endifendifif once == 0 If getstage MyQuest == 50  ; use your quest name and stage number here   set MyDay to GameDaysPassed   set once to 2 endifendifif once == 0 If getstage MyQuest == 75  ; use your quest name and stage number here   set MyDay to GameDaysPassed   set once to 3 endifendifif once == 1   set CurrentDay to GameDaysPassed if  CurrentDay - MyDay >= 1   MyRef01.enable   set once to 0 endifendifif once == 2   set CurrentDay to GameDaysPassed if  CurrentDay - MyDay >= 1   MyRef02.enable   set once to 0 endifendifif once == 3   set CurrentDay to GameDaysPassed if  CurrentDay - MyDay >= 1   MyRef03.enable   set once to 0 endifendifend

User avatar
Trey Johnson
 
Posts: 3295
Joined: Thu Oct 11, 2007 7:00 pm

Post » Fri May 13, 2011 11:02 am

It looks like you are going in the right direction. There is going to be a problem though once a reference is enabled and the once variable is set back to 0. It will loop back and possibly catch the same stage again if it hasn't changed (if you are following me). Maybe when you set once to 1, 2, 3 etc, you can also bump the stage up a notch to like 31, 51, 76. So just before or after the set once to 1, add setstage MyQuest 31

if once == 0
If getstage MyQuest == 30 ; use your quest name and stage number here
set MyDay to GameDaysPassed
setstage MyQuest 31
set once to 1
endif
endif

That way that block won't run again messing your intentions.

As far as doing them out of order I'm not sure. I did a lot of quest design in oblivion, but not much in fallout. I don't think it is possible to go backwards in quest stages, but I may be wrong.
User avatar
Javier Borjas
 
Posts: 3392
Joined: Tue Nov 13, 2007 6:34 pm

Post » Fri May 13, 2011 6:34 pm

It looks like you are going in the right direction. There is going to be a problem though once a reference is enabled and the once variable is set back to 0. It will loop back and possibly catch the same stage again if it hasn't changed (if you are following me). Maybe when you set once to 1, 2, 3 etc, you can also bump the stage up a notch to like 31, 51, 76. So just before or after the set once to 1, add setstage MyQuest 31

if once == 0
If getstage MyQuest == 30 ; use your quest name and stage number here
set MyDay to GameDaysPassed
setstage MyQuest 31
set once to 1
endif
endif

That way that block won't run again messing your intentions.

As far as doing them out of order I'm not sure. I did a lot of quest design in oblivion, but not much in fallout. I don't think it is possible to go backwards in quest stages, but I may be wrong.


Thanks b3, again I REALLY appreciate your and David's help. If it weren't for fine folks such as yourselves helping us noobs out I don't know what we would do, lol.

Anyway, I think I've decided to just go with the linear design as it solves a couple of other issues I saw coming, and it also gives me a chance to let the player really see each stage of the remodel process. I'll post again if I hit any more snags. Have a round on me! :foodndrink:
User avatar
Daramis McGee
 
Posts: 3378
Joined: Mon Sep 03, 2007 10:47 am


Return to Fallout: New Vegas