-
Notifications
You must be signed in to change notification settings - Fork 0
General Features
Updates a flag with the overall percent (0 - 100) of the units in the designated groups that are alive.
groups <table>: table of the group names you want this to apply to
flag <string>: the name of the flag you want the alive status to be updated through
WT.percentAlive.setup(groups,flag)Example
WT.percentAlive.setup({"SMERCH-1","SMERCH-2","SMERCH-3"},"smerch_groups") --will update a flag called 'smerch_groups' based on the percentage of the those groups that are aliveIncrement a flag for every second that a player is within a defined distance of a defined AI group
target_group <string>: name of group you need to be near (in quotes)
player_groups <table/Number>: a list in the form {"name1","name2",...}, set to 2 for all blue players or 1 for all red
flag <string>: flag name to increment when conditions met
distance <Number>: distance in meters to operate within
WT.playerNear.setup(target_group,player_groups, flag, distance)Examples
WT.playerNear.setup("target-1",2,"flag1",1000) --this will increment flag1 whenever any players are near the group target-1
WT.playerNear.setup("target-1",{"player"},"flag2",500) --this will increment the flag only when the specific given group is within rangeFor multiplayer missions its nice to have F10 radio options as backups/killswitches so you can salvage the mission if something breaks or say for example SEAD flight all crash, but its not great when those options are exposed to 30 curious pilots fiddling in the radio menu or people that use VAICOM and thus constantly randomly trigger every possible radio option
This function lets you assign radio options based on player name, they will be added/removed to/from groups as needed so that ONLY a group containing a player whose name contains a given string have those options
player <string>: subname of the player (eg maple if the player's name will for sure contain maple)
name <string>: name of the radio option
flag <string>: flag to set when pressed
singleUse <bool>: true makes the option disappear once used
WT.killswitch.setup(player,name,flag,singleUse)renders players invisible when there is an allied AI aircraft within a defined range of the player
group <string>: group that is covered by AI (1 or 2 for all player redfor or player blufor respectively)
coalition <Number>: coalition of AI players you want to be able to provide cover
distance <Number>: distance in meters they must be within to be covered
WT.coverMe.setup(group,coalition,distance)This is a simple script that will give your players a F10 option to fire a signal flare (choosing a colour), init function is
side <Number>: Which side to apply to, use 1 for redfor, 2 for blufor
WT.popFlare.setup(side)run multiple times if you want it to work for both sides
Toggles invisibility when units go below(or above) a given AGL, note that since invis is at a group level this
only works properly when each unit is in a group of 1
alt <Number>: altitude (AGL) below which a group should be invisible
side <Number>: coalition enum (1 for red or 2 for blue) will apply to all players on that side
higher <bool>: if true will make the groups invisible if they are above the alt instead of below it
WT.invisAlt.setup(alt,side,higher)suppresses ground units when they are shot at, not that it has no wway of knowing the current ROEs so if they are already weapons hold they will go weapons free when shot, after suppression ends as a result,is extremely basic, all hits work so yes infantry can suppress a tank, will iterate on later
hit <Number>: suppression time on hit in seconds
kill <Number>: suppression time on kill in seconds
all <boolean>: should we apply to all ground units or only those whose group name starts with SUP_
side <Number>: 1 for red 2 for blue, nil for both
ai <boolean>: if false then suppression only happens when shot by a player unit
WT.suppression.setup(hit,kill,all,side,ai)Examples:
WT.suppression.setup(2,5,true,1,false) --2 seconds suppression on hit, 5 on unit death, apply to all ground units, in red coalition, and only apply it if shot by a player
WT.suppression.setup(2,5,false,1,false) --2 seconds suppression on hit, 5 on unit death, apply to only ground units whose group name starts with SUP_, in red coalition, and only apply it if shot by a playersimple function that makes sure that any unit hit by a missile dies (good for time rtavel missions, warbirds are weirdly resilient to missiles)
WT.missileDeath.setup()Call when you want to drop a new mission into a group, designed to have taskings defined via late activation groups you never activate
group <string>: name of the group you want to task
task <string>: name of the group whose tasking you want to clone (must start with 'TASK_')
relative <boolean>: whether you want the task waypoints to be shifted so the path is the same shape as defined but starting where the group is (true), or keep tasking waypoints in defined locations (false)
WT.tasking.task(group,task,relative)Makes designated AA units shoot in the vicinity of valid targets instead of at them, note that at this time there is a bug where units tasked to fire at point will ignore that order if there is a valid target nearby, meaning to use this properly for now your targets need to be invisible, or you need to use neutral units as your shooters, or finally you can use opposing units if you set them to restrict targets only engage ground
side <Number>: side of the expected targets (yes you can make blue shoot blue)
shooters <Number>: side of the AA you wish to control (all AA must be group name starts with AA_)
advancedLOS <bool>: whether to factor in objects (statics, scenery, and other units) for LOS calculations
WT.stormtrooperAA.setup(side,shooters,advancedLOS)Example
WT.stormtrooperAA.setup(2,1,true) --will give red shooting blue using advanced LOSLike the vanilla shelling zone, but instead generates a sustained barrage within the target zone (only for circular zones)
zone <string>: name of the zone you want to shell
rate <Number>: a Number that when multiplied by a random value between 1 and 10 determines the delay between impacts, smaller Number means faster barrage, try 0.03 to start
safe <Number>: how many safe zones (zones that shouldn't be shelled) overlap your target zone, safe zones need to be named <zone>-safe-<Number> starting at one, so for a target zone of 'target-1' the first safe zone would be 'target-1-safe-1'
flag <string>: a flag to watch for and if set to true to stop the shelling
WT.shelling.setup(zone,rate,safe,flag)Example
WT.shelling.setup("target",0.03,1,"endit") --will shell the zone named target, with a 0.03 rate modifier, there is 1 safe zone and shelling will stop when the flag "endit" is setDeletes rockets/missiles from MLRS units while they are in flight so you can have the effect of them firing without tanking FPS from them impacting
groups <table>: table of the group names you want this to apply to, use nil for all MLRS units
WT.MLRS.setup(groups)Example
WT.MLRS.setup({"SMERCH-1","SMERCH-2","SMERCH-3"}) --will function only when MLRS units in groups names SMERCH-1, SMERCH-2, or SMERCH-3 fire
WT.MLRS.setup(nil) --will function on all MLRS launchesSimple feature that deletes 50% of ejected pilots immediately and the rest after a minute
Example:
WT.eject.init()Creates a blinking IR strobe on units
groups <string> <group>: can be either a reference to a group table, or the name of the group as a string
onoff <boolean>: if true then sets the strobe on, if false sets it off, if nil then toggles it (on if currently off, off if currently on)
interval <Number>: time interval that the ir light is on/off eg a interval of 1 would be 1 second on then 1 second off, personally I find 0.15 or 0.2 works well (note overly long intervals will look strange)
location <Vec3>: the strobe is attached at this Vec3 point in model local coordinates, nil for a default strobe above the unit
Example:
WT.strobe.toggleStrobe("infantry-1",true,0.2,nil) --will turn on a default strobe for a group named 'infantry-1' with a 0.2 second interval
WT.strobe.toggleStrobe("infantry-2",nil,0.2,nil) --will toggle a default strobe on/off for 'infantry-2' if turning on it will use a interval of 0.2 seconds
WT.strobe.toggleStrobe("Blackhawks",true,0.2,{x=-10.3,y=2.15,z=0}) --turn on strobes on top of the tail fins of all UH-60A Blackhawk units of the group
WT.strobe.toggleStrobe("Kiowas",true,0.2,{x=-6.85,y=1.8,z=0.14}) --turn on strobes on top of the tail fins of all OH-58D Kiowa Warrior units of the groupFinal example is meant to be used in a "do script" advanced waypoint action
local grp = ... --this gets the current group
WT.strobe.toggleStrobe(grp,true,0.2,{x=-1,y=1,z=0}) --toggles on a strobe 1 meter above and 1 meter back to the local coordinate origin of each unit of the group in question