Simulate VBSS, capture of enemy airport & vehicles

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
TYHo
Posts: 67
Joined: Tue May 17, 2016 2:37 pm

Simulate VBSS, capture of enemy airport & vehicles

Post by TYHo »

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! [;)]
User avatar
michaelm75au
Posts: 12457
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Simulate VBSS

Post by michaelm75au »

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

ScenEdit_SetUnitSide({side=oldSide, Name=unitToChange, newside=newSide})
Michael
TYHo
Posts: 67
Joined: Tue May 17, 2016 2:37 pm

RE: Simulate VBSS

Post by TYHo »

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?
User avatar
michaelm75au
Posts: 12457
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Simulate VBSS

Post by michaelm75au »

That looks okay. However the name has to be unique for it to work properly.
Michael
User avatar
michaelm75au
Posts: 12457
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Simulate VBSS

Post by michaelm75au »

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')
Michael
Rory Noonan
Posts: 2418
Joined: Thu Dec 18, 2014 1:53 am
Location: Brooklyn, NY

RE: Simulate VBSS

Post by Rory Noonan »

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
Image
TYHo
Posts: 67
Joined: Tue May 17, 2016 2:37 pm

RE: Simulate VBSS

Post by TYHo »

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
Posts: 2418
Joined: Thu Dec 18, 2014 1:53 am
Location: Brooklyn, NY

RE: Simulate VBSS

Post by Rory Noonan »

Let us know here if you need any help with it [:)]
Image
TYHo
Posts: 67
Joined: Tue May 17, 2016 2:37 pm

RE: Simulate VBSS

Post by TYHo »

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! [;)]
Attachments
Capturing..ships.zip
(544 Bytes) Downloaded 16 times
Rory Noonan
Posts: 2418
Joined: Thu Dec 18, 2014 1:53 am
Location: Brooklyn, NY

RE: Simulate VBSS

Post by Rory Noonan »

There's only an .ini file in that zip, I'll need the .scen file to help [:)]
Image
TYHo
Posts: 67
Joined: Tue May 17, 2016 2:37 pm

RE: Simulate VBSS

Post by TYHo »

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... [:(]
Attachments
Capturing..ships.zip
(12.82 KiB) Downloaded 23 times
Rory Noonan
Posts: 2418
Joined: Thu Dec 18, 2014 1:53 am
Location: Brooklyn, NY

RE: Simulate VBSS

Post by Rory Noonan »

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!
Image
Whicker
Posts: 664
Joined: Tue Jun 19, 2018 9:54 pm

RE: Simulate VBSS

Post by 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.
TYHo
Posts: 67
Joined: Tue May 17, 2016 2:37 pm

RE: Simulate VBSS

Post by TYHo »

Awesome Whicker, got it, Thanks! How do you 'force' the helo to be hovering at low alt? Set it as a Condition?
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
Posts: 664
Joined: Tue Jun 19, 2018 9:54 pm

RE: Simulate VBSS

Post by Whicker »

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
Posts: 67
Joined: Tue May 17, 2016 2:37 pm

RE: Simulate VBSS

Post by TYHo »

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

Return to “Lua Legion”