Jump to content

MrBill

Members
  • Posts

    38
  • Joined

  • Last visited

  1. More praise for ED and this update! Quick question and apologies if I missed it. Are the Multi threaded changes all merged in as of now, or do we still need to run the separate executable to get MT code?
  2. Just checked. Doh! That is indeed the difference. Thanks Rob! I thought I was losing my mind. So, no bug. I didn't realize that the former was part of the canopy and not the fuselage. Thanks again.
  3. I'll have to check. At first I thought both closed. Both planes are default when you spawn in. I'll post back in a bit.
  4. So, I'm really confused here... I've been working on setting custom snap views for the P-51 since the fuel gauges are so awkward. Tried to set snap view for the rear fuselage gauge and kept getting different renderings of the gauge and the structure around it. I narrowed it down to the -25. Get's one gauge when starting cold and another when hot starting on runway. See the attached mission. Jump into each -25 and look at the gauge. On the hot start, you're looking through a former, on the cold start it's out in the open...HUH?? ChailyNavFlightTest.miz
  5. CFrag, Thanks for your help. I'll make the changes you suggest and test it out. You kind of read my mind a bit as I'm about to expand the list of possible groups a lot and make it less predictable. I'm going to set an objective of killing 3 groups before success is declared. That way, the script can choose from a wider set of possible targets.
  6. Thanks to all for weighing in on this topic. I found some of the negative issues in Chump's original code and kept trying to get this all to work. Here are some key points that I learned: This death of a group thing is a LOT more involved than the simple Group Dead flag available in the editor. And I'm only talking about airborne groups here. The checking logic needs to check multiple times and the Bandits are going down in flames. Testing this code took forever as I had to fly to do it...(boo hoo!) I had a GREAT time working through all this and now have a working script to share. Here's the working script. Assumes groups are single unit are defined and late activated. Hope this helps and have fun! local groupList = {"Bandit1", "Bandit2", "Bandit3"} local activatedGroups = {} local function allGroupsDead() for _, groupName in pairs(activatedGroups) do trigger.action.outTextForCoalition(coalition.side.BLUE, groupName .. " Being checked for death status...", 20) if Group.getByName(groupName) then return false end end return true end local function checkAllDead() if allGroupsDead() then trigger.action.outTextForCoalition(coalition.side.BLUE, "All targets (Groups) have been destroyed!", 20) else trigger.action.outTextForCoalition(coalition.side.BLUE, "Some Groups still Alive, Checking again soon...", 20) timer.scheduleFunction(checkAllDead, {}, timer.getTime() + 30) end end local function activateGroup() local groupName local counter = 0 repeat groupName = groupList[math.random(#groupList)] counter = counter + 1 until not activatedGroups[groupName] or counter > 100 activatedGroups[groupName] = groupName -- if we don't use the counter this locks up in an infinite loop if counter > 100 then trigger.action.outTextForCoalition(coalition.side.BLUE, groupName .. " No more groups to activate, waiting for death!", 20) checkAllDead() return end local group = Group.getByName(groupName) trigger.action.activateGroup(group) trigger.action.outTextForCoalition(coalition.side.BLUE, groupName .. " has been activated!", 20) return group end local function dumpEventInfo(event) local m = {} m[#m+1] = "Event ID: " m[#m+1] = event.id if event.initiator then m[#m+1] = "\nInitiator : " m[#m+1] = event.initiator:getName() end if event.weapon then m[#m+1] = "\nWeapon : " m[#m+1] = event.weapon :getTypeName() end if event.target then m[#m+1] = "\nTarget : " m[#m+1] = event.target :getName() end trigger.action.outText(table.concat(m), 20) end local e = {} function e:onEvent(event) local m = {} if event.id == world.event.S_EVENT_KILL then trigger.action.outText(event.target:getName() .. " Killed by (KILL EVENT )" .. event.initiator:getName(), 20) if allGroupsDead() then trigger.action.outTextForCoalition(coalition.side.BLUE, "All targets (Groups) have been destroyed!", 20) else local delay = math.random(1 * 60, 3 * 60) timer.scheduleFunction(activateGroup, {}, timer.getTime() + delay) end end --dumpEventInfo(event) end world.addEventHandler(e) activateGroup()
  7. Thanks Chump! I truly appreciate the help. I'll test it out and reply when it works. For clarification purposes...if I have a group with one unit in it, should I work at the group or the unit level?
  8. Thanks to all for the help. First point. I started with AI code and modified it through testing and learning. If it's crap code to you, that's because I wrote crap code. You should have seen the original code...nowhere close to actually working. As to investment, I've got nearly 16 hours invested in trying to figure this out. So, please don't think I'm just handing a pile of AI code to the group and saying "fix it for me"...not how I roll. As to the specific point about events on unit.destroy(). I DID read the docs such as they are. And YES, I assumed there would be some kind of event. Obviously not. Found that out by testing. Puzzling to me as I was just trying to shorten the test cycles to get the code to work. So, in the larger scheme of things, forget the destroy logic. And if you look at: function e:onEvent(event) you'll see that it should dump EVERY event (as I understand the example code I used for this). Second point: Sorry for my lack of clarity. I want help with the logic behind how to tell if all my Groups (comprised of only one unit) are dead. Third point: All of this works fine except for the logic to tell when ALL of my units or groups are dead. So, maybe the ask should have been: given a table of groups, can you help me check when they are all dead? And when that test is true, print a message to coalition (which I already have done successfully). Finally: I've gone through all the docs I can find and I'm still not clear on whether this logic should be based at the group level or the unit level? Or, to check for group dead, do I need to loop through each unit in the group and check for IT being dead first? I can find nowhere that this is explained clearly. Seems pretty basic as there is the group dead logic in the mission triggers (if my memory serves).
  9. Hi Guys, I too have been playing with Chat GPT... As a test, I asked it to write some LUA code for a mission I'd like to have. Simple requirements Pick a random group from a pre-defined list and activate it I kill it Pick another one and activate it... Check to see if all are dead then print a message After a couple days of messing around and flying the mission, I've got most of it working except the part that checks for all the dead groups and prints the message. I was flying and shooting missiles to test it...and looking for a faster way. So, I figured I'll just set a timer and destroy the groups after they are activated. None of my event code gets hit on the destroy. So, first question: is there a different event fired on Group.destroy()? I see NO events. Second question: can you review my code and help me out here? I'm truly at a loss. BTW, I'm experienced in SW and coding, just not LUA or DCS coding. Last question: Is there a better way to test this stuff without having to fly it? Are there any inspection tools to debug DCS lua? Thanks in advance! local unitList = {"Bandit1", "Bandit3"} local activatedUnits = {} local function activateUnit() local unit repeat unit = unitList[math.random(#unitList)] until not activatedUnits[unit] activatedUnits[unit] = true local group = Group.getByName(unit) trigger.action.activateGroup(group) trigger.action.outTextForCoalition(coalition.side.BLUE, unit .. " has been activated!", 20) return group end local function allUnitsDead() for num, unitName in pairs(unitList) do local group = Group.getByName(unit) local unit = Unit.getByName(unit) if group then trigger.action.outTextForCoalition(coalition.side.BLUE, unitName .. " FOUND therefore Still alive", 20) return false else trigger.action.outTextForCoalition(coalition.side.BLUE, unitName .. " not found therefore dead", 20) end end return true end function dumpEventInfo(event) local m = {} m[#m+1] = "Event ID: " m[#m+1] = event.id if event.initiator then m[#m+1] = "\nInitiator : " m[#m+1] = event.initiator:getName() end if event.weapon then m[#m+1] = "\nWeapon : " m[#m+1] = event.weapon :getTypeName() end if event.target then m[#m+1] = "\nTarget : " m[#m+1] = event.target :getName() end trigger.action.outText(table.concat(m), 20) end local e = {} function e:onEvent(event) local m = {} if event.id == world.event.S_EVENT_KILL then trigger.action.outText(event.target:getName() .. " Killed by " .. event.initiator:getName(), 20) if allUnitsDead() then trigger.action.outTextForCoalition(coalition.side.BLUE, "All units have been destroyed!", 20) else local delay = math.random(10, 15) timer.scheduleFunction(activateUnit, {}, timer.getTime() + delay) end end if event.id == world.event.S_EVENT_DEAD then trigger.action.outText(event.target:getName() .. " UNIT DEAD Event " .. event.initiator:getName(), 20) end dumpEventInfo(event) end world.addEventHandler(e) activateUnit() function testDestroy() Group.destroy(Group.getByName(currentGroup)) trigger.action.outTextForCoalition(coalition.side.BLUE, "Destroying Current Group: " .. currentGroup, 20) end timer.scheduleFunction(testDestroy, {}, timer.getTime() + 35)
  10. This is now fixed after the recent update. Thanks!
  11. After 2.7 update. Never tried this before so, I can't say if it worked before. Following all procedures as I understand them. Arm with pull handle on left of seat Rocket and Tank selector up Selector Release switch UP Uncover master arm Switch master arm up and bomb(s) are released. Track file attached. P47BombTest.zip
  12. Probable Bug JDAM / LGB Same Loadout I can't get a GBU-12 to come off the jet after a GBU-38 has been dropped. Here's the facts: PG map Litening POD Configure fusing on both bombs before making a pass. Codes correct on pod and GBU-12. Drop GBU-38 successfully Make another pass with GBU-12. It won't come off the pylon. Seems to be within params for Auto release. Configured correctly. Come around for another pass Cycle Master Arm with no other changes and she comes off and destroys target. Track attached. If I'm missing something, I'd love to know what I'm doing wrong. Thanks! JDAM_LgbBug.trk
  13. Thanks for the tip. Turns out it was user error. My bad. Got some good knowledge from diving into the Config folder. But there is no bug. Sorry.:music_whistling:
  14. Trying to practice A2A refueling in prep for the Viper. Using the F-15. I have confirmed this in 2 missions. Airstart at 19000 450kts. Right engine is running, left engine starts at idle and slowly spools down too about 23% or something like that. Have to hit Alt-Home to restart it. This is since the latest update in open beta. 2.5.5.35461 I know this started since the latest update. Also, appears like the refueling boom control LCntl-R only turns on. No way to turn it off or toggle it. Miz file attached. Thanks Aerial Refueling Training F-15C_ WFH.miz
  15. I am not positive about this, but I have heard from other more experienced Hornet pilots that you need at least 16 units of elevator trim off the carrier to avoid this message. Check the FCS page and set before takeoff.:thumbup:
×
×
  • Create New...