Page 1 of 1
Building scenario from Lua
Posted: Sun Feb 25, 2018 3:20 am
by michaelm75au
I am building a scenario from scratch, just using the SE commands (version 1.14)
Basically load the scenario, go to special actions and execute the action.
You will need to switch to the USN to see the units. [Need to see if this can be done in future by a SE command]
25.02.2018
Create a couple of sides
Add some units to one side
Add some missions and assign aircraft to them
Next steps
Add side units to the opposing side
Create some events
RE: Building scenario from Lua
Posted: Mon Feb 26, 2018 11:58 am
by thewood1
Is this the beginning of a quick scenario builder of some sort?
RE: Building scenario from Lua
Posted: Tue Feb 27, 2018 6:55 am
by michaelm75au
No just an example of building a scenario using a number of Lua functions. Should be helpful to see how the commands are put together.
Could be used to say create a new side when certain things happen. Currently it is not easy to hide units are 'inactive'
RE: Building scenario from Lua
Posted: Wed Aug 18, 2021 12:02 am
by aerosky
I have downloaded your "Building scenario.scen", and read the lua script. But I can't find where to trigger the script.
ORIGINAL: michaelm75au
No just an example of building a scenario using a number of Lua functions. Should be helpful to see how the commands are put together.
Could be used to say create a new side when certain things happen. Currently it is not easy to hide units are 'inactive'
RE: Building scenario from Lua
Posted: Sat Oct 30, 2021 1:25 pm
by nukkxx5058
[/quote]
But I can't find where to trigger the script.
Same. I don't understand how the script is incorporated in the scen and how to trigger it other than manually by copy-paste into the Lua console.
The only Lua code I can see is in "special action" when I choose to edit it. Is it it ?
RE: Building scenario from Lua
Posted: Sat Oct 30, 2021 2:38 pm
by thewood1
I think if you don't understand where to "find" lua, you really need to start with the basics and not just examples. I suggest you look at a few of these videos.
https://www.youtube.com/results?search_ ... ua+gatcomb
He does a great job in manageable concepts of showing what lua is and does.
I would start with this one that explains the event editor and that's important to how most people use lua in a scenario design.
https://www.youtube.com/watch?v=TCApvEgog4U
Then this one does a good job of expanding on it and getting into how lua works in the event editor. Its pretty simple. He has a number of others that go into more detail.
https://www.youtube.com/watch?v=0_XMMSs ... T&index=75
RE: Building scenario from Lua
Posted: Sat Oct 30, 2021 3:40 pm
by nukkxx5058
These videos are about syntax which I'm not interested in. What I want is to see where the code is located when I open a scenario with existing Lua script. For example if I want to edit the Lua script of an existing scenario.
RE: Building scenario from Lua
Posted: Sat Oct 30, 2021 7:25 pm
by musurca
"Where" exactly the Lua is in a scenario can be a bit of a complicated question. Lua code can be either:
1) Executed as an LuaScript Action from an Event. (See Editor -> Event Editor -> Events or Actions).
2) Executed from an external file in the CMO/Lua directory.
3) Executed from a Lua script added to the scenario as an attachment.
4) Executed directly from Editor -> Lua Script Console.
Most of the time, the answer is #1, so you'll be able to find the code by browsing through the Events.
RE: Building scenario from Lua
Posted: Mon Nov 01, 2021 8:47 am
by nukkxx5058
ORIGINAL: musurca
"Where" exactly the Lua is in a scenario can be a bit of a complicated question. Lua code can be either:
1) Executed as an LuaScript Action from an Event. (See Editor -> Event Editor -> Events or Actions).
2) Executed from an external file in the CMO/Lua directory.
3) Executed from a Lua script added to the scenario as an attachment.
4) Executed directly from Editor -> Lua Script Console.
Most of the time, the answer is #1, so you'll be able to find the code by browsing through the Events.
OK, got my answer, thanks ! I obviously knew about 4) but was wondering about the other ways. Perfect !