Jump to content

Recommended Posts

Posted (edited)

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://github.com/WirtsLegs/WirtsTools/

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 with name or characteristics) 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

weaponNear:Updates a flag to be equal to the count of weapons that are currently near a given target (eg missile flying by), weapons that count are set based on your criteria

weaponInZone: Like weapon Near but in zones, works for quad point or circular zones

weaponHit: increment a flag for each time a given target is hit with a weapon that meets your filter criteria (note this one can have issues in multiplayer read the readme for full details)

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

Edited by WirtsLegs
  • Like 1
  • Thanks 3
  • 2 weeks later...
Posted

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?

Posted (edited)
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
  • 2 months later...
Posted
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

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

  • 4 weeks later...
Posted

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. 

Posted
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
Posted
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 😅

  • 1 month later...
Posted
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 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar

Mobile: iPad Pro 12.9" of 256 GB

  • 4 months later...
Posted

Hey @WirtsLegs, thank you for this script.  I am trying to leverage the IRStrobe functionality in a set of missions and I can't get the toggle to work.

The strobe turns on just fine, but I can't get it to turn off.  I have tried the "nil" and "false" parameters but neither successfully stop the strobing.  Here are the commands I am using:

Turn ON - WT.strobe.toggleStrobe("[UNP 4-31] UH-60A",true,0.40)

Turn OFF (doesn't work) - WT.strobe.toggleStrobe("[UNP 4-31] UH-60A",false,0.40)

Toggle (only turns on, not off) - WT.strobe.toggleStrobe("[UNP 4-31] UH-60A",nil,0.40)

I am running the most recent patch (.59263) on MT.  Thanks.

System Specs:

Spoiler

📻Callsign:Kandy  💻Processor:13th Gen Intel(R) Core(TM) i9-13900K - 🧠RAM: 64GB - 🎥Video Card: NVIDIA RTX 4090 - 🥽 Display: Pimax 8kx VR Headset - 🕹️Accessories:  VKB Gunfighter III MCG Ultimate, VKB STECS Standard, Thrustmaster TPR Pedals, Simshaker JetPad, Predator HOTAS Mounts, 3D Printed Flight Button Box 

📹 Video Capture Software:  Open Broadcaster Software (OBS), 🎞️ Video Editing Software:  PowerDirector 365

Into The Jungle Apache Campaign - Griffins  Kiowa Campaign - Assassins  Thrustmaster TWCS Mod

 

Posted
41 minutes ago, Mistermann said:

Hey @WirtsLegs, thank you for this script.  I am trying to leverage the IRStrobe functionality in a set of missions and I can't get the toggle to work.

The strobe turns on just fine, but I can't get it to turn off.  I have tried the "nil" and "false" parameters but neither successfully stop the strobing.  Here are the commands I am using:

Turn ON - WT.strobe.toggleStrobe("[UNP 4-31] UH-60A",true,0.40)

Turn OFF (doesn't work) - WT.strobe.toggleStrobe("[UNP 4-31] UH-60A",false,0.40)

Toggle (only turns on, not off) - WT.strobe.toggleStrobe("[UNP 4-31] UH-60A",nil,0.40)

I am running the most recent patch (.59263) on MT.  Thanks.

Interesting, I'll give it a look when I can, possible a recent patch broke that

  • Thanks 1
Posted
1 hour ago, WirtsLegs said:

Interesting, I'll give it a look when I can, possible a recent patch broke that

Thank you!!!!

System Specs:

Spoiler

📻Callsign:Kandy  💻Processor:13th Gen Intel(R) Core(TM) i9-13900K - 🧠RAM: 64GB - 🎥Video Card: NVIDIA RTX 4090 - 🥽 Display: Pimax 8kx VR Headset - 🕹️Accessories:  VKB Gunfighter III MCG Ultimate, VKB STECS Standard, Thrustmaster TPR Pedals, Simshaker JetPad, Predator HOTAS Mounts, 3D Printed Flight Button Box 

📹 Video Capture Software:  Open Broadcaster Software (OBS), 🎞️ Video Editing Software:  PowerDirector 365

Into The Jungle Apache Campaign - Griffins  Kiowa Campaign - Assassins  Thrustmaster TWCS Mod

 

Posted
On 8/28/2024 at 5:48 PM, Mistermann said:

Thank you!!!!

hey so i cant get on DCS to test right now but I was able to spend some time looking at the code and think i found the issue anyway. I have pushed a new release on gitlab, give it a try!

  • Thanks 2
Posted (edited)

I'm away from DCS until late next week but will test immediately upon return.  Thank you!

Edited by Mistermann

System Specs:

Spoiler

📻Callsign:Kandy  💻Processor:13th Gen Intel(R) Core(TM) i9-13900K - 🧠RAM: 64GB - 🎥Video Card: NVIDIA RTX 4090 - 🥽 Display: Pimax 8kx VR Headset - 🕹️Accessories:  VKB Gunfighter III MCG Ultimate, VKB STECS Standard, Thrustmaster TPR Pedals, Simshaker JetPad, Predator HOTAS Mounts, 3D Printed Flight Button Box 

📹 Video Capture Software:  Open Broadcaster Software (OBS), 🎞️ Video Editing Software:  PowerDirector 365

Into The Jungle Apache Campaign - Griffins  Kiowa Campaign - Assassins  Thrustmaster TWCS Mod

 

Posted (edited)
On 8/30/2024 at 5:04 PM, WirtsLegs said:

hey so i cant get on DCS to test right now but I was able to spend some time looking at the code and think i found the issue anyway. I have pushed a new release on gitlab, give it a try!

Wirt ... I think something is off.  Now the script is throwing a runtime error.  If I run your prev version, the strobes turn on, but don't turn off or toggle.  This new one throws this error (I execute your script as a "DO SCRIPT" so we can see the line that's causing the error).

image.png

Edited by Mistermann

System Specs:

Spoiler

📻Callsign:Kandy  💻Processor:13th Gen Intel(R) Core(TM) i9-13900K - 🧠RAM: 64GB - 🎥Video Card: NVIDIA RTX 4090 - 🥽 Display: Pimax 8kx VR Headset - 🕹️Accessories:  VKB Gunfighter III MCG Ultimate, VKB STECS Standard, Thrustmaster TPR Pedals, Simshaker JetPad, Predator HOTAS Mounts, 3D Printed Flight Button Box 

📹 Video Capture Software:  Open Broadcaster Software (OBS), 🎞️ Video Editing Software:  PowerDirector 365

Into The Jungle Apache Campaign - Griffins  Kiowa Campaign - Assassins  Thrustmaster TWCS Mod

 

Posted

Wirt - I *think* I found the typo, but will wait for you to confirm.  Below is the "diff" between the last 2 versions of your lua.  I added the "WT." prefix and the code worked.

image.png

  • Like 1

System Specs:

Spoiler

📻Callsign:Kandy  💻Processor:13th Gen Intel(R) Core(TM) i9-13900K - 🧠RAM: 64GB - 🎥Video Card: NVIDIA RTX 4090 - 🥽 Display: Pimax 8kx VR Headset - 🕹️Accessories:  VKB Gunfighter III MCG Ultimate, VKB STECS Standard, Thrustmaster TPR Pedals, Simshaker JetPad, Predator HOTAS Mounts, 3D Printed Flight Button Box 

📹 Video Capture Software:  Open Broadcaster Software (OBS), 🎞️ Video Editing Software:  PowerDirector 365

Into The Jungle Apache Campaign - Griffins  Kiowa Campaign - Assassins  Thrustmaster TWCS Mod

 

Posted (edited)
On 9/4/2024 at 3:45 PM, Mistermann said:

Wirt - I *think* I found the typo, but will wait for you to confirm.  Below is the "diff" between the last 2 versions of your lua.  I added the "WT." prefix and the code worked.

image.png

LOL! woops

that'll teach me to update via my phone browser and not test

YES should be WT. infront of those, ill get a new update pushed later today

Edited by WirtsLegs
  • Thanks 2
Posted
32 minutes ago, WirtsLegs said:

LOL! woops

that'll teach me to update via my phone browser and not test

YES should be WT. infront of those, ill get a new update pushed later today

 

I just feel great that I was able to debug and correct myself!  Trust me, that's quite an accomplishment for this guy!  😆

  • Like 1

System Specs:

Spoiler

📻Callsign:Kandy  💻Processor:13th Gen Intel(R) Core(TM) i9-13900K - 🧠RAM: 64GB - 🎥Video Card: NVIDIA RTX 4090 - 🥽 Display: Pimax 8kx VR Headset - 🕹️Accessories:  VKB Gunfighter III MCG Ultimate, VKB STECS Standard, Thrustmaster TPR Pedals, Simshaker JetPad, Predator HOTAS Mounts, 3D Printed Flight Button Box 

📹 Video Capture Software:  Open Broadcaster Software (OBS), 🎞️ Video Editing Software:  PowerDirector 365

Into The Jungle Apache Campaign - Griffins  Kiowa Campaign - Assassins  Thrustmaster TWCS Mod

 

Posted
On 9/6/2024 at 2:29 PM, Mistermann said:

I just feel great that I was able to debug and correct myself!  Trust me, that's quite an accomplishment for this guy!  😆

haha well done then? But just glad you're enjoying it, always happy to see others using my work, helps justify the time spent haha

feel free to hit me up if you have any other issues/questions/requests

  • Thanks 1
Posted (edited)

We've already talked in the Kiowa campaign thread. I promised to enhance your strobes. Here it is including a short demo mission for Huey, Gazelle or Kiowa. I took your WirtsTools version 2.1.5 as base file from your GitLab. Please excuse me but I had to run a formatter on the whole file so instead of a short diff I deliver a complete new file. 🥺 But I only made real changes in the strobe related parts.

With the help of the model viewer I estimated suitable coordinates on the tail fin of the Blackhawk and the Kiowa to attach our strobes. You'll see it in the mission and I noted it as examples of the ToogleStrobe function. Looks way better than the default strobe in the air above a unit.

Some demo recording on YT.

PS: The AI Blackhawk does not land in the mission – ignoring it's last waypoint of type "Land". WHY???

WirtsTools.lua IRStrobeDemo.miz

Edited by jumphigh
  • Thanks 1
Posted (edited)
18 hours ago, jumphigh said:

We've already talked in the Kiowa campaign thread. I promised to enhance your strobes. Here it is including a short demo mission for Huey, Gazelle or Kiowa. I took your WirtsTools version 2.1.5 as base file from your GitLab. Please excuse me but I had to run a formatter on the whole file so instead of a short diff I deliver a complete new file. 🥺 But I only made real changes in the strobe related parts.

With the help of the model viewer I estimated suitable coordinates on the tail fin of the Blackhawk and the Kiowa to attach our strobes. You'll see it in the mission and I noted it as examples of the ToogleStrobe function. Looks way better than the default strobe in the air above a unit.

Some demo recording on YT.

PS: The AI Blackhawk does not land in the mission – ignoring it's last waypoint of type "Land". WHY???

WirtsTools.lua 59.45 kB · 3 downloads IRStrobeDemo.miz 22.77 kB · 2 downloads

 

Oh awesome! Video looks great and took a look through the code quickly and it looks solid

 

Yeah my bad on formatting, last 2 commits were quick and dirty from my phone and it got a bit ugly, was planning to fix that up on the next one, woops

 

I'll take a proper look on my pc when I can and get this merged, though literally just got to hospital for start of kid being born, so naturally no promises on timeline

 

For anyone else reading this before I update on gitlab, jumphighs version looks solid and I encourage you to give it a go

Edited by WirtsLegs
  • Recently Browsing   0 members

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