Jump to content

BenC

Members
  • Posts

    5
  • Joined

  • Last visited

  1. Thankyou all for your help, its been tremendous. To expand on what im doing. I am recreating the Arma style 'invade and annex' MP mission. I have 5 primary objectives, which is to clear airbases in a 'push/pull' style battle with the AI, and I have around 15 side missions, which are smaller targets for variety. Only 1 of each mission is current at any one time. As you clear an objective, the next one spawns in. Sequentially for the primary objectives, random for the secondary. I wish to have an F10 request system to allow players when only a few people are on to request support aircraft. CAP, CAS, SEAD. I want the support aircraft to proceed directly from their spawn point, to either the primary or secondary objective, as requested by the player. So far, i'm 90% of the way there with the help I have received here. This is my current code. local function AICASSecondary() if (trigger.misc.getUserFlag(10) == 1) then BanditWP = ZONE:FindByName( "Side1" ) elseif (trigger.misc.getUserFlag(10) == 2) then BanditWP = ZONE:FindByName( "Side2" ) elseif (trigger.misc.getUserFlag(10) == 3) then BanditWP = ZONE:FindByName( "Side3" ) elseif (trigger.misc.getUserFlag(10) == 4) then BanditWP = ZONE:FindByName( "Side4" ) elseif (trigger.misc.getUserFlag(10) == 5) then BanditWP = ZONE:FindByName( "Side5" ) elseif (trigger.misc.getUserFlag(10) == 6) then BanditWP = ZONE:FindByName( "Side6" ) elseif (trigger.misc.getUserFlag(10) == 7) then BanditWP = ZONE:FindByName( "Side7" ) elseif (trigger.misc.getUserFlag(10) == 8) then BanditWP = ZONE:FindByName( "Side8" ) elseif (trigger.misc.getUserFlag(10) == 9) then BanditWP = ZONE:FindByName( "Side9" ) elseif (trigger.misc.getUserFlag(10) == 10) then BanditWP = ZONE:FindByName( "Side10" ) elseif (trigger.misc.getUserFlag(10) == 11) then BanditWP = ZONE:FindByName( "Side11" ) end BanditWPVec2 = BanditWP:GetVec2() -- Map position for bandit WP local SpawnObject = SPAWN :New( "aiCAS" ) :OnSpawnGroup(function( SpawnGroup ) SpawnGroup:TaskRouteToVec2( BanditWPVec2, 600 ) end ) local SAMSpawnCommand = SpawnObject:Spawn() end Thus far, it works perfectly in the sense that, the A10 spawns, and when I click on it, it routes perfectly to my chosen objective. The only thing left is to somehow tell it its task. As of now, it simply flies over the target with nav lights on without engaging. I tried to replace the onspawn function with this (after changing BanditWP to a specific unit, not a zone) :OnSpawnGroup(function( SpawnGroup ) SpawnGroup:TaskAttackUnit(BanditWP) GrpTask = SpawnGroup:TaskAttackUnit(BanditWP) SpawnGroup:PushTask(GrpTask) SpawnGroup:TaskRouteToVec2( BanditWPVec2, 600 ) end However that deletes their route so they get lost before the get to the target. Thats it! Thanks again for your help, making an old dude much less stressed.
  2. Thanks. I got the routing sorted out! Last challenge for me is trying to figure out how to get a simple string return of the group name of the dynamically spawned group. Right now the first spawned group is aiCAS#001. From there it goes to 002 etc. For the life of me I cannot get anything to work. Been fiddling with onSpawnGroup but no joy. Without the group name I can't do a few other tasks I have lined up. I miss Qbasic.
  3. Thankyou so much. edit : This doesn't actually seem to work. Investigation says maybe its bugged? https://forums.eagle.ru/showthread.php?p=3473679
  4. Sorry Ive been banging my head against the wall for an entire day with this. I think the diagnosis is that I"m just stupid. I have spawned 2 A10s from a template. They spawn, they take off, they have 15 stored waypoints (of all my possible objectives). I would like to (based on variables within my lua script) to reprogram their route, either through switching waypoint, or frankly any other means reroute these guys to 1 specific way point. Ive read about switchway point, but with the object orientated nature of LUA, its doing my head in. This is the code I use to spawn my aircraft. local SpawnPlane = SPAWN:New( "aiCAS" ) local GroupPlane = SpawnPlane:Spawn() I tried this, but no worky --- This test demonstrates the use(s) of the SwitchWayPoint method of the GROUP class. HeliGroup = GROUP:FindByName( "aiCAS" ) --- Route the helicopter back to the FARP after 60 seconds. -- We use the SCHEDULER class to do this. SCHEDULER:New( nil, function( HeliGroup ) local CommandRTB = HeliGroup:CommandSwitchWayPoint( 0, 8 ) HeliGroup:SetCommand( CommandRTB ) end, { HeliGroup }, 9 ) Any help much appreciated thanks..
  5. This looks great. As a dedicated server operator in Australia, is there an opportunity to host this for our large Australian/New Zealand player contingent?
×
×
  • Create New...