Jump to content

toutenglisse

Members
  • Posts

    1745
  • Joined

  • Last visited

Everything posted by toutenglisse

  1. Use flags - activate a flag n°1 when pilot at A, activate a flag n°2 when pilot at B. if at A with B flag false then load to 750kg, if at A with B flag true then load to 0kg, if at B with A flag false then load to 250kg and if at B with A flag true then load to 0kg.
  2. if you use == then the value defined must be exact at the momment the function is tested. With Fuel test I use <= to a value and I test the fuel value every 30 seconds and it works. Here a copy past of one of the functions I use : function SuppFuel2() local unitObject = Unit.getByName('Wingman') local flightFuel = Unit.getFuel(unitObject)*100 if flightFuel <= 20 then MA_out('Support wingman is Bingo Fuel (' .. mist.utils.round(flightFuel, 0) .. ' % of fuel left).', 15) trigger.action.setUserFlag("228", true) endheliSupport() else SuppFuel2ID = mist.scheduleFunction(SuppFuel2,{},timer.getTime()+30) end end
  3. To define a value you should use == (or <= or >= or ~= which means different from)
  4. https://forums.eagle.ru/forum/english/dcs-world-topics/mission-editor-discussion-and-questions/7114116-fire-at-point?p=7115700#post7115700
  5. @Midnight : I didn't use this specific mist.flag function but others, and I see things strange in your code line (it looks like exemples given in mist pdf but different from explainations that are before exemples) : I would try : mist.flagFunc.group_alive_more_than ({ groupName = 'Timer', flag = "100", percent = 60, interval = 600, toggle = true, }) (added "(" around the Vars and groupName instead of units, as units is used for unit flag functions and not group ones) Edit : in fact I used the same function but "less_than" instead of "more_than" and my script looks like this : mist.flagFunc.group_alive_less_than ({ groupName = 'Red Target Group', flag = "2", percent = 99, }) if trigger.misc.getUserFlag("2") > 0 then (whatever the actions wanted) end
  6. :thumbup:
  7. You can try the script from post #3 : https://forums.eagle.ru/forum/english/dcs-world-topics/mission-editor-discussion-and-questions/287358-capture-airbase-make-new-coalition-aircraft-client-spawns
  8. Thanks Varry, but I've been useless to make the scripted function to work. But it works flawlessly the way ChillNG described in his post - and it is simpler. Here an exemple (trigger is activating flag 1 at 8 seconds in mission - AI has advanced waypoint action to switchWpt when Flag 1 is true) Thanks to him! test-switchWpt-MEfunction.miz
  9. I tried quickly - if I don't mistake waypoint number starts from "0" in M.E. but from point "1" in script, so it's switch Wpt from 2 to 3 (instead 1 to 2), and it "works" ... I mean something happens, but it looks bugged effectively. Here a .miz exemple, the script is triggered at 8 seconds in mission. (AI doesn't change heading from 1 to 2, but instead does a large turning route to 1 and then goes to 2) test-switchWpt.miz
  10. There is something that I noticed and is maybe related to your issue, but big chance that it's bs sorry... When I was trying to make dogfight script (with enemy aggressor spawning in front of player 5km away, same alt, with opposite heading) I noticed that point[1] coord ["x"] and ["y"] relative to aggressor's spawnpoint are ok when fed with spawnpoint.x and spawnpoint.y, but point[2] relative to player's position need to be fed with position.x for [x] and position.z for [y] (and not position.y). (in my code for point[2] it is : ["y"] = mist.getLeadPos('Blue F18c 1').z, ["x"] = mist.getLeadPos('Blue F18c 1').x, ) if using .y for ["y"], the point was not good and aggressor's direction was false (note : player is invisible to aggressor as a threat until merge), while when using .z aggressor's direction was good toward player. If you are having a similar issue, with your "wpt2Point" not being where expected because same shift between .y and .z, maybe it can be a cause to awacs/tanker being inside engagement zone ? If so try with : ["y"] = wpt2Point.z,
  11. You can use "do script" with these 2 functions : https://wiki.hoggitworld.com/view/DCS_command_switchWaypoint and https://wiki.hoggitworld.com/view/DCS_func_setCommand In the "do script" box copy/paste these lines (with your Wpt numbers and unit name) : SwitchWaypoint = { id = 'SwitchWaypoint', params = { fromWaypointIndex = number, goToWaypointIndex = number, } } Group.getByName('your unit name'):getController():setCommand(SwitchWaypoint)
  12. Hi! sorry I can't help but interested in topic. I can only think about workarounds... (with flaws, using ROE and mist.flagFunc.units_in_moving_zones - so Migs will only engage when blue group is inside moving zone, but won't prevent Mig group to eventually split and engage both player and long range detected awacs - here setting blue awacs/tanker invisible between ROE change and Mig group destroyed can be a workaround) Is CAP selected as role for Migs ? (do removing CAP help task with 'MaxDist' or 'zoneRadius' to work? - if you use 'EngageTargets' or 'EngageTargetsInZone' task - I also suspect that attributes don't always have same meaning between a task in M.E. and in external script). EDIT : removed wrong comment about "Orbit" task.
  13. I don't have the map yet. But if you use "radio transmission" instead of "run script" you'll find what you need (ogg file selection, frequency, source that is a zone, etc...). It's in the "triggers" menu/button.
  14. Thanks Grimes I gave a second look and on my side it was due to minimal range of some MLRS that are much higher than others, causing no reaction (and no visible mark/clue as it was external scripting and not in M.E.).
  15. I've noticed some artillery units accept "fire at point" and some don't. They just don't react at all to the task.
  16. It's looking very good ! :thumbup:
  17. Yes I use your mod for A8 and Spitfire since you posted them - big thanks Mnemonic it's perfect for Vr.
  18. Since last OB update soldiers are damaging modules when colliding. On my side I'll try to avoid collision possibility in script.
  19. Still, may not be what you are searching for, but here a working exemple with value/name/flag ? returned on message by a gbu12. (Edit : previous number I gave was not gbu12) testWeap-F16-cauc-gbu12.miz
  20. Now soldiers have collision with modules, and they are strong ... 2 soldiers went "through" my Ka50 on ground and moved it hard/damaged it ! I need to avoid this to happen in script...
  21. For exemple : if event.id == world.event.S_EVENT_HIT then MA_out(' ' .. event.target:getName() .. ' Got Shot by ' .. event.initiator:getName() .. ' with ' .. event.weapon:getName() .. '!', 10) if event.target:getName() == CoCenter and event.weapon:getName() == 16793344 then local Target = mist.utils.makeVec3(unitPosition, land.getHeight(unitPosition)) trigger.action.explosion(Target, 10000 ) end mist.removeEventHandler(BombStaticID) end It's just something I used for testing and kept noted somewhere - although I'm not 100% sure it was gbu12 that I used. Maybe another one but principle is the same. But is the value valid as weapon flag ?
  22. Big thank you for the A10cII !
  23. sirrah as an option you can use "execute script" (when your flag or zone condition met): Group.getByName('name of escort group'):getController():resetTask() the group will stop following and RTB. (Edit : if you don't give them other task)
  24. Just in case you missed from A10c section : https://forums.eagle.ru/showpost.php?p=4149247&postcount=14
×
×
  • Create New...