Jump to content

WirtsTools - Simple to use features for mission makers


Recommended Posts

WirtsTools - LUA Library for Mission Makers

So I have been considering posting this for a while, figured it was time to finally do it. I have been slowly building out a collection of features written in lua, almost entirely from running into various things that either cannot be done or are incredibly arduous to accomplish through normal triggers etc while building missions.

The entire library is designed to be loaded and then have the individual features enabled/triggered with a one-liner function call, so while you technically have to 'write' lua to use it, it is quite trivial to do. Indeed within the group I fly with there are now several people using it regularly to various extents that otherwise have no programming or scripting background or knowledge.

so WirtsTools, you can find it here: https://gitlab.com/b4802/mission-tools/

The info you need to use all the features is there as the readme, but I will quickly go over the various functions here as well

FEATURES:

popFlare: This gives your players radio options for popping signal flares, great substitute for aircraft that should have a flare gun and don't, or just as a easy aid if you are flying with new players and want a nice visual option to help them find you

impactInZone: This lets you pick a zone and give a flag name, that flag will be incremented whenever a weapon (you can define specific munitions or all bombs/rockets) impacts the ground within that zone. This exists because the only weapon in zone trigger options don't have any way to detect impacts, will trigger from a weapon flying through the zone at 20k feet, also it works with quad point zones

impactNear: Similar to impactInZone, increment a flag when a weapon impacts within a defined range of a specific unit or any unit in a specific group

playerNear: Will increment a flag for every second that a player (any player or specific groups) is within a defined range of a target unit or any unit in a target group, great for triggers detecting intercepts etc

coverMe: Sets the players invisible if there are AI near them so if you have ai following or escorting the players close the AI will focus fire the AI first before engaging the player

invisAlt: Toggles players invisible if they are below a defined altitude (AGL), this works great with the later stormtrooperAA feature for warbirds and helicopters

suppression: A basic suppression mechanic, hits on units in a group will set them to hold fire for a moment, more hits extends the time and kills extend it further, will always be quite short and there is a limit so you cant permanently suppress a group

missileDeath: Ensures hits from missiles are kills every time, good for time travel missions as warbirds are weirdly resilient to missiles, or any situation where you want any hit to be a for sure kill

killSwitch: This one is for larger PvE missions with many players, it allows you to define radio items that are attached to a player name, idea being that regardless of what slot you take only your group will see them, that way backup radio options for when triggers break or a flight fails or other issues that you may have wont be seen and accidentally (or deliberately) used before they should

tasking: lets you define 'taskings' as late activated groups then you can give that groups mission (all its waypoints) to another group on demand, waypoints can be given relative or absolute

stormtrooperAA: Im a fan of this one in my missions, it takes control of the units you designate and tasks them with fire at point every few seconds based on location and velocity and a basic lead calc for blue players nearby, this way you can get some decent volume of fire, players feel like they are being shot at and indeed it can hit if they really fly straight and lazy, but doesn't slaughter the players, can mix some of these with some that do their own thing to up the threat, or couple with invisAlt to make it so when the players are super low the AA shoots but has a hard time hitting them, as they climb it becomes more dangerous

shelling: Simple alternative version to the base-game shelling zone, no quad zones yet unfortunately (if anyone has a performant way to generate random points in a polygon let me know), but it lets you pick a zone and define a rate, once started it will persistently shell that zone in random places, can go a long way to giving the appearance of a war going on without needing piles of units etc, also supports safe zones where it will not drop any explosions.

MLRS: We all love seeing them shoot we all hate the lag spike when they strike, this allows you to have MLRS rockets deleted mid-flight (after the smoke trail has stopped), so you can get the cinematic effect without murdering FPS

percentAlive: Will persistently update a flag with the percentage of units that are alive in any number of groups(you give it a list of groups)

ejectionCleanup: Pretty simple one, just deletes 50% of pilots that eject immediately and all others after a minute, this is specifically targeted at missions with large bombers etc where you end up with 10+ pilots in the sky for every one of them downed and can really hurt framerate

IRStrobe: This places a blinking IR strobe on units in a group, can do it(turn them on or off) in a normal trigger or easily as a advanced waypoint action

 

Anyway that's what I have for now, always more coming and sometimes existing features are revisited and enhanced, just please note I am not a developer type, im confident in this script thats why I am sharing it but im sure plenty of people could find "better" ways to do it that are more in line with LUA standards or whatever, im not too worried about that....but if anyone wants to steal this and run with it making some new thing go for it you have my blessing.

 

Also no promises but feel free to voice feature requests here, I'll happily include any that make sense to me, are viable, and that I have the time to develop, and love taking a stab at new and crazy ideas.

 

Finally the user community so far is fairly small so its not uncommon for some features to go unused for several DCS patches, this means there is definitely a chance there are some bugs I've not seen and squashed yet, so please let me know if you run into issues using any of these features

 

thanks,

 

Wirts

  • Like 1
  • Thanks 3
Link to comment
Share on other sites

  • 2 weeks later...

Thank you for sharing bro!

I tried to use:
WT.playerNear.setup("CONTADOR", 2,"flag10", 2000)
But did not work at all.

I am trying to make a script to count how many aircrafts are airbourne and set a flag to this number, so i can determine how many enemey aircrafts i will spawn. can u help me with this?

Link to comment
Share on other sites

22 minutes ago, Marcos Paes said:

Thank you for sharing bro!

I tried to use:
WT.playerNear.setup("CONTADOR", 2,"flag10", 2000)
But did not work at all.

So to be clear you load WirtsTools.lua with a do script file trigger sometime after mission start

 

Then run that 1 liner in a do script later

 

And then as a player in a blue coalition aircraft get within and stay within 2000 meters of units in the ai group called CONTADOR and flag10 doesn't increment?

 

As for your overall goal playerNear won't help you check out the getPlayers() function (https://wiki.hoggitworld.com/view/DCS_func_getPlayers )

Can use this to get a list of all players in a coalition, then check the size of that list to see how many players are slotted in

 

If you specifically want airborne you will want to loop through the list checking each players altitude, incrementing a counter if higher that ground


Edited by WirtsLegs
Link to comment
Share on other sites

  • 2 months later...
On 1/20/2024 at 4:46 PM, Fisherman82 said:

Sadly I think its safe to say that this script is dead for 2.9.

Parts of it are definitely working as I know people using it

However I haven't had a chance to evaluate it against the most recent update, will check when I can and update if needed

Link to comment
Share on other sites

On 1/20/2024 at 4:46 PM, Fisherman82 said:

Sadly I think its safe to say that this script is dead for 2.9.

update on this, script is working fine, found small bug in debug/help functionality but core function is working (have DM'd you additional info). Ensure you use the correct munition names for ImpactInZone to work.

Link to comment
Share on other sites

  • 4 weeks later...

Hi!, amazing compilation of very different tools in here!.

I was pretending to modify a Pretense mission to make use of the Stormtrooper function but then realized that I would have to modify loads of name groups just to only use this.  Would it be possible modify the script so it looks for group names containing a specific word, like "supply" or "defense" instead of starting with AA_? I´m asking cause my knowledge of scripting is quite vague, I managed to understand more or less what it means throughout all the time that I have modifying mission but that mostly it, thit is all that I´m able to do at the moment. I know which line of the code the one is referring to the name of the groups but not what to change there.

Anyway, thank you so much for sharing this with the community. 

Link to comment
Share on other sites

On 2/15/2024 at 11:34 AM, mimamema said:

Hi!, amazing compilation of very different tools in here!.

I was pretending to modify a Pretense mission to make use of the Stormtrooper function but then realized that I would have to modify loads of name groups just to only use this.  Would it be possible modify the script so it looks for group names containing a specific word, like "supply" or "defense" instead of starting with AA_? I´m asking cause my knowledge of scripting is quite vague, I managed to understand more or less what it means throughout all the time that I have modifying mission but that mostly it, thit is all that I´m able to do at the moment. I know which line of the code the one is referring to the name of the groups but not what to change there.

Anyway, thank you so much for sharing this with the community. 

absolutely possible and not a overly difficult edit, check out line 1081 you will see where it checks for the name prefix, can change that to anything

However note that current iteration will only function on units that exist when the initialization script is run (so late spawned via script wont work)

also due to a DCS bug if the units in question are red or blue (not neutral) then they will ignore the stormtrooper orders if they detect a valid target within range, why I use neutral units for this usually

  • Like 1
Link to comment
Share on other sites

On 2/21/2024 at 1:47 PM, WirtsLegs said:

absolutely possible and not a overly difficult edit, check out line 1081 you will see where it checks for the name prefix, can change that to anything

However note that current iteration will only function on units that exist when the initialization script is run (so late spawned via script wont work)

also due to a DCS bug if the units in question are red or blue (not neutral) then they will ignore the stormtrooper orders if they detect a valid target within range, why I use neutral units for this usually

Thank you for answering. Yes, then I don´t think it would work as I was planning, we will have to wait till ED sort out how IA shoot straight up to our foreheads 😅

Link to comment
Share on other sites

  • 1 month later...
On 10/24/2023 at 6:40 PM, WirtsLegs said:

WirtsTools - LUA Library for Mission Makers

 

Hello,

Thanks a lot for sharing your script, I found it while looking for a way to check if my missile had hit the ground rather than the intended target. Just wanted to let you know that the "ImpactInZone" script, still works fine on the current DCS 2.9 (MT, on SP).

Best regards,

 

Eduardo

  • Like 1

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

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...