How to use LUA to simulate VBSS & capture of unfriendly vessel?

Take command of air and naval assets from post-WW2 to the near future in tactical and operational scale, complete with historical and hypothetical scenarios and an integrated scenario editor.

Moderator: MOD_Command

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

How to use LUA to simulate VBSS & capture of unfriendly vessel?

Post by TYHo »

Hi everyone, how would you use lua to simulate VBSS on to a unfriendly vessel and taking control of it? E.g. helo remains in an area for 1min, and the vessel would then change to player side? Thanks!
Shkval25
Posts: 24
Joined: Fri Mar 29, 2019 2:47 am

RE: How to use LUA to simulate VBSS & capture of unfriendly vessel?

Post by Shkval25 »

You can make an event trigger(s) for a particular helicopter in the event editor, no Lua required. You'll need to create three or more markers around the target ship and set them to be locked to that ship. This creates a zone around the ship that will move with it. Having a unit change sides is one of the Lua commands in the drop-down menu after you've created a Lua-type action. Just select that command, hit "add" and it will appear in the text field. Just replace the placeholder with the name of the target ship and you're done.
TYHo
Posts: 67
Joined: Tue May 17, 2016 2:37 pm

RE: How to use LUA to simulate VBSS & capture of unfriendly vessel?

Post by TYHo »

Thanks for your help! Fixing the reference point on the vessel is exactly what I need! Now to figure out how to write the Action script for changing sides...
thewood1
Posts: 7065
Joined: Sun Nov 27, 2005 6:24 pm

RE: How to use LUA to simulate VBSS & capture of unfriendly vessel?

Post by thewood1 »

I think there is an example of that actual statement in the Lua documentation.
You are like puss filled boil on nice of ass of bikini model. - BDukes
Oh good lord stop. Does anybody ever like you? - BDukes
TYHo
Posts: 67
Joined: Tue May 17, 2016 2:37 pm

RE: How to use LUA to simulate VBSS & capture of unfriendly vessel?

Post by TYHo »

Yep, I saw that, but I can't seem to get it right...

ScenEdit_SetUnitSide(side='Iran', Name='Commercial Tanker - Very Large Crude Carrier [300,000t DWT]', newside='UK')

What parameters am I missing?
User avatar
michaelm75au
Posts: 11910
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: How to use LUA to simulate VBSS & capture of unfriendly vessel?

Post by michaelm75au »

ScenEdit_SetUnitSide(oldside='Iran', Name='Commercial Tanker - Very Large Crude Carrier [300,000t DWT]', newside='UK')
Michael
thewood1
Posts: 7065
Joined: Sun Nov 27, 2005 6:24 pm

RE: How to use LUA to simulate VBSS & capture of unfriendly vessel?

Post by thewood1 »

btw, there is an entire sub-forum for Lua advice and questions in the mod section.
You are like puss filled boil on nice of ass of bikini model. - BDukes
Oh good lord stop. Does anybody ever like you? - BDukes
TYHo
Posts: 67
Joined: Tue May 17, 2016 2:37 pm

RE: How to use LUA to simulate VBSS & capture of unfriendly vessel?

Post by TYHo »

Thanks for helping, everyone! Sorry I double-posted bcos I think less ppl may visit the Lua Legion sub-forum, and I was getting impatient waiting for responses. I will continue this topic there then. Moderators, pls delete this thread if necessary. Thanks! [&o]
Post Reply

Return to “Command: Modern Operations series”