-
Posts
1745 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by toutenglisse
-
-
10 hours ago, TommyCocchi said:
How do I turn smoke pods for AI aircraft on with triggers?
Here is an example in this attached mission file in last post (smoke pod on on hit):
-
thx for the info
-
11 hours ago, Costas_Ch said:
Hi,
Please let me know if I got this right:
in case of Vec2, x is East/West, y is North/South.
in case of Vec3, x is East/West, y is altitude (so I guess can take only positive values (??)), z is North/South.
Are Those values distance units? Default as meters? Only meters? Something different? Can those be somehow related to the mission editor's distance tool?
Thanks.
You can use LeftAlt+Y several times in mission editor to switch coordinates to the same format used for Vec2/Vec3.
-
5 hours ago, ShadowFrost said:
I have used this to great success, but is there a way to make it query four aircraft and still work without an error if only 2 or 3 aircraft show up?
Thanks in advance.Yes - you can use this code in a "do script", in a trigger "once", "conditions" Time > 1 : (to declare awacs and targets)
Spoilerawacs = Unit.getByName('your awacs unit name')
target = {}
target[1] = Unit.getByName('your target1 unit name')
target[2] = Unit.getByName('your target2 unit name')
target[3] = Unit.getByName('your target3 unit name')
target[4] = Unit.getByName('your target4 unit name')
trigger.action.setUserFlag( "1", false )
trigger.action.setUserFlag( "2", false )
trigger.action.setUserFlag( "3", false )
trigger.action.setUserFlag( "4", false )and then use this code in a "do script", in a "continuously tested" trigger, "conditions" Time > 2 : (to check radar detection for each target, and stop checking when detected)
Spoilerif awacs and awacs:isExist() == true and awacs:getLife() > 0 then
for j = 1, #target do
if target[j] and target[j]:isExist() == true and target[j]:getLife() > 0
and trigger.misc.getUserFlag( "" .. j ) == 0 then
if Controller.isTargetDetected(awacs, target[j], RADAR) == true then
trigger.action.outText('AWACS has detected ' .. target[j]:getName() .. ' with Radar.', 15)
trigger.action.setUserFlag( "" .. j, true )
end
end
end
end -
yes :
Spoilerlocal awacs = Unit.getByName('your awacs unit name')
local target = Unit.getByName('your target unit name')
if awacs and awacs:isExist() == true and awacs:getLife() > 0
and target and target:isExist() == true and target:getLife() > 0 then
if Controller.isTargetDetected(awacs, target, RADAR) == true then
trigger.action.outText('AWACS has detected ' .. target:getName() .. ' with Radar.', 15)
end
endUse it in a continuously tested trigger. In "conditions" of this trigger, you can set : flag X is true, and in "action", next to this "do script", you can add : flag X set false. This way the checking will stop when target is detected. (prior to this trigger, set another one with : flag X set true in "actions", to start the checking of target detection)
-
Leads to unit to start with 133.3...% of life. I'm not sure if it's a bug or if there is a purpose in this fact, but it differs from description of the function.
EDIT : it is not systematically 75%, for some units (ex : SR P-19 : 50%) it's lower, leading to 200% of life points at spawn. (% of life can't be reliable)
-
3 hours ago, sunski34 said:
No that doesn't work. Setting main task in mission task doesn't change anything. Note that _waypoints are good and the aircraft will follow this route....
You are right. It works with "AWACS" or "Tanker" tasks, but it doesn't work with "CAS" (I tried with CAS because "attackGroup" is not a valid task for "Ground Attack" maintask, but valid for "CAS").
-
1 hour ago, avp216 said:
...
My Issue:...
hi, your code in the trigger "Respawn RG-1 Flag" has 2 flaws : a "local" wrote "locall" and a "gp:getUnits(1)" instead of "gp:getUnit(1)" (getUnits() and getUnit() functions don't do the same thing).
Here is the corrected code that works :Spoilerlocal gp = Group.getByName('Russia Ground 1')
if gp then
local lead = gp:getUnit(1)
if lead then
local leadPoint = lead:getPoint()
local route = mist.getGroupRoute('Russia Ground 1', true)
route[1].x = leadPoint .x
route[1].y = leadPoint .z
mist.goRoute(gp, route)
end
end-
1
-
-
18 hours ago, Gierasimov said:
From the player perspective this is obvious bug.
Yes. I have yet not tried to see what amount of points a GBU24 does remove, just for curiosoty, but not much compared to the 10000 points I fear
EDIT : a GBU24 deals 1173 pts of damage. It requires 8 and a half (9) bombs of this type to destroy the command center. Not as bad as I was thinking. Maybe no bug I don't have references about how resilient is this type of bunker against a 2000 lbs bomb ? But 9 bombs seem a hudge number.. I remember being able to destroy a command center with a 1000 lbs bomb (GBU10) in the past...
-
Hi, here are 2 simple scripts that I want to share : "Vehicles Crews Spawning on BDA Event" and "ARM detection and Alarm State Management for All Air Defenses".
I) "Vehicles Crews Spawning on BDA Event" :
This script rely on "BDA" event (vehicle gets critical damages, is set on fire, but is not totally destroyed yet) recently added with DCS 2.7. When a "BDA" event occures on the battlefield, the remaining crew can extract itself from the burning vehicle. It consists of 1, 2 or 3 soldiers of different types, with 1 chance out of 7 that a soldier is a stinger/igla manpad. The crew spawns after 10 to 15 seconds around the vehicle (if on land), disperses on a short distance and is able to retaliate.
If a vehicle is directly destroyed when hit, "BDA" event won't happen.
Some soldier unit types are considered as vehicles in DCS (example : air defense VEH for manpads) and can trigger "BDA", and are excluded in my script from "BDA" event check.
2 versions attached : a modern one and a WWII one, + a basic working example if you want to see it in action.
To use it in a mission :
1) create a "mission start" trigger, add latest MIST version with "action"/"run script file".
https://github.com/mrSkortch/MissionScriptingTools/tree/development
or
https://github.com/mrSkortch/MissionScriptingTools/tree/master
2) create a "once" trigger, Time > 1 second in "conditions", add "Vehicles Crews BDA" script in "action"/"run script file".Update V3 (09/24/2021) : correction of surface type. Only spawned on Land type, now also on Road or Runway types.
Update V2 : I got rid off coalitions. In V2 crews countries are the same than critical damaged vehicle's ones. Soldier types match the ones available for the country in mission editor (I guesstimated types for countries that don't have infantry in M.E.).
Vehicles-Crews-BDA-modern-v3.lua Vehicles-Crews-BDA-wwii-v3.lua test-Vehicles-Crews-BDA-v2-MIST.miz
II) "ARM detection and Alarm State Management for All Air Defenses" :
I know several others made similar scripts, and MUCH MORE complex ones ! (Grimes' IADS, tigair's Skynet, ...), but I wanted to make this one, with a functionality of its own, very simple but working as I wanted.
Logic : when loaded, this script checks all the valid SAM units present in battlefield (SAM units that can detec AntiRadarMissiles with "RADAR_BAND1_FOR_ARM" ability) - with exclusion of few SAM types (SA15 Tor, S300/SA10, and Patriot) for keeping their ability to engage incoming weapon at any time. For exclusion to work, you need to put these SAM types in their own group (because when a unit turns off radar, all units of group also turns off radar if they have one).
1) When a valid SAMunit detects with radar an enemy ARM (of any type - rely on passive radar guidance type), it checks if it's incoming and threatening (heading on it, within margin), and if the valid SAMunit is not already guiding a SAM missile it will engage AlarmState procedure (will turn off radars of its group within 12 to 20 seconds, for a period of 45 to 55 seconds, will then turn on radars and will resume ARM detection within 12 to 20 seconds). The ARM Detection event will stop Detection check for all valid SAMunits of same SAM Site/Group.
An ARM that already overshot the SAM site won't trigger reaction, same if it flies toward an other SAM site.
2) When a valid SAMunit launches and is guiding a SAM missile, any incoming ARM detected after the SAM launch won't trigger AlarmState reaction, to prioritize the guidance of SAM, as long as this SAM is guided. When this SAM explodes, ARM Detection is resumed and the incoming ARM will trigger reaction (unless a new SAM is launched before Detection occures).
Any other guided SAM, following the prioritized one, are considered expandable, and will stop being guided if an AlarmState reaction occures and SAM Site turns off radars.
2 versions attached : a standard one and a "test" one (messages are triggered each time something happens to describe it, for checking purposes) + a basic working example if you want to see it in action.
To use it in a mission :
1) create a "mission start" trigger, add latest MIST version with "action"/"run script file".
https://github.com/mrSkortch/MissionScriptingTools/tree/development
or
https://github.com/mrSkortch/MissionScriptingTools/tree/master
2) create a "once" trigger, Time > 1 second in "conditions", add "ARM detection Alarm State" script in "action"/"run script file".
Optional : 3) if in your mission you dynamically spawn new SAM sites, use the command ValidSAMunits() to rebuild the table of all valid SAMunits.Note : this script uses flags from number 400 up to # of Blue + Red Valid SAM units (as described above).
ARM-detection-Alarm-state.lua ARM-detection-Alarm-state-test.lua test-ARM-detection-Alarm-state-Mist.miz
-
6
-
3
-
-
On 5/14/2021 at 5:51 AM, sunski34 said:
...
So, when main task "Nothing" is set, is there something to do to force aircraft group to engage ?....
Yes, you can assign a main-task via route/waypoint addition (with a main task described in wpt), like in my previous post code.
For me it works for units with no main task, to have AWACS or Tanker main task when reaching the dynamically added waypoint. It should work the same for any main task, like ground attack.
-
16 hours ago, Gierasimov said:
...Command Center static object in fact cannot be killed now....
It has 10000 life pts. After the biggest explosion possible with editor (power set to 10000"units") it still has 3841 pts, and an other 6500 "units" explosion finally kills it (0 pts, destroyed model).
Several statics have big amount of life pts, but I think this one is the toughest.
Statics attributes here : DCS-miscScripts/ObjectDB/Statics at master · mrSkortch/DCS-miscScripts · GitHub
-
1
-
-
21 hours ago, uri_ba said:
In the Unit object there is no Payload or pylons. none that I could find.
It can work with the function "DCS event weapon add".
The thing with this event is that it works only when a unit appears, so to use it in a mission you need to first load the script, and 1 second later activate all the groups/units/player-slots that you want to be able to reach by script later to see their pods/loadouts.
Won't update if rearm, or jettison, and a table must be created to be populated with loadouts for each unit you want to be checked.Here an example. Player F18 (parking hot) and AI F16 (runway) appears at time=2seconds. When you spawn in your F18 you see messages that show the 2 tables getting populated with pylon stuff (I created 1 table per aircraft).
Then with F10 radio menu you can (for testing) :
1) spawn a 3rd scripted AC airborne and see his loadout (incl. pod)
2) display your loadout (incl. pod)
3) display if you have a TGP and what type (same than previous but each pylon is compared to valid pod names and displayed if valid)
4) display the F16 loadout (incl. pod)
5) display if F16 has a TGP and what type -
1 hour ago, sunski34 said:
so you said in a mission task?
A main task, like ground attack or sead or tanker. Example : (unit gets AWACS maintask when reaching the Wpt)
Spoilerlocal routeA = {
[1] = {
["alt"] = 3500,
["type"] = "Turning Point",
["action"] = "Turning Point",
["alt_type"] = "BARO",
["formation_template"] = "",
["properties"] =
{
["vnav"] = 1,
["scale"] = 0,
["angle"] = 0,
["vangle"] = 0,
["steer"] = 2,
},
["ETA"] = currentTime,
["y"] = -00130000,
["x"] = -00140000,
["speed"] = 150,
["ETA_locked"] = false,
["task"] =
{
["id"] = "ComboTask",
["params"] =
{
["tasks"] =
{
[1] =
{
["number"] = 1,
["auto"] = true,
["id"] = "AWACS",
["enabled"] = true,
["params"] =
{
},
},
[2] =
{
["number"] = 2,
["auto"] = true,
["id"] = "Orbit",
["enabled"] = true,
["params"] =
{
["pattern"] = "Circle",
["speed"] = 130,
["altitude"] = 3500,
},
},
},
},
},
["speed_locked"] = true,
}
}
mist.goRoute('Wizard-1', routeA) -
27 minutes ago, uri_ba said:
Thanks! I'll Dig into it.
just to make sure, env.mission method is only relevant for aircraft saved in the mission.
and the event handler is only relevant for player/clients spawning Airborn.
can I read what the player is loading up? or what his loadout on takeoff?I've not tried so I can't tell much but any of scripting method allows to reach any unit, created by mission editor or script, controlled by AI or player/client. It returns what actually is attached to pylons.
-
3 hours ago, uri_ba said:
Hi all,
I want to see if a specific aircraft is carrying a TGP or an ECM pod.Unit.getAmmo() only returns shooty stuff
Unit.getSensors() only returns on-board stuff.
Unit.getDesc() has nothing interesting.
does such a function even exists? (even in a long convoluted way?)You have an answer here : Detect Targetting / ECM pods on aircraft? - Mission Editor Discussion and Questions - ED Forums (eagle.ru)
And there is an "event" in relation - I've not tried to see how/when it works : DCS event weapon add - DCS World Wiki - Hoggitworld.com
(says : "Currently occurs when an aircraft is spawned in air with weapons. Will occur for each pylon and can return targeting pods.")
-
1
-
-
21 minutes ago, sunski34 said:
...But, when the group has been spawned, is it possible to change it during the mission, of course with a lua function ?...
It has to be tested. I know I've added a maintask through addition of a dynamic waypoint to a unit that already had one, and it wrote in the log "unit already had a task" or something like that. But as it was the same task I don't know if it replaced or not. (using mist.goroute, with a maintask described in 1 waypoint of assigned route)
I'd say yes, there is almost always a way. If adding a maintask through lua doesn't replace the one that unit already has, then it's always possible to replace the whole unit where it stands in the 3d world. (...ultimately...) -
On 5/9/2021 at 4:49 PM, Frag said:
...How do I change the ROE of a group with moose so it will start attacking the enemy?...
You can try with the original DCS script functions :
Group.getByName('bradley'):getController():setOption( 0, 0 ) --ROE weapon free
Group.getByName('bradley'):getController():setOption( 9, 2 ) --Alarm State red -
3 hours ago, TheTrooper said:
Hi, is there a way to script a unit to have 100% guns? It'm starting it at 0% but if it fires a missile to give it 100% guns.
or even better actually a script to tell if a unit has fired? I would probably need something else though to give them their chaff and flares back later when required as I guess chaff or flares would also trigger it.Yes, but only using workaround that is not optimal.
The only way to turn an active unit with 0%gun to 100%gun, except rearm at base of course, is to replace it by same unit with same parameters (at the time you replace it) + 100%gun.
It will be a dynamically created unit (you'll only be able to "work" on it by script, not with mission editor).
You can make this happen when this unit shoots a missile, but the missile has to be "fire and forget" as the shooting unit will instantly disappear.
Here an example : Mig29s invincible with 1 R77 and 0%gun VS F/A-18c invincible with 100%gun. When the Mig29s shoots with R77 it is replaced by another one with no missile and 100%gun.
(replacement is not perfect as shared parameters are : point in space, heading and speed, but not same attitude/banking)
-
2 hours ago, Lace said:
Is it possible to force the AI enemy to ignore a friendly unit without making it invisible? For example, in an NTTR training scenario I want the REDFOR to engage the BLUEFOR fighters but not engage the BLUEFOR AWACS or tankers. Is this possible? I'm aware of the 'ONLY DESIGNATED' parameter but would like something more bulletproof ideally.
Yes. Be sure REDFOR has CAP as main task, but delete "CAP -a" on the first Wpt (SP) and replace by "enroute tasks" to attack all aircraft groups you want them to attack. They will ignore others. (example attached : 4 mig29s engage 2 hornets and ignore the tanker between them)
the 'ONLY DESIGNATED' parameter in fact means "only targets defined in main task" (no longer visible as a list of targets like before). For "SEAD" main task it means only air defenses, for "CAP" only aircraft. It's not related to target your are designating yourself.
-
1
-
-
4 hours ago, Avalanche110 said:
...For the longest time I have noticed that when AI Use LGB's the weapons do not track the target and miss by a significant margin.
I Assume that its because the AI aircraft are not using their laser designator....
I don't see that. A LGB dropped by AI Hornet on a moving vehicle is tracking and hitting with no issue.
Buddy lasing doesn't work for AI aircraft - and more, the AI aircraft doesn't need to have a targeting pod or any laser source to successfully guide a LGB on a moving target. (example attached)
-
On 5/7/2021 at 11:07 AM, Winfield_Gold said:
...Is their an 'end follow task' script of some description that I can use or a lua script I can 'borrow' in order to end the follow task?...
I was thinking for a scripted way to do that, but in your example the simple solution is the "execute AI task" action when the unit reach the zone (create the task to execute in "follower" AI's triggered actions : switch to landing waypoint).
-
1
-
-
8 hours ago, Northstar98 said:
+99999999999999999999
This would also be very useful for SAM sites - whether or not they are able to detect an incoming missile (likely to be an ARM) and shut down. At the moment I have to take a guess at what range a particular RADAR would be able to detect one and shut down.
Hi, the "Controller.isTargetDetected" function also work with weapon detection.
Here is a mission example (using Mist because of event handler that I'm only able to make work with Mist...) with 1) a event handler that detects HARM shot and track it for the SAM SR unit's radar detection, 2) a detection function that makes SAM SR unit to go GREEN state (radar off) for 45 seconds (can be changed) when a HARM is detected (with a defined delay to turn GREEN), then go back to RED state and start again detection (with a defined delay to restart detection).
It works very well, but you need to tweak the different "defined delays" to makes SAM SR unit's survivability to varie from "untouchable" to "easy to kill with HARM". (if delays are 1 seconds for : HARM detection / GREEN STATE, and RED STATE / start again to detect, or if delay between GREEN and back to RED state is long enough, then the unit will be untouchable by HARM ! Can only be disabled by GPS glide bomb launched during GREEN state for example)
In my example I've put a short 45 seconds delay between GREEN and back to RED states, and a 30 seconds delay between RED STATE / start again to detect, so if HARM is still in position to track again when SAM SR goes RED and close enough to reach it within 30 seconds, it will hit it. The SAM SR unit gets disabled almost every times with these settings.
Tunable triggers/delays are :
1) alarm state GREEN - Time since flag 2 - X seconds (time between detection and GREEN state command)
2) alarm state RED - Time since flag 3 - X seconds (time between GREEN state command and RED state command)
3) restart HARM detection - Time since flag 4 - X seconds (time between RED state command and restart of HARM detection)
Works for 1 HARM tracked at a time (in my example the 2 hornets only shoot 1 HARM at a time), it would probably needs a table of existing HARMs and detection of all HARMs through table to be really efficient in all cases. (and tracking/detecting all kinds of ARM also)
Play mission in F10 map view and use time acceleration to see things happening (with displayed messages each time something happens), play with the delays settings in triggers, if you want.-
2
-
-
9 minutes ago, Winfield_Gold said:
Thank you @toutenglisse, will using M.I.S.T engine conflict with ED if I released a 'free' campaign using the M.I.S.T scripts in my missions? my query is, with ED's updates and using MIST....I am worried that the mist engine will not be compatible until the publisher of mist updates their lua engine to coincide with ED future releases.
in short....the VEAO Hawk saga where the developer were waiting on ED's updates to make their product function. I was hoping for a fix that only relied on ED's mission editor, not a 3rd party work around.
I would say no, no particular issues or conflicts to be expected. What can be an "issue" and that I've experienced in the past, is that sometimes some functions can evolve and need correction in a script to keep being functional, but in the exact same way a function or option in mission editor does evolve and also need correction.
All things done in mission editor are in fact scripts and can be displayed as scripts, and Mist uses DCS script functions to make other, more complex or extended functions from it and from lua functions.
Also Mist creators allow to use Mist with a campaign that you want to offer for money.
SSE Documentation
in Mission Editor
Posted · Edited by toutenglisse
For the payload format, you can create and save a mission with just 1 aircraft and its payload, then extract the file "mission" from the .Miz file with 7zip, open it with notepad++ and you'll find the payload format for the created unit.
Here is a very usefull database with all weapon codes per pylons for all aircraft :
And here is another very usefull one for all objects descriptions (incl. type names) : https://github.com/mrSkortch/DCS-miscScripts/tree/master/ObjectDB