Page 1 of 1
Creating and testing a scen with Scen is Loaded Event
Posted: Fri Jun 22, 2018 8:15 pm
by Whicker
I am working on a weather model - night and morning low clouds, and to control it I set a couple things using SetKeyValue in an event with Scenario is Loaded as the trigger.
But every time I load it to test it the Event switches to off.
I am new to creating scens, so I am in the editor, at hour 0 and I edit some stuff, then save it, then go to the Start menu, load it as a non editor, and then play it - boom, the scen loaded event fires, but now if I quit and reload it the event doesn't fire the next time, I have to go back to the editor and open the event and reset it to active.
Is there a way to avoid this? I am loading it as a new scen not a save.
RE: Creating and testing a scen with Scen is Loaded Event
Posted: Fri Jun 22, 2018 8:46 pm
by Whicker
I'm also having trouble with the SetKeyValue - it is keeping its value even though I am trying to run it as a new scenario. If I have an existing scen that I am working on in the editor how do I test as if I was loading it for the first time? so the SetKeyValues should be reset to nil.
I guess it doesn't really matter, I was checking the Key to see if it was nil, but since this is in the `Scen is Loaded` trigger it doesn't really matter if it is set or not, I will skip checking it and just set it explicitly on start and it should be fine. As long as it only runs once.
RE: Creating and testing a scen with Scen is Loaded Event
Posted: Fri Jun 22, 2018 11:22 pm
by Rory Noonan
I'm having a bit of trouble following you on this one.
There's no need to switch to non-editor mode to test Lua scripts. You can just plug them straight into the console in editor mode to see if they work.
RE: Creating and testing a scen with Scen is Loaded Event
Posted: Fri Jun 22, 2018 11:41 pm
by Whicker
I do that for one off ones, but I want to test the event (lua) that gets triggered every 30 minutes and watch it for a few days to see if it behaves the way I want it to. It seems weird to me to do things (play) while I am in the editor mode as I can't figure out how to reset it - like if I go 8 hours into it, I am afraid I will save it and then I'm not sure how to get back to where I was - though there are no units, it is just weather.
It would be interesting as a newb to see someone develop and test a small scenario. I can't quite wrap my head around it just yet.
RE: Creating and testing a scen with Scen is Loaded Event
Posted: Sat Jun 23, 2018 1:07 am
by Rory Noonan
That's actually a great idea. I have been wanting to do some videos for a while, maybe now is the time.