time of day - like dusk,dawn,day,night with lua (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion



Message


Whicker -> time of day - like dusk,dawn,day,night with lua (10/23/2019 2:29:28 AM)

is it possible to get the time of day with Lua? I haven't seen anything so I assume not. It would have to be relative to a unit or location as obviously it changes, but if I could get the time of day then I could use lua to make a penalty for flying at night. Maybe something else but primarily I am trying to come up with an easy way to penalize a player for flying at night. Other than figuring out roughly what time it is that it gets dark and using that - as that varies by timezone/location too much.




Rory Noonan -> RE: time of day - like dusk,dawn,day,night with lua (10/23/2019 4:37:01 AM)

Not at current but it sounds like a nice thing to have.

I used something along the lines of what you're suggesting to restrict the Cubans to day-only ops in Seven Days in October. Generally a scenario isn't going to be multiple time zones so I think I used 0600 as dawn and 1800 as dusk to restrict the Cuban air ops, it worked pretty well for a scenario that covered a reasonably large geographical area.




Whicker -> RE: time of day - like dusk,dawn,day,night with lua (10/23/2019 5:55:45 AM)

yep - more or less doing that for the AI side, not too bad. But for the player side it is harder to do. I am checking time and then any planes on the ground get their ready time changed - and any planes in the air get put into a table to evaluate later to force some to crash. If the time of day was available it would be much simpler and would work better for penalizing the player side.

I'm also making it cloudy at night so there is nothing to find anyways - as it is a WW II attempt and all anyone has is binoculars. But I want the players planes to crash a percent of the time if they are airborne after dark - a lot of them are carrier based so it would be a bit dangerous to land at night I would think.

My location also straddles a time zone which is a bit of a pain.




michaelm75au -> RE: time of day - like dusk,dawn,day,night with lua (10/23/2019 7:59:28 AM)

I'll add it to my list of things to look into.[:D]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.6875