MattDoesnt Posted January 11, 2015 Share Posted January 11, 2015 So here's what I've got right now: The ListenForEvent section is in my master_postinit. Is there anything missing, or out of place that I'm not aware of? I'm lost. Link to comment Share on other sites More sharing options...
MattDoesnt Posted January 11, 2015 Author Share Posted January 11, 2015 Forgot to even post the actual problem, haha.... Nothing changes when the time of day changes. Whenever I log in, it will check for the current time of day, but other than that it won't change at all. The problem is getting the ListenForEvent to actually listen for something. Link to comment Share on other sites More sharing options...
Aquaterion Posted January 11, 2015 Share Posted January 11, 2015 You can check for world state changed like this: changing:inst.ListenForEvent("daytime", function() updatestats(inst) end, GetWorld())inst.ListenForEvent("dusktime", function() updatestats(inst) end, GetWorld())inst.ListenForEvent("nighttime", function() updatestats(inst) end, GetWorld())toinst:WatchWorldState("phase", updatestats)unless you wanted to to be a ListenForEvent only..I think you can still use but I'm not sure about this one..inst:ListenForEvent("phasechanged", updatestats) Link to comment Share on other sites More sharing options...
DarkCrafter Posted January 11, 2015 Share Posted January 11, 2015 (edited) inst.ListenForEvent("daytime", function() updatestats(inst) end, GetWorld())inst.ListenForEvent("dusktime", function() updatestats(inst) end, GetWorld())inst.ListenForEvent("nighttime", function() updatestats(inst) end, GetWorld())The GetWorld part is invaild in dst. It is now TheWorld. Thats what i was told Edited January 11, 2015 by DarkCrafter Link to comment Share on other sites More sharing options...
DarkXero Posted January 11, 2015 Share Posted January 11, 2015 And daytime, dusktime and nighttime are not events pushed. Link to comment Share on other sites More sharing options...
MattDoesnt Posted January 11, 2015 Author Share Posted January 11, 2015 Thanks Aquaterion, the line:inst:WatchWorldState("phase",updatestats)Worked perfectly! I had to change some other lines as well, to match but it all worked out. Thanks again. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now