Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Creating and testing a scen with Scen is Loaded Event

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Air / Naval Operations >> Mods and Scenarios >> Lua Legion >> Creating and testing a scen with Scen is Loaded Event Page: [1]
Login
Message << Older Topic   Newer Topic >>
Creating and testing a scen with Scen is Loaded Event - 6/22/2018 11:15:57 PM   
Whicker

 

Posts: 451
Joined: 6/20/2018
Status: offline
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.
Post #: 1
RE: Creating and testing a scen with Scen is Loaded Event - 6/22/2018 11:46:09 PM   
Whicker

 

Posts: 451
Joined: 6/20/2018
Status: offline
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.

< Message edited by Whicker -- 6/23/2018 1:53:51 AM >

(in reply to Whicker)
Post #: 2
RE: Creating and testing a scen with Scen is Loaded Event - 6/23/2018 2:22:23 AM   
apache85

 

Posts: 1365
Joined: 12/18/2014
From: Melbourne, Australia
Status: offline
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.

_____________________________


(in reply to Whicker)
Post #: 3
RE: Creating and testing a scen with Scen is Loaded Event - 6/23/2018 2:41:37 AM   
Whicker

 

Posts: 451
Joined: 6/20/2018
Status: offline
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.


(in reply to apache85)
Post #: 4
RE: Creating and testing a scen with Scen is Loaded Event - 6/23/2018 4:07:17 AM   
apache85

 

Posts: 1365
Joined: 12/18/2014
From: Melbourne, Australia
Status: offline
That's actually a great idea. I have been wanting to do some videos for a while, maybe now is the time.

_____________________________


(in reply to Whicker)
Post #: 5
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Air / Naval Operations >> Mods and Scenarios >> Lua Legion >> Creating and testing a scen with Scen is Loaded Event Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.109