Jump to content

Clayt

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by Clayt

  1. I would try this bit of code from this thread (http://forums.eagle.ru/showthread.php?t=124836) let me know if this works. Mission setup: AI Flight Groups - (Set Options - RTB on out of Ammo, RTB on Low Fuel) AI Flight Groups - Advanced waypoint commands (flag 999 to true) as a STOP condition on all CAP, CAS, Orbit commands and return to base. Mission Complete Trigger - (Flag 999 set true) Script: SCRIPT - Respawns AI Flight Group when they are all dead SCRIPT - Respawns AI Flight if Leader is NOT IN THE AIR - CRASHED, KILLED or has LANDED. (To be Disabled when I figure out how to check all flight members have landed) SCRIPT - Respawns AI Flight only when All of group have landed and powered down. (WIP) Disabled - RESPAWN on LOW FUEL SCRIPT - Will not RESPAWN any GROUPS once Flag 999 = 1 New LUA Predicate code for DRAGONS the DAM ---------------------------------------------------------------- -- Condition --> LUA PREDICATE: local groupName = 'A-10C #1.1 AI' -- MISSON EDITOR: FLIGHT GROUP NAME local lowFuelThreshold = 0.08 -- RTB when less then this amount of fuel (10%) env.setErrorMessageBoxEnabled(false) -- Message Box on error: FALSE=No Box, TRUE=Show Box -- *********** -- Add 1 to Group Name for new Flight Group when it respawns if barons_respawn_script and barons_respawn_script[groupName] then groupName = groupName .. barons_respawn_script[groupName] end -- Set Flag 999 to true in Mission when Mission is Completed and No more waves of AI Aircraft are needed flag_999 = trigger.misc.getUserFlag('999') -- If the Whole Flight Group is DEAD respawn replacements until Flag 999=1 local group = Group.getByName(groupName) if (not group and flag_999 == 0) then return true end -- If Flight Groups LEADER is DEAD or LANDED respawn replacements until Flag 999=1 group = group:getUnits()[1] if (not group and flag_999 == 0) or (Unit.inAir(group) == false and flag_999 == 0) then return true end --[[ -- If Groups Fuel is below Threshold send out a replacement Flight Group until Flag 999=1 if (group:getFuel() < lowFuelThreshold and flag_999 == 0) then return true end ]]
  2. OK it seems like I've got it working, for the lua predicate I'm using :getSize. CONDITIONS - lua predicate: if Group.getByName('ENEMY TANK'):getSize() < 1 then return true end I reckon that's as efficient as possible but my lua knowledge is lacking :surrender:
  3. Thanks for the reply Grimes, I have just tested that lua predicate condition you posted and I'm still having no luck getting it to work for the destroyed ground units. Here is how I tried it for some tanks: TYPE - switched condition CONDITIONS - lua predicate: if Group.getByName('ENEMY') and Group.getByName('ENEMY'):isExist() == false or not Group.getByName('ENEMY') then return true end ACTIONS - mist.respawnGroup('ENEMY') end
  4. After testing this and looking at a few other threads I have found that although the ground units were destroyed they had to be deactivated before they would respawn properly. The problem is that I want to keep ground units respawning and the mission editor functions don't recognize them once they have respawned, from what I have read that means I will have to use mist to deactivate the new groups. I'll definitely have to study lua coding in depth, sadly I feel I've got a long way to go yet but perhaps it's not as complex as I'm making it out to be?
  5. So I have been getting to grips with the mission editor and have encountered a problem. The issue is that I can't seem to get ground unit groups to respawn once destroyed, aircraft on the other hand respawn just fine. For the aircraft I use this: TYPE- Switched Condition CONDITIONS- lua predicate if not Group.getByName('ENEMY CAP') then return true end ACTIONS- if not Group.getByName('ENEMY CAP') then mist.respawnGroup('ENEMY CAP') end However, when I try exactly the same for ground units they never respawn. Does anybody have any ideas? Help is greatly appreciated.
×
×
  • Create New...