Jump to content

How do I make my character turn back into their default form whenever it becomes day?


Recommended Posts

I'd like to make my character be in their monster form until the next day begins, but they turn into their monster form by hitting 0 sanity. I currently have the latter half of that function done, but I can't figure out the daytime part.

I've attached the code that's relevant to my situation below, thanks in advance!

garfield.lua

Link to comment
Share on other sites

If you're modding for DS, you'll be listening for the "day" event pushed by the world, and you'll be able to check the names of the events in the clock component file; if you're modding for DST, you'll be using the watch world state function, and you can check the worldstate file in the components folder. An example is the pumpkin_lantern prefab:

local function OnIsDay(inst, isday, delayed)
--...
end
-- ...
inst:WatchWorldState("isday", OnIsDay)

 

  • Like 1
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...