icecreamassassin Posted July 25, 2011 Share Posted July 25, 2011 So I'm trying to create a day timer that will trigger a quest stage after 30 days. So far this is what I have, and it all appears to function properly from a script error stance, but it doesn't seem to trigger after the desired number of days pass. Basically you get a loan from a banker, it sets a script variable at the same value as the current gameday and then has another variable which is the same value +30 (indicating the 30 days later) and when the gameday timer is equal or more than this second timer, it triggers the next stage of a quest. Scriptname CRbankloanscript short repayday short loanstart Begin GameMode if CRbankloanamount > 1 ; this passes as true when the loan is opened and the global variable is set to the loan amount if loanstart == 0 ; passes if this section hasn't run yet set loanstart to gameday ; sets the variable to the current gameday value (hence making the previous step fail in the future) set repayday to loanstart +30 ; variable is set as the current gameday value +30 (the day that the loan must be repaid by) endif endif if loanstart > 0 ;passes if the above section executes if gameday >= repayday ;when the game's built in gameday timer meets or exceeds the variable set in the last block setstage CRbankaccount 20 ;sets the stage of the quest which puts the global variable at -1 and sets a bounty for the loan amount endif endif if CRbankloanamount == 0 ;if the loan is repaid properly or no loan has ever been opened the two variables for the above blocks will remain at 0 set loanstart to 0 set repayday to 0 endif end So any insight? what am I missing here? Link to comment Share on other sites More sharing options...
MShoap13 Posted July 25, 2011 Share Posted July 25, 2011 (edited) Did you try waiting 31 days? Also, did you include a global reference to "gameday" in your plugin? Edited July 25, 2011 by MShoap13 Link to comment Share on other sites More sharing options...
fg109 Posted July 25, 2011 Share Posted July 25, 2011 Use GameDaysPassed instead of GameDay. GameDay loops, it goes up to 30 (or however many days there are in that particular month) then goes back to 1 for the next month. Unless you're lucky enough to start the loan at the first of a month, and there is a month somewhere with 31 days, the quest stage would never update. Link to comment Share on other sites More sharing options...
icecreamassassin Posted July 26, 2011 Author Share Posted July 26, 2011 Use GameDaysPassed instead of GameDay. GameDay loops, it goes up to 30 (or however many days there are in that particular month) then goes back to 1 for the next month. Unless you're lucky enough to start the loan at the first of a month, and there is a month somewhere with 31 days, the quest stage would never update. OH yeah that's what I intended on doing, was using gamedaypassed! duurrrr, thanks I'll give that a try. Link to comment Share on other sites More sharing options...
Recommended Posts