user826 Posted March 9, 2020 Share Posted March 9, 2020 I have a quest script that I want to run once a day, but it refuses to trigger when a new day begins and I don't understand why. My script is attached to a quest that's set to run when the game starts, with a priority of 75 and a processing delay of 1. The script looks like this at the moment: scn MyScript int LastDay begin GameMode if (GameDaysPassed - LastDay >= 1) set LastDay to GameDaysPassed ;The stuff I want to happen daily endif end I also tried using the following GameHour trigger (which has worked for me in the past) to no avail: scn MyScript int DoOnce begin GameMode if (DoOnce == 0) ;The stuff I want to happen daily set DoOnce to 1 endif if (GameHour >= 0) && (GameHour < 1) if (DoOnce == 1) set DoOnce to 0 endif endif end Is there some simple mistake that I'm just not seeing? Right now, it returns the correct value when I start the game, but if I wait 24 hours, or use the console to set the GameHour to 23.99 and wait a few seconds for the clock to tick over, the value doesn't change. It's supposed to increment by one, but it's not happening. Any insight would be greatly appreciated! Link to comment Share on other sites More sharing options...
GamerRick Posted March 9, 2020 Share Posted March 9, 2020 Cough. Link to comment Share on other sites More sharing options...
user826 Posted March 9, 2020 Author Share Posted March 9, 2020 (edited) Never mind, it turns out everything was working correctly, but my math was wrong for the script that I wanted to run daily. It was doing exactly what I told it to do, but the formula was wrong, so the result I got was not the one I was expecting. Edited March 9, 2020 by user826 Link to comment Share on other sites More sharing options...
GamerRick Posted March 10, 2020 Share Posted March 10, 2020 Cool, but you did see that you need JIP to fix the problems with it? Link to comment Share on other sites More sharing options...
user826 Posted March 10, 2020 Author Share Posted March 10, 2020 Well, I don't use JIP when I make mods (I only have it because TTW requires it to run), but it's nice to know there is a solution. Thanks! Link to comment Share on other sites More sharing options...
Mktavish Posted March 10, 2020 Share Posted March 10, 2020 I don't know about the JIP thing since it's a plugin to nvse . But this piece of code is an infinite loop , not going anywhere, (doesn't really loop) ~~~~~~~~~~~~~~~if (GameDaysPassed - LastDay >= 1) set LastDay to GameDaysPassed~~~~`~~~~just get rid of the " = " so only greater than comparison .you don't allways need 2 operators. Link to comment Share on other sites More sharing options...
user826 Posted March 11, 2020 Author Share Posted March 11, 2020 @Mktavish - Thanks for the tip! Link to comment Share on other sites More sharing options...
Mktavish Posted March 11, 2020 Share Posted March 11, 2020 @Mktavish - Thanks for the tip! did it work ? Link to comment Share on other sites More sharing options...
user826 Posted March 11, 2020 Author Share Posted March 11, 2020 Well, it was working fine before, it's just that my formula was not producing the expected result because I typed it in wrong. The original script I posted was fine. Link to comment Share on other sites More sharing options...
Mktavish Posted March 11, 2020 Share Posted March 11, 2020 I guess you lost me now . What I said to change didn't make a difference or just not changed ? Link to comment Share on other sites More sharing options...
Recommended Posts