Jump to content

Dismounts Script

Recommended Posts

  • 8 months later...
  • 9 months later...
  • 3 months later...
  • 1 year later...
I had a look at the script and added some logic so that it keeps track of remaining alive units. So if 3 guys die and they mount up and dismount again, only 3 will come out.


I also added an optional flag parameter you can pass in (ie. to check if both the carrier vehicle and it's cargo are dead). Flag is set to 2 (mounted) 1(dismounted) 0(dead). You can use that to check if trigger if both carrier and group are dead.


Mind you my lua is quite crappy (had to copy units table, remove those that are dead from copy, transfer table over) so im sure there are better ways to optimize this script. But from my testing it worked out pretty good.


Attached script and miz file (miz is 2.0 nevada).


Could someone help me with how to add more different units to this list? I'd like to add for example a rifle group without RPGs, a rifle group with insurgent soldiers and so on, but when I just make another group to the list, the way the old ones are formatted the script just does not work. Any help or guidance would be much appreciated!

Link to comment
Share on other sites

  • 9 months later...
  • 2 months later...
On 8/5/2019 at 5:16 AM, fargo007 said:

Does this work with a late activated unit?

It appears as though it detects it as not moving, and dismounts the units in the non-activated units location.

I'm not great at lua, but trying to find if I can get a solution for this at the moment... Will let you know if I'm successful.

Link to comment
Share on other sites

OK - seemed as though it was easier to do than I realised...

Just change the line in the CheckMovement() function to the following:



if v.x == 0 and v.y == 0 and v.z == 0  then --Check if speed is zero



if v.x == 0 and v.y == 0 and v.z == 0  and u:isActive() then --Check if speed is zero


(So just adding an "and u:isActive()" check in there) seemed to do the job.


Disclaimer - I'm a hack at lua, not proficient. YMMV... test well. 😉


Edited by Dangerzone
Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...