Jump to content

ChuckIV

Members
  • Posts

    214
  • Joined

  • Last visited

Everything posted by ChuckIV

  1. OK, with your help Everyone, I'm learning a ton about MOOSE but still have a long ways to go! With all your help, I was able to make this script work for uncontrolled, late SPAWNED groups you see below in the code. This script allows 3 uncontrolled, late-SPAWNED groups to follow the same SPAWNED leading group and is working perfectly. See below... local LARGCL = POINT_VEC3:New( 0, 0, 914.4 ) local LARCL = POINT_VEC3:New( 0, 0, 1828.8 ) local LAROL = POINT_VEC3:New( 0, 0, 2743.2 ) function GP_FOLLOW( Followed_GP, Following_GP, Vec3 ) local FollowedGP = Followed_GP local FollowingGP = Following_GP local GP_Offset = Vec3 local GP_Task = FollowingGP:TaskFollow( FollowedGP, GP_Offset:GetVec3() ) FollowingGP:SetTask( GP_Task, 1 ) end GP_FOLLOW( Fw190D9GP4JG301, Fw190D9GP5JG301, LARGCL ) GP_FOLLOW( Fw190D9GP4JG301, Fw190D9GP6JG301, LARCL ) GP_FOLLOW( Fw190D9GP4JG301, Fw190D9GP7JG301, LAROL ) NOW, I want to do the same thing with groups that ALREADY EXIST in mission (not spawned).... I want to use the same 4 groups that are NOT late activated, but already exist at mission start. Any ideas anyone to make simple changes to this code???? I await your enlightenment... ChuckIV On a side note... I saw this coding online and tried this as well, but no luck... function CONTROLLABLE:TaskFollow( FollowControllable, Vec3 ) self:F2( { self.ControllableName, FollowControllable, Vec3 } ) local DCSTask DCSTask = { id = 'Follow', params = { groupId = FollowControllable:GetID(), pos = Vec3 } } self:T3( { DCSTask } ) return DCSTask end Fw190D9GP5JG301:TaskFollow( Fw190D9GP4JG301, LARGCL ) Fw190D9GP6JG301:TaskFollow( Fw190D9GP4JG301, LARCL ) Fw190D9GP7JG301:TaskFollow( Fw190D9GP4JG301, LAROL )
  2. I'll take a closer look Thanks Blech, I'll take a close look at your .miz file. ChuckIV
  3. I'm don't understand why these planes won't RTB. Please see attached mission, and see if youcan figure out why this group of planes is NOT returning to base. The mission begins, and the group only has one waypoint - LAND! They just fly around with gear down until they run out of fuel and crash. I want them to land regardless of how much fuel is still on-board or if they have fuel left in their drop tanks. Please attach the .miz file you come up with that makes them land. I'd really, REALLY appreciate it! ChuckIV TEST - SIMPLY LAND PLEASE.miz
  4. Last Waypoint The Last Waypoint is the last point that the following group will continue to follow their leader. After that they will need a new task or they will RTB. I don't use ESCORT; I just use follow and CAP I believe. Maybe ESCORT is working better than it has in the past. I think if you leave the LAST WAYPOINT box unchecked, it will default to that anyway. It's there so you can break off the escort sooner. Let us know anyone if I'm wrong on this. ChuckIV
  5. It seems that SPAWNED groups don't RTB very well so I thought I'd just have them DEACTIVATE as they enter the RTB Zone. I've attached the simple .miz and .lua files... Can someone tell me what I'm doing wrong here?? -- Define the Group/Template local Spitfire_GP1_P9374 = SPAWN:New( "Spitfire GP1 P9374" ):InitRandomizePosition(false):InitLimit( 4, 1 ) -- Spawn Late Activated Group/Template local SpitfireGP1P9374 = Spitfire_GP1_P9374:Spawn() -- Find/Name the Spawned Group/Template RTB_1 = GROUP.FindByName( SpitfireGP1P9374 ) -- Name the RTB Zone RTB_Funtington = ZONE:New("Funtington Zone") -- RTB FUNCTION to REMOVE SPAWNED GROUPS when IN an RTB zone, BELOW an altitude (in meters?) and BELOW a speed (in kph?) function GROUP_RTB( RTB_GP, RTB_ZONE, RTB_SPEED, RTB_ALTITUDE ) -- if RTB_GP:IsAlive() then local RTB_GP_Position = RTB_GP:GetPositionVec3() if (RTB_GP:IsPartlyInZone(RTB_ZONE) and (RTB_GP:GetSpeedMax() <= RTB_SPEED) and ( RTB_GP_Position.z <= RTB_ALTITUDE )) then RTB_GP:Destroy(false) -- I think the 'false' will still allow the removal of the group; it just won't report it as a CRASH correct? end -- end end -- Scheduler to check every 10 seconds to see if there's a group in the RTB Zone?? SCHEDULER:New( nil, function() GROUP_RTB(RTB_1, RTB_Funtington, 281.6, 609.6) -- 175mph, 2000ft end, {}, 10, 10 ) SPAWNED GP RTB TEST.miz TEST.lua
  6. SOLUTION (old solution actually) FOUND a SOLUTION!!! I went WAY back to a post that had the exact same question/problem. Here is the code that allows a SPAWNED AI GROUP to follow another SPAWNED AI GROUP... do local Spitfire_GP3_P9374 = SPAWN:New( 'Spitfire GP3 P9374' ) local Spitfire_GP10_P9374 = SPAWN:New( 'Spitfire GP10 P9374' ) -- ***************************** DEFINE VEC3 POINT FOR FOLLOWING GROUPS *************************************************************** local LARCL = POINT_VEC3:New( 0, 0, 914.4 ) -- LINE ABREAST RIGHT CLOSE LEVEL -- ******************************** FUNCTION FOR GROUP TO FOLLOW ANOTHER GROUP ********************************************************** function GP_FOLLOW( Followed_GP, Following_GP, Vec3 ) local FollowedGP = Followed_GP local FollowingGP = Following_GP local GP_Offset = Vec3 local GP_Task = FollowingGP:TaskFollow( FollowedGP, GP_Offset:GetVec3() ) FollowingGP:SetTask( GP_Task, 1 ) end -- ******************************************** SPAWN GROUPS **************************************************************************** local SpitfireGP3P9374 = Spitfire_GP3_P9374:Spawn() local SpitfireGP10P9374 = Spitfire_GP10_P9374:Spawn() -- **************************************** SET GROUPS TO FOLLOW ************************************************************************ GP_FOLLOW( SpitfireGP3P9374 , SpitfireGP10P9374 , LARCL ) end **** Now, it's onto figuring out how to make these groups respawn and continue to follow ****
  7. TAKE A LOOK OK, here's what I've got so far... This is my .lua file that gets loaded 5 seconds into the mission after loading moose.lua.... do local Spitfire_GP3_P9374 = SPAWN:New( "Spitfire GP3 P9374" ):InitRandomizePosition(false):InitLimit( 500, 1 ):InitRepeatOnEngineShutDown():SpawnScheduled( 1, 0 ) local Spitfire_GP10_P9374 = SPAWN:New( "Spitfire GP10 P9374" ):InitRandomizePosition(false):InitLimit( 500, 1 ):InitRepeatOnEngineShutDown():SpawnScheduled( 1, 0 ) -- ***************************** DEFINE VEC3 POINT FOR FOLLOWING GROUPS *************************************************************** local LARCL = POINT_VEC3:New( 0, 0, 914.4 ) -- LINE ABREAST RIGHT CLOSE LEVEL -- ******************************** FUNCTION FOR GROUP TO FOLLOW ANOTHER GROUP ********************************************************** function GP_FOLLOW( Followed_GP, Following_GP, Vec3 ) local FollowedGP = group.getByName( Followed_GP ) local FollowingGP = group.getByName( Following_GP ) local GP_Offset = Vec3 local GP_Task = FollowingGP:TaskFollow( FollowedGP, GP_Offset:GetVec3() ) FollowingGP:SetTask( GP_Task, 1 ) end -- ******************************************** SPAWN GROUPS **************************************************************************** Spitfire_GP3_P9374:SPAWN() Spitfire_GP10_P9374:SPAWN() -- **************************************** SET GROUPS TO FOLLOW ************************************************************************ GP_FOLLOW( Spitfire_GP3_P9374 , Spitfire_GP10_P9374 , LARCL ) end fefifofum, I've added your group.getByName() into the function GP_FOLLOW, but still no luck. I've attached the .miz file as well as this .lua file so you can see how GP10 does not follow GP3; he just RTB's after his 1st WP. Any ideas guys?? ChuckIV TEST - SPAWN ALLIED AIRCRAFT 1940.lua TEST - Battle of Britain - Royal Navy - 1940.miz
  8. I would simply like a spawned AI group named Spitfire_GP10_P9374 to follow another spawned AI group named Spitfire_GP3_P9374 Here is the code I've got so far... ANY IDEA why the spawned AI group Spitfire_GP10_P9374 will not follow the other spawned AI group Spitfire_GP3_P9374??? ANY HELP would be greatly appreciated!!! ChuckIV Here's the code... do local LARCL = POINT_VEC3:New( 0, 0, 914.4 ) -- Line abreast right close level function GP_FOLLOW( Following_GP, Vec3 ) -- Function for a group to follow another local GP_Offset = Vec3 local GP_Task = Following_GP:TaskFollow( Spitfire_GP3_P9374, GP_Offset:GetVec3() ) Following_GP:SetTask( GP_Task, 1 ) end GP_FOLLOW( Spitfire_GP10_P9374, LARCL ) end
  9. Solution I removed FGroup from the parenthesis, and it starting working. So, instead of (FGroup) I just used (), and it worked! *** In addition, I set the ROE for the groups to weapons free and no reaction to threats ***
  10. PLEASE REMOVE THIS POST PLEASE REMOVE THIS POST - I figured out why my groups were not attacking. Thank you, ChuckIV
  11. PLEASE SANTA!! DCS we need the PACIFIC CAMPAIGN!!! Wouldn't it be GREAT to get the Pacific Theater modules!!! I'd personally pull out the old wallet RIGHT NOW and buy every module there was. Here's a few I'd buy RIGHT NOW! F4UA-C Corsair F6F Hellcat F4F Wildcat Dauntless Diver P-39 Airacobra P-38 Lightning Curtiss P-40 Warhawk - Maybe an African Campaign aircraft? hmmmm ‎Brewster SB2A Buccaneer Philippians Map, Iwo Jima Map, Peleliu Map, Midway Map, Guadalcanal Map, Pearl Harbor Map, Okinawa ....... this list goes on and on and on - There is A LOT of money for DCS to make here!!! I'd be broke in no time. :o) ChuckIV
  12. Hi MOOSE gurus! Here's what I'm trying to do... I have a group that's following my group called "Yellow_Group". What does work is that they follow my own Blue_Group perfectly using MOOSE lua code, and when I ask them to attack the enemy in the zone defined in the ME, they stop ALL tasks (following), which is what I want them to do, but then they just RTB. Funny thing is, when asked to join in a different squadron location, they cleartask perfectly, and join up. They don't attack in the zone as planned however. I would like them to engage any enemy in the zone when tasked to do so. I'm attempting to use a PatrolZone even though I'm not having the Yellow_Group actually patrol; they are just following me until asked to attack. After all the enemy have been dispatched, I'll just call them back to our squadron formation. Here's basically what the code looks like so far... Take a look at the code, and tell me what you think. I appreciate any help you can offer. Thanks!! PatrolZone = ZONE:New( "UK_PATROL_ZONE" ) -- zone defined in ME .miz file AICapZone = AI_CAP_ZONE:New( PatrolZone, 200, 10000, 325, 435 ) function CONTROLLABLE:ClearTasks(FGroup) self:F2(FGroup) local DCSControllable = self:GetDCSObject(FGroup) if DCSControllable then local Controller = self:_GetController(FGroup) Controller:resetTask(FGroup) return self end return nil end function GP_ATTACK_BANDITS( FGroup ) FGroup:ClearTasks() AICapZone:SetControllable( FGroup ) AICapZone:SetEngageRange( 20000 ) -- Sets the Engage Range to 20,000 meters/10.8nm AICapZone:__Start( 1 ) end FGroup:ClearTasks() -- this is actually called in another function and IS working - the group stops ALL tasks and starts to RTB -- Then I try this call, and nothing happens -- group still is RTB GP_ATTACK_BANDITS( Yellow_Group ) What am I doing wrong here? Any ideas? ChuckIV
  13. Can REMOVE this thread now You can remove this thread now since it's being monitored in a different one. Thx, C4
  14. Still have a problem - NO ENEMY fighters - STILL lag and crash BIGNEWY, OK, I took all the enemy OUT of the mission, did a very simple fly-out to 20,000 feet, flew around with my squadron of 12 planes (4 groups of 3 aircraft), and returned with 50% of my squadron. YES, 6 out of 12 aircraft could not stay aloft after a 40 minute flight. The fly-out was monitored extremely closely. Oil pressure, RPM, temperatures all monitored and withing safety margins. Climb rate between 1500-2900 on the way out. Leveled off at 20,000 and flew the entire sortie at less than 8 lbs. of manifold pressure and 2600 RPM max. Temperature was maintained via radiator monitoring. I've attached the .miz file again this time WITHOUT any enemy aircraft - therefore NO possibility of damage to the aircraft (unless you include hitting some invisible birds or mighty big mosquitoes!) PLEASE FLY THE MISSION YOURSELF. Climb out like I did - fly for 40 minutes and you will see that HALF of your squadron ditch into the English Channel. First sign of problems is that the groups fall behind and begin to very slowly lose altitude. I also noticed on other missions that lagging, falling groups do NOT respond to TASKS given to them. They go unresponsive as well. Can you please find out what is going on. This is a problem still BIGNEWY. This could be a [YES BUG]. ChuckIV Test Sortie2.miz
  15. It's been a while, but I finally got around to attaching a quick video of this possible BUG. Flying in a squadron of 4 groups (Blue, Red, Yellow, & Green) works great initially. We climb out, attack the enemy and then start to form up again only to have a few stragglers that cant' keep up. This begins to happen at the end of the sortie; around the 37.5 minute mark two of my AI planes eventually lose altitude, drop to 90 mph and crash into the ocean. I can't attach a video that LONG - almost 40 minutes!! I pulled out my iPhone just before the first plane went down and recorded it. The 2nd aircraft ditched two seconds later. The two aircraft that crash are Yellow Group P7350 Enfield 23 Plane Markings XTW and Green Group Enfield 42 Plane Markings XTC. Enfield 23 was at 93mph just before dropping into the ocean, and Enfield 42 was cruising at 105mph. I've attached the .miz file so you can experience this for yourself. The problem is intermittent and may take a few sorties to see what I'm talking about. Fly out, attack the enemy, and regroup and climb for altitude. You will notice a couple of planes lagging behind, eventually drop altitude, drop to around 95mph and ditch into the ocean. I hope you can get to the bottom of this potential BUG - I've had this happen many, many, many times. I've reinstalled DCS many times; both stable and beta - problem still comes back. Let us know what you find out - and if there's anything I need to do on my end if this in fact is not a BUG after all. Also, let me know how to attach a 40 minute video; I tried lowest quality, lowest resolution, tried to archive it as a .rar file, still no luck uploading it. ChuckIV Test Sortie.miz Bug-Crash.rar
  16. Thanks funkyfranky funkyfranky, Thanks for you help - the lua file is working much, much, better now. The groups STOP following Blue Leader and can now be tasked with something new like RTB, ORBIT HERE, or more importantly, ATTACK! Thanks again, ChuckIV
  17. Is this how the code should look?? Do I leave the word CONTROLLABLE as part of the function name?? function CONTROLLABLE:ClearTasks(FGroup) self:F2(FGroup) local DCSControllable = self:GetDCSObject(FGroup) if DCSControllable then local Controller = self:_GetController(FGroup) Controller:resetTask(Fgroup) return self end return nil end FGroup:ClearTasks() ******* Do I need to put FGroup where there are parenthesis ?? ****************
  18. Don't drop actual bombs - use a simulated bombing instead Try simulating the bombing. In other words, don't drop bombs at all, but rather set explosions in zones just under them at the correct timing. This has worked really well for my B17 bombing missions. ChuckIV
  19. OK, I'm trying something with the resetTask() coding.... Using this code... function CONTROLLABLE:ClearTasks() self:F2() local DCSControllable = self:GetDCSObject() if DCSControllable then local Controller = self:_GetController() Controller:resetTask() return self end return nil end If the controllable group is called FGroup, then should the code look something like this where the function is called in the last line??..... function CONTROLLABLE:ClearTasks(Group) self:F2(Group) local DCSControllable = self:GetDCSObject(Group) if DCSControllable then local Controller = self:_GetController(Group) Controller:resetTask(Group) return self end return nil end CONTROLLABLE:ClearTasks(FGroup) -- This line calling the function ????
  20. I tried - it did not work I tried your code simply changing "Race-Track" to "Circle", the speed of the orbiting, and the pContr to FGroup, but it didn't work. My following groups do not DISENGAGE; they do not stop following me after I tried your code. Any other ideas??
  21. Good Day MOOSE coders!! I was hoping someone could show me HOW TO STOP this task seen below... This task is working great - other groups join the lead Blue Group following a VEC3 position. I need the following group to STOP FOLLOWING now so they can RTB, etc. That would be my NEXT question; how to get the following group to change to a landing waypoint at the base? FGroup is the name of the following group Blue_Group is the leading group Any help would be greatly appreciated. Thanks! function CHANGE_SQ_FORMATION( FGroup, Vec_Point ) local GP_Offset = Vec_Point local GP_Task = FGroup:TaskFollow( Blue_Group, GP_Offset:GetVec3() ) FGroup:PushTask( GP_Task, 1 ) end
  22. I would like to include a simple MOOSE coded WW2 EWRS system into my missions similar to the MIST version out there. Can someone point me in the right direction to find this MOOSE code? ChuckIV
  23. GETTING CLOSER NOW!!! STILL NEED HELP OK, we're getting closer now... I've attached my lua and miz files... funkyfranky - you're right, I could not use the math.randomseed() in the DCS environment. It would cancel any spawning attempts. blklobo - I used your code and made sure to use local on some objects and NOT use local on others. Now the planes do spawn randomly, HOWEVER, they spawn and do not complete their FOLLOW task. I've attached both the .lua and .miz file I use, and I would really appreciate if someone could tell me what I'm doing wrong. Why are the randomly spawned groups not completing their follow tasks?? I'm loving the MOOSE coding, but it's quite the learning curve for me. ChuckIV SPAWN ENEMY FIGHTERS.lua Spitfire - Normandy - 1940.miz
  24. I've even tried this and the group will not spawn... do if 1 == 1 then local Bf109_GP2_JG52 = Bf109GP2JG52:Spawn() end end It leads me to believe that you can NOT spawn a group inside an IF THEN condition. Any thoughts?? The group spawns ok with this... local Bf109_GP2_JG52 = Bf109GP2JG52:Spawn() but NOT this... do if 1 == 1 then local Bf109_GP2_JG52 = Bf109GP2JG52:Spawn() end end I am baffled.
  25. MOOSE experts, I need your help. If I spawn groups directly like this, it works.. local Bf109GP1JG52 = SPAWN:New( "Bf109 GP1 JG52" ) local Bf109GP2JG52 = SPAWN:New( "Bf109 GP2 JG52" ) local Bf109GP3JG52 = SPAWN:New( "Bf109 GP3 JG52" ) local Fw190A8GP5JG54 = SPAWN:New( "Fw190A8 GP5 JG54" ) local Fw190A8GP6JG54 = SPAWN:New( "Fw190A8 GP6 JG54" ) local Fw190A8GP7JG54 = SPAWN:New( "Fw190A8 GP7 JG54" ) local Bf109_GP1_JG52 = Bf109GP1JG52:Spawn() local Bf109_GP2_JG52 = Bf109GP2JG52:Spawn() local Bf109_GP3_JG52 = Bf109GP3JG52:Spawn() local Fw190A8_GP5_JG54 = Fw190A8GP5JG54:Spawn() local Fw190A8_GP6_JG54 = Fw190A8GP6JG54:Spawn() local Fw190A8_GP7_JG54 = Fw190A8GP7JG54:Spawn() -- *********************************************************************** If I spawn groups like this (using probability) it does NOT work. do math.randomseed( os.time() ) Select = math.random(1,2) if Select == 1 then local Bf109_GP2_JG52 = Bf109GP2JG52:Spawn() end end do math.randomseed( os.time() ) Select = math.random(1,3) if One_In_Three == 1 then local Bf109_GP3_JG52 = Bf109GP3JG52:Spawn() end end do math.randomseed( os.time() ) Select = math.random(1,2) if One_In_Two == 1 then local Fw190A8_GP6_JG54 = Fw190A8GP6JG54:Spawn() end end do math.randomseed( os.time() ) Select = math.random(1,3) if One_In_Three == 1 then local Fw190A8_GP7_JG54 = Fw190A8GP7JG54:Spawn() end end ANY help would be greatly appreciated in enlightening this newbie. Thanks ChuckIV
×
×
  • Create New...