Page 1 of 1

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

Posted: Sat Dec 21, 2019 4:04 am
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!

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

Posted: Sat Dec 21, 2019 7:50 pm
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.

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

Posted: Sat Dec 21, 2019 9:29 pm
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...

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

Posted: Sat Dec 21, 2019 9:39 pm
by thewood1
I think there is an example of that actual statement in the Lua documentation.

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

Posted: Sat Dec 21, 2019 9:54 pm
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?

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

Posted: Sat Dec 21, 2019 10:57 pm
by michaelm75au
ScenEdit_SetUnitSide(oldside='Iran', Name='Commercial Tanker - Very Large Crude Carrier [300,000t DWT]', newside='UK')

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

Posted: Sun Dec 22, 2019 12:26 am
by thewood1
btw, there is an entire sub-forum for Lua advice and questions in the mod section.

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

Posted: Sun Dec 22, 2019 11:41 am
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]