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:

 

From:

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

 

To:

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

  • 8 months later...

Hey guys I know this is an older thread and an oldie but a goodie script.  There is a limitation on putting it on delay activation groups.  So if groups are spawned later with a trigger the dismounts are spawned on map load.  Wondering what the fix or a work around for that would be ? 

Execute the script after the group is spawned ? 

Also is there a way to make them hidden from the Map when they do spawn ? 
Thanks !  


Edited by Shrike88
Link to comment
Share on other sites

5 hours ago, Shrike88 said:

Hey guys I know this is an older thread and an oldie but a goodie script.  There is a limitation on putting it on delay activation groups.  So if groups are spawned later with a trigger the dismounts are spawned on map load.  Wondering what the fix or a work around for that would be ? 

Execute the script after the group is spawned ? 

Also is there a way to make them hidden from the Map when they do spawn ? 
Thanks !  

 

Hi, try this:

https://github.com/erdenizsanlav/Dcs-Dismounts

It is something I'm working on, has some of the bits of MBot's work here, but mostly its own thing with different features. I add to it as I find time/motivation, but it's already usable in current version. Do tell me if it works well for you 🙂

I was going to create a thread for it later on with a few more features, but hey ho 🙂

Wishlist: F-4E Block 53 +, MiG-27K, Su-17M3 or M4, AH-1F or W circa 80s or early 90s, J35 Draken, Kfir C7, Mirage III/V

DCS-Dismounts Script

Link to comment
Share on other sites

25 minutes ago, fargo007 said:

We both went our own way it seems!  😉

 

https://github.com/Fargo007/TROOP-TRANSPORTS

 

vidya:

 

https://www.youtube.com/watch?v=-BnJ_z7BlzM

Seen yours from I think a video about maybe a month-ish ago 😄 indeed seems to be the case :))

Wishlist: F-4E Block 53 +, MiG-27K, Su-17M3 or M4, AH-1F or W circa 80s or early 90s, J35 Draken, Kfir C7, Mirage III/V

DCS-Dismounts Script

Link to comment
Share on other sites

On 7/17/2022 at 4:31 AM, WinterH said:

Hi, try this:

https://github.com/erdenizsanlav/Dcs-Dismounts

It is something I'm working on, has some of the bits of MBot's work here, but mostly its own thing with different features. I add to it as I find time/motivation, but it's already usable in current version. Do tell me if it works well for you 🙂

I was going to create a thread for it later on with a few more features, but hey ho 🙂

Hi,

 

Awesome script! One question, if I use assignSetSquadTypeToVehicle(‘hostVehicle’, ‘squadType’), can I assign a squad to any vehicle in the ME or does it still have to be one of the preset vehicle types you've listed in the PDF?

Link to comment
Share on other sites

4 hours ago, Hairdo1-1 said:

Hi,

 

Awesome script! One question, if I use assignSetSquadTypeToVehicle(‘hostVehicle’, ‘squadType’), can I assign a squad to any vehicle in the ME or does it still have to be one of the preset vehicle types you've listed in the PDF?

Hi, glad you liked it 🙂

For now it's working for a few preset vehicle types, but I will make it so that you can give a squad to anything next time I update it. 

Wishlist: F-4E Block 53 +, MiG-27K, Su-17M3 or M4, AH-1F or W circa 80s or early 90s, J35 Draken, Kfir C7, Mirage III/V

DCS-Dismounts Script

Link to comment
Share on other sites

On 7/19/2022 at 4:54 AM, Hairdo1-1 said:

if I use assignSetSquadTypeToVehicle(‘hostVehicle’, ‘squadType’), can I assign a squad to any vehicle in the ME or does it still have to be one of the preset vehicle types you've listed in the PDF?

Hi, latest version here: https://github.com/erdenizsanlav/Dcs-Dismounts/releases/tag/v0.9.2-beta allows you to add 7-men squads to anything using this function now 🙂

Wishlist: F-4E Block 53 +, MiG-27K, Su-17M3 or M4, AH-1F or W circa 80s or early 90s, J35 Draken, Kfir C7, Mirage III/V

DCS-Dismounts Script

Link to comment
Share on other sites

  • 3 weeks later...
On 7/20/2022 at 7:17 AM, WinterH said:

Hi, latest version here: https://github.com/erdenizsanlav/Dcs-Dismounts/releases/tag/v0.9.2-beta allows you to add 7-men squads to anything using this function now 🙂

Hi. Using the script and it’s great. I am using the mechanizeall function mainly, I have a few mods installed that I’d like to use that with. How would I go about adding those to to the script?

Link to comment
Share on other sites

Just now, Hairdo1-1 said:

Hi. Using the script and it’s great. I am using the mechanizeall function mainly, I have a few mods installed that I’d like to use that with. How would I go about adding those to to the script?

First off, thanks! 🙂 Glad you're enjoying it.

I did add French Pack vehicles to the pack recently, and thinking of adding a few others as I find time. For other mods, or anything really, you can add specific vehicles their squads using "assignSetSquadTypeToVehicle" but that would be one by one and not randomized so may not be ideal for every situation.

If you would like it to work for the mod you use like it does for vanilla vehicles, you will need to first find the vehicle's type name, you can find it by opening a .miz file with a zip utility like 7zip or winzip, and take a look at the "mission" file inside, there you can find the type names of the vehicles you need to use. Then, you will need to add them to the code within mechanizAll and determineRandomSquad functions both, as these are the sections where it a: only automatically add squads to supported vehicle types, b: actually going about giving them a squad. I am adding some code these days to make it a lot simpler to support mod units and/or adding squads to random units though. So soon enough it'll be easier to do hopefully. Actually, this gave me an idea. I can add something like "addTransportType(vehicleType,transportCapacity)" which can add squads to all vehicles of the type given, with the given size, so it is easier for end user to add unit types that aren't supported by default.

Wishlist: F-4E Block 53 +, MiG-27K, Su-17M3 or M4, AH-1F or W circa 80s or early 90s, J35 Draken, Kfir C7, Mirage III/V

DCS-Dismounts Script

Link to comment
Share on other sites

6 hours ago, WinterH said:

First off, thanks! 🙂 Glad you're enjoying it.

I did add French Pack vehicles to the pack recently, and thinking of adding a few others as I find time. For other mods, or anything really, you can add specific vehicles their squads using "assignSetSquadTypeToVehicle" but that would be one by one and not randomized so may not be ideal for every situation.

If you would like it to work for the mod you use like it does for vanilla vehicles, you will need to first find the vehicle's type name, you can find it by opening a .miz file with a zip utility like 7zip or winzip, and take a look at the "mission" file inside, there you can find the type names of the vehicles you need to use. Then, you will need to add them to the code within mechanizAll and determineRandomSquad functions both, as these are the sections where it a: only automatically add squads to supported vehicle types, b: actually going about giving them a squad. I am adding some code these days to make it a lot simpler to support mod units and/or adding squads to random units though. So soon enough it'll be easier to do hopefully. Actually, this gave me an idea. I can add something like "addTransportType(vehicleType,transportCapacity)" which can add squads to all vehicles of the type given, with the given size, so it is easier for end user to add unit types that aren't supported by default.

Thank you!I think what might be helpful is adding squads to vehicles by name prefix. For example adding a certain squad to any unit that starts with “apc” or “truck” (just as an example). Would this be possible with your script? As a side note I’m trying to use it with the lhl insurgent mod vehicles 

 

Link to comment
Share on other sites

6 hours ago, Hairdo1-1 said:

Thank you!I think what might be helpful is adding squads to vehicles by name prefix. For example adding a certain squad to any unit that starts with “apc” or “truck” (just as an example). Would this be possible with your script? As a side note I’m trying to use it with the lhl insurgent mod vehicles 

 

https://github.com/erdenizsanlav/Dcs-Dismounts/releases/tag/v0.9.21-beta

Give this a try and let me know, I've added both ways to add troops to not normally supported vehicle types in the script:
- If you add "TRANSPORT##" at the beginning of a vehicle's unit name in the editor, it will take 7 men squads.

- If you use addTransportType(vehicleTypeName,troopCapacity), every vehicle of that type will get squads of the size given in troopCapacity parameter.

Wishlist: F-4E Block 53 +, MiG-27K, Su-17M3 or M4, AH-1F or W circa 80s or early 90s, J35 Draken, Kfir C7, Mirage III/V

DCS-Dismounts Script

Link to comment
Share on other sites

6 hours ago, WinterH said:

https://github.com/erdenizsanlav/Dcs-Dismounts/releases/tag/v0.9.21-beta

Give this a try and let me know, I've added both ways to add troops to not normally supported vehicle types in the script:
- If you add "TRANSPORT##" at the beginning of a vehicle's unit name in the editor, it will take 7 men squads.

- If you use addTransportType(vehicleTypeName,troopCapacity), every vehicle of that type will get squads of the size given in troopCapacity parameter.

This is perfect. Thank you!

Link to comment
Share on other sites

@WinterHyou seem to be a scripting whiz.. this moose class (https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Functional.Suppression.html) is no longer being developed and is pretty much dead. Something like this tied in with your dismounts script could be a game changer for ground warfare in DCS


Edited by Hairdo1-1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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