Jump to content

Tried to make a script to detect 3 days passed.


JuicyPwner

Recommended Posts

Hello, earlier today I had attempted to try have the script be able to *wait* until 3 days once Player activates the condition heres a sample (unmarked quest btw)

 

scn samplescript

 

int sampleStage

; 1=obtain note for npc

; 2=if player has unique condition met, allow dialogue with npc to give ingredient

; 3=stage when entering dialogue, set selectday to gamedayspassed

; 4=stage when ending dialogue player gave ingredient wait 3 days until the product is made by npc

; 5=product is done, return to npc to get rewards and product

 

 

 

float selectday (i think i did int too just to test, still didnt work)

 

 

if samplestage==1

 

if gethasnote samplenoteREF == 1

set samplestage to 2

endif

endif

 

if samplestage==3

set selectday to gamedayspassed

endif

 

if samplestage == 4

if gamedayspassed-selectday >=3

set samplestage to 5

endif

endif

 

end

 

So everything above saved, its just the functionality never worked. I had specific dialogue where if you asked the NPC after him telling you to wait (stage 4), he *should* tell you hes not finished but it never came up and I knew every condition was satisfied, I believe I did the function gamedayspassed wrong, and while I redid this instance to not use the function (just do it all at once in dialogue without any timer) I really would like to be able to have a timer set for it for a later version. If anyone could give some tips that would be great

 

 

edit: I think i found a solution but still if anyone has any tips it would be cool, got the following from geck wiki:

 

  • If all you want to know is if it is a new day (strictly meaning that the 12:00am boundary has been crossed), save the current GameDaysPassed into a SHORT variable (lastDay) and then when you want to do your comparison, create a SHORT (currentDay) and set it to the current GameDaysPassed. If (currentDay - lastDay) >= 1, then a day has passed. By storing GameDaysPassed in SHORT variables you trim off the factional hours that live in the decimal places. If you use floats instead of SHORTs you will essentially be checking if "24 hours has passed" rather than, "is it the next day."

I think with this I should be able to detect if 3 days go by,

 

short FirstDay

 

set FirstDay to GameDaysPassed

 

if samplestage==4

if (gamedayspassed-firstday) >=3

set samplestage to 5

endif

endif

end

 

but then again the wiki says it only detects if 24 hours have passed :/

Edited by JuicyPwner
Link to comment
Share on other sites

GamedaysPassed only seems to function if you set a specified date. If you don't specify the date, it defaults to October 13, 2281. So it's running off of since you started the game, at least to my understanding. What I think you need to do is set "selectday" to gameday, not gamedayspassed.

Edited by ashtonlp101
Link to comment
Share on other sites

Day time passage is weird in the GECK. Most vanilla scripts that deal with it use an internal value to keep track of it. The only ones that I know of and have thoroughly looked at were the assassin squad scripts. Which are a HUGE mess and really difficult to understand. Here is an example script that I've tried to make as easy to understand as possible. It sets a quests stage to 20 three days after it was set to 10:

scn ThreeDayQuestScript

short DoOnce ;set istartday values once
short DoOnceA ;do the thing once
int iStartDay ; the start day

begin GameMode

if getstage ThreeDayQuest == 10 ;whatever stage you want to have three days pass from
	if DoOnce == 0;set iStartDay
		set DoOnce to 1
		set iStartDay to GameDaysPassed
	endif

	if GameDaysPassed - iStartDay >= 3 && DoOnceA == 0 ;three days have passed and this hasn't happened yet
		set DoOnceA to 1
		setstage ThreeDayQuest 20 ;whatever effect you want to happen
	endif
endif

End
Edited by clanky4
  • Thanks 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

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