Simulate VBSS, capture of enemy airport & vehicles (Full Version)

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



Message


TYHo -> Simulate VBSS, capture of enemy airport & vehicles (12/20/2019 3:58:41 PM)

Hi everyone, how would you use lua to simulate VBSS fast-roping onto a unfriendly vessel and taking control of it? E.g. helo remains in an area for 1min, and the vessel would than change to player side? Thanks! [;)]




michaelm75au -> RE: Simulate VBSS (12/21/2019 7:17:23 AM)

You would need an action where the unit side was changed to capturing side.

ScenEdit_SetUnitSide({side=oldSide, Name=unitToChange, newside=newSide})




TYHo -> RE: Simulate VBSS (12/21/2019 11:05:13 PM)

Thanks for replying! Would such a script be correct? For e.g.

ScenEdit_SetUnitSide(side='Iran', Name='Very Large Crude Carrier', newside='UK')

What parameters am I missing?




michaelm75au -> RE: Simulate VBSS (12/22/2019 12:39:29 AM)

That looks okay. However the name has to be unique for it to work properly.




michaelm75au -> RE: Simulate VBSS (12/22/2019 12:56:09 AM)

Also you can use the GUID of the actual unit in place of 'Name'
ScenEdit_SetUnitSide(oldside='Iran', guid='4503e1fa-b6be-43c0-87bf-a602dded4001', newside='UK')




Rory Noonan -> RE: Simulate VBSS (12/22/2019 3:44:50 AM)

This scenario I made a while back has pretty solid VBSS mechanics; you can also 'shoot out the engine' from Coast Guard helos to slow fast boats down.

https://www.matrixgames.com/forums/tm.asp?m=4690352




TYHo -> RE: Simulate VBSS (12/22/2019 1:43:24 PM)

Thanks guys! Esp. apache85... I will take a look at your scenario and see I can figure out the LUAs through 'reverse engineering'! [;)]




Rory Noonan -> RE: Simulate VBSS (12/23/2019 12:17:51 AM)

Let us know here if you need any help with it [:)]




TYHo -> RE: Simulate VBSS (12/23/2019 10:23:46 AM)

Thanks for your patience and kind offer to help, mate! This old dog really has trouble learning new LUA tricks... [&:] Anyway I have attached a simple creation with objectives to capture enemy airport, tank, and vessel... can I trouble you to take a look and help me correct and improve the event LUA scripts? Thanks! [;)]




Rory Noonan -> RE: Simulate VBSS (12/24/2019 5:40:04 AM)

There's only an .ini file in that zip, I'll need the .scen file to help [:)]




TYHo -> RE: Simulate VBSS (12/24/2019 7:52:48 AM)

Oh yes... Oops! Here you go, thanks! And I looked through your scenario and noticed you used 'Special Action' extensively... I don't know how to link that to the Lua Trigger actually... [:(]




Rory Noonan -> RE: Simulate VBSS (12/24/2019 9:10:20 AM)

I'm not able to look at the .scen file tonight (although I plan to tomorrow), but on Special Actions they are basically Lua scripts that are executed on demand. You can access them (in the editor) through Editor > Event Editor > Special Actions. They're side specifc, so keep that in mind. There is no trigger for them apart from the player activating them through the special action menu.

Very under-utilised in my opinion, nearly all of the scenarios I've made use at least one and often 4-5. I don't recall actually seeing them in any other scenarios though!




Whicker -> RE: Simulate VBSS (12/24/2019 11:17:43 PM)

you are missing the curly brackets - and the air base one the name is incorrect:

ScenEdit_SetUnitSide({oldside='Red', Name='Building (Airport Terminal)', newside='Blue'})

you can run that in the lua console, move time forward and it should change. Then you can update the code in the action (after you reverse it to put it back).

On the helo one you can also check the speed and altitude to only do it if the helo is hovering and at low alt.




TYHo -> RE: Simulate VBSS (12/25/2019 3:48:53 AM)

Awesome Whicker, got it, Thanks! How do you 'force' the helo to be hovering at low alt? Set it as a Condition?

quote:

ORIGINAL: Whicker

you are missing the curly brackets - and the air base one the name is incorrect:

ScenEdit_SetUnitSide({oldside='Red', Name='Building (Airport Terminal)', newside='Blue'})

you can run that in the lua console, move time forward and it should change. Then you can update the code in the action (after you reverse it to put it back).

On the helo one you can also check the speed and altitude to only do it if the helo is hovering and at low alt.





Whicker -> RE: Simulate VBSS (12/26/2019 5:46:36 AM)

I think you could do it as a condition, but you can just do it in the action itself.

I think the helo will trigger the action right? the unit that triggers an action is called UnitX and can be set to a variable:

local u = ScenEdit_UnitX ()

then you can test to see if u.altitude and or u.speed are equal to whatever you want them to be. If so then run your other code, if not then don't.




TYHo -> RE: Simulate VBSS (12/27/2019 2:11:24 PM)

Thanks! I'll give it a try... [;)]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
1.71875