Jump to content

[Scripting] get moon phase?


Recommended Posts

 

Start server, enter LongUpdate(480*8) in the console.

 

Also, I read the code, and there is no "new" moonphase, there is only full moon, so it won't work.

What are you trying to do here? Fix Splumonkeys?

Check this mod:

http://steamcommunity.com/sharedfiles/filedetails/?id=364821573

It has splumonkeys working.

 

What I do for full moon nights is:

local function NightCheck(inst)	if TheWorld.state.isfullmoon then		MyFunction(inst)	endendinst:WatchWorldState("startnight", NightCheck)

 

 

There is New, Quater, Half, ThreeQuater and FullMoon, there just isn't any of those except FullMoon for the "TheWorld.state.isMOONSTATE"

 

And I had a few ideas and I thought splemonkey would be a good test subject.

 

Now hopefully I have learnt enough lua from messing around with the monkey that I can achieve what I'm aiming for. The only problem I can think of atm is Art.

Edited by Aquaterion
Link to comment
Share on other sites

@Aquaterion, alternatively since replacing self did not work you could do.

 

local function OnMoonChanged(inst, phase)endTheWorld:ListenForEvent("onmoonchanged", function(src, phase) OnMoonChanged(inst, phase) end) 

 

 

This will listen for the event on TheWorld instance, but push the instance of the monkey to the function.

Link to comment
Share on other sites

@Aquaterion, alternatively since replacing self did not work you could do.

 

local function OnMoonChanged(inst, phase)endTheWorld:ListenForEvent("onmoonchanged", function(src, phase) OnMoonChanged(inst, phase) end) 

 

 

This will listen for the event on TheWorld instance, but push the instance of the monkey to the function.

 

Well since I got it working I'm not gonna touch it for now, I spent too much time trying to fix something that I had already fixed but didn't realise, thanks though.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...