Community Forum

Setting an Object's Visibility Condition and Minutes Of Day issue.

Forum Overview >> Editor

Created11.01.2022 00:33

Gregg Macfarlane (SirCuddlesWorth) 11.01.2022 00:33
I have a couple issues I need a little help with. First one is I have several object's I want to hide at nighttime but show in the daytime and I got it to vanish using the Visibility Condition.
Minutes of day start = 50
Minutes Of Day End = 1000
It works but it leaves collider, and you can still bump into it. I want it to vanish and not collide till it appears again.

The second issue I have is the Minutes Of Day. I can't figure out when 6AM is and 5PM trigger.
I thought maybe it was military time, but that did not work, it doesn't help that in the editor setting the time of day in Environment Settings window don't do anything visually I can see. Nore does the weather masking.

[Minutes Of Day]
So, it starts at 0 and ends at 1441. So I've tried using 60 and 1200 but it's off.
So how does it count the hours using this method?

Ed Propsner (crotchfrog) 11.01.2022 01:40
I may be wrong, but I think 6AM is 360, and 5PM is 1020. Minutes of the day everything is divisible (or multiple of) by 60. 6*60 = 360, 17(00) *60 = 1020

midnight = 0
1AM = 60
2AM = 120
3AM = 180

When you get to 1PM its the 13th hour of the day so 13*60= 780. There are 1440 minutes in a 24hr cycle.

Werries W (werries) 11.01.2022 05:39
Ed is correct, to get the time of day just multiply your hours with 60.
As for the collision... I have been struggling with that as well. I can only find something that may be workable in the admirers sections. Have not tested it yet, but if you find a working solution please let me know.
For example:

local self = {}
setmetatable(self, SunAdmirer_mt) = id
self.switchCollision = Utils.getNoNil(getUserAttribute(id, "switchCollision"), false)

if self.switchCollision then
self.collisionMask = getCollisionMask(id)


g_messageCenter:subscribe(MessageType.WEATHER_CHANGED, self.onWeatherChanged, self)

return self

Gregg Macfarlane (SirCuddlesWorth) 11.01.2022 10:56
Thanks Ed, that helps a bunch! And I will let you know Werries if I find a solution.

Gregg Macfarlane (SirCuddlesWorth) 14.01.2022 08:02
Still have not found a solution, I wish the visibility tab had a time start and end option like the weather.

Gregg Macfarlane (SirCuddlesWorth) 14.01.2022 08:44

Ed Propsner (crotchfrog) 14.01.2022 10:09
What are you still having issues with the fact that the objects are still there, just not visible? You may need to do what Werries suggested and throw together a small script that allows you to work around the issue.

Speaking of which ... @Werries: Where is everyone finding a list or reference of all the game variables, functions, classes, etc. to hook into? I found bunches of tidbits and small examples, but it doesn't seem like enough to get any type of scripting project off the ground.

Werries W (werries) 14.01.2022 10:23
Hi Ed. There should be a gameSource zip folder in your game installation, fs22/sdk/debugger. It has the scripts used in the game inside.

Ed Propsner (crotchfrog) 14.01.2022 13:31
Thanks! I did look through there, but I suppose I need to spend some more time with it and LUA in general.

Colin Smith (WrinkleysRule) 14.01.2022 17:26
Here's a little thought, have you tried setting the Start and Finish times and then setting the Viewer Spaciality Required Mask to say Out Building.
I'm thinking that required means On and Prevent means off

Gregg Macfarlane (SirCuddlesWorth) 14.01.2022 19:21
@Ed Propsner (crotchfrog)
The object vanishes correctly, but you can still collide with it while it's invisible. I have no idea how to make a script for it. I'm more of a creative person.

@Colin Smith (WrinkleysRule)
Yes, I've tried almost all the options in there, while they all make it vanish, it still blocks the player with it's colider.

Note: Log in to post. Create a new account here.