Hornete Posted March 13, 2019 Share Posted March 13, 2019 I've tried using GetWorldPosition but it does not work, neither does TheWorldPosition. Does anyone know what would be the DST equivalent of GetWorldPosition()? Thank you for reading! Link to comment Share on other sites More sharing options...
YakumoYukari Posted March 13, 2019 Share Posted March 13, 2019 (edited) I think this is what you're looking for. x,y,z = inst.Transform:GetWorldPosition() Edited March 13, 2019 by YakumoYukari Link to comment Share on other sites More sharing options...
Hornete Posted March 13, 2019 Author Share Posted March 13, 2019 1 hour ago, YakumoYukari said: I think this is what you're looking for. x,y,z = inst.Transform:GetWorldPosition() Thanks! P.S. Sorry for bugging you more But what would GetClock be in Don't starve together? Link to comment Share on other sites More sharing options...
YakumoYukari Posted March 13, 2019 Share Posted March 13, 2019 (edited) I believe there's no GetClock or TheClock things in DST. You have to approach it by problem-specific. What exactly trying to do? Edited March 14, 2019 by YakumoYukari Link to comment Share on other sites More sharing options...
Hornete Posted March 13, 2019 Author Share Posted March 13, 2019 Just now, YakumoYukari said: I believe there's no GetClock or TheClock things. You have to approach it by problem-specific. What exactly trying to do? inst:DoTaskInTime(math.random(), function() --print(inst, "spawn check day") if not GetClock():IsDay() then Empty(inst) end end) So something like this, if it isn't day then the function Empty is performed (For context this is a home for a creature called elder mandrake, it leaves its home during dusk and night but stays in the day) Link to comment Share on other sites More sharing options...
YakumoYukari Posted March 13, 2019 Share Posted March 13, 2019 There're two options. 1. Use WatchWorldState. (Recommended) 2. Get law worldstate data. Seems your case doesn't need to bind to WatchWorldState(). Instead, you can directly get the value of worldstate(isday) by isday = TheWorld.components.worldstate.data.isday The code above will detect daytime overworld only(otherwise it's always false). If you need to detect it also in Cave, isday = TheWorld:HasTag("cave") and TheWorld.components.worldstate.data.iscaveday or TheWorld.components.worldstate.data.isday Link to comment Share on other sites More sharing options...
Developer zarklord_klei Posted March 14, 2019 Developer Share Posted March 14, 2019 you don't need to do TheWorld.components.worldstate.data, TheWorld.state is equivalent to that. 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