Jump to content

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

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

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
×
  • Create New...