Jump to content

normre14232

Members
  • Posts

    19
  • Joined

  • Last visited

About normre14232

  • Birthday 12/19/1970

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thank you all for the replies. Turns out I can't read so well. I had the switch bound to "glance down" not "gear down".....oops(doh!!)
  2. Ok guru's some, I'm at a loss. Since the 2.9 update, when selecting gear down with my bound controller switch nothing happens. The switch is functional and will bind no issue. The gear will raise on issue on takeoff. The gear will lower no issue, if the lever is accuated with a mouse click. Aircraft sustained no damage during the mission. Scenario last time it happened...takeoff from carrrier....flip switch...gear up. Fly mission. Return carrier...in the break...flip switch back down...nada. Use mouse on lever...gear down. Thoughts?? TIA
  3. Below is a script intended to create a table of all Red Groups and if inside a certain range give BRA updates to the player. The script runs with no errors logged in DCS.log file, however the BRA message never prints. Also the debugging messages as commented in code never print. I suspect there is a problem with my table or point finding method. Any help would be appreciated. Thanks in advance, NormRe local bogeyrange, bogeyrangeNM, update update = 60 function AWACS() -- create table of RED AIRPLANE Group redgroups = mist.getGroupsByAttribute({category = 'AIRPLANE', coalition = "red"}, 2, true) -- get location of RED groups for i, redgroup in ipairs(redgroups) do trigger.action.outText('Iterating Table',30) --msg never prints redgroupPos = mist.getLeadPos(redgroup) trigger.action.outText('Current Group Position ' ..redgroupPos, 30) --msg never prints -- get location of player Unit playerPos = Unit.getByName('player'):getPosition().p -- determine range of RED Groups to player bogeyrange = mist.utils.get2DDist(redgroupPos, playerPos) bogeyrangeNM = mist.utils.metersTONM(bogeyrange) trigger.action.outText('Range to Bogey is ' ..bogeyrangeNM, 30) --msg never prints -- determine if bogey relevant to player if bogeyrangeNM <= 100 then -- output BRA of RED groups to player mist.msgBRA({ units = Group.getUnits(redgroup), ref = 'player', metric = false, text = 'Bogey BRA ', displaytime = 15, msgFor = {units = {'player'}} }) end end -- set update rate based on Bogey Range --if bogeyrangeNM < 60 and bogeyrangeNM >= 40 then update = 30 --elseif bogeyrangeNM < 40 and bogeyrangeNM >= 10 then update = 15 --elseif bogeyrangeNM > 10 then update = 10 end end mist.scheduleFunction(AWACS, {}, timer.getTime()+ 10, update)
  4. Grimes, Thanks very much for the help. Its kinda like chatGPT knows the words and the grammer, but not the context. NormRe
  5. Ok I know I am missing something stupid....but I just really not that good with lua I would like this code to test if any plane units named Threat* are radar detected by any EWR units named EWR* and the trigger flag "detected" All help is greatly appreciated -- Create empty tables to store the EWR and threat units local ewr_units = {} local threat_units = {} -- Loop through all units in the mission and store the EWR and threat units for _, unit in pairs(mist.DBs.unitsByName) do if string.find(unit.name, "^EWR") then table.insert(ewr_units, unit) end if string.find(unit.name, "^Threat") then table.insert(threat_units, unit) end end -- Output the contents of the ewr_units and threat_units tables local ewr_units_str = "EWR units: " .. table.concat(ewr_units, ", ") local threat_units_str = "Threat units: " .. table.concat(threat_units, ", ") trigger.action.outText(ewr_units_str .. "\n" .. threat_units_str, 10) -- Define function to check for detections local function checkDetections() for i, plane in pairs(threat_units) do for j, radar in pairs(ewr_units) do if Controller.isTargetDetected(radar, plane, RADAR) == true then trigger.action.setUserFlag("detected", true) end end end -- Schedule the function to run again in 1 second timer.scheduleFunction(checkDetections, {}, timer.getTime() + 1) end -- Schedule the initial function call in 1 second timer.scheduleFunction(checkDetections, {}, timer.getTime() + 1) P.S ChatGPT can only get you so far....lol
  6. Any thoughts on way a second red f-5 spawns about 2-3 second after the first red f-5 spawns when zone WingRed is triggered by flag 1 at time more than 30 secs. Thanks in advance NormRe wingswitch.miz
  7. Ok....this is a different mission.....I don't think it has any dependencies.....same xFlag warning. Of note tho, the xFlag module seems to be working as intended ArmorBattle.miz
  8. I'm getting the Zone: warning setFlag has <none> error when using xFlags. Any ideas?? F16 CAS-DML TEST.miz
  9. Can’t SetTask for Delayed spawned units Interesting note...unable to get any :settask assignment work if :spawnscheduled is used. DCS log shows tried to access nil value for the object so spawned.
  10. ok clearly I have a syntax problem....script fails if run as written. However if I comment out the REDTASK = REDAIR:Engagetargets line, the script runs fine oops see copied txt....--Inbound Cargo Aircraft local C17=RAT:New("RAT_C17") C17:SetTakeoff("air") C17:SetDeparture("Inbound") C17:SetDestination("Al Dhafra AB") C17:SetSpawnDelay(300) C17:SetSpawnInterval(300) C17:NoRespawn() C17:Spawn(5) --Randomize Selection on REDCAP Templates = { "RED Template1","RED Template2" } GroupSize = {2,4} PickedGroupSize = GroupSize[math.random(1,2)] RED_SPAWN1 = SPAWN:New( "RED AIR1" ):InitLimit( 4, 1 ):InitGrouping(PickedGroupSize):InitRandomizeTemplate(Templates):InitDelayOn():SpawnScheduled(0,0) --See if REDAIR becomes agressive REDAIR = GROUP:FindByName("RED AIR1#001") REDTask = REDAIR:EnRouteTaskEngageTargets(100000,{},1) Messager = SCHEDULER:New( nil, function() -- TaskRandom = math.random(1,4) -- if TaskRandom == 1 then -- REDAIR:OptionROEWeaponFree() -- REDAIR:PushTask(REDTask,10 ) CrazyRed = MESSAGE:New( "All Players...All Players, Overlord. REDFOR Patrol observed leaving station. Be Alert for Possible Hostile Intent", 20):ToAll() -- end end, {}, 30, 1 )
  11. So kinda proud of myself....fleshed out the code a bit....boy has this been a learning experience. I think the final result is pretty cool. Script test to see if any blue aircraft can be detected by a radar unit. Then increments a variable that can be used to simulate "burn thru". Thanks to all the replies for your help. I'll post below for comments, suggestions, flames, etc. BTW it does require mist, as I had of use a couple of it's functions trigger.action.outText("NHR Radar Detection Script Active",10) local radarscore = 0 local function Scheduler_Function() local tracked = false local targettable = mist.makeUnitTable({'[blue][plane]'}) for i = 1 , #targettable do local target = Unit.getByName(targettable) if Unit.getByName('EW'):getController():isTargetDetected(target, 'RADAR') == true then tracked = true elseif Unit.getByName('EW'):getController():isTargetDetected(target, 'RADAR') ~= true then trigger.action.setUserFlag("100", radarscore) end end if tracked == true then radarscore = radarscore + 1 trigger.action.setUserFlag("100", radarscore) --trigger.action.outText(radarscore,10) end return timer.getTime() + 5 end timer.scheduleFunction(Scheduler_Function, nil, timer.getTime() + 5)
  12. Also a note for other that might be interested.....function only works with UNITS is you want to check detection of aircraft. If you call GROUPS is will only work for ships and ground vehicles. Just FYI....
  13. Thanks very much....it helps a lot to see the scheduler in context. So I could basically put any code in between the local function and the return and it would run on a schedule. Very Cool.
  14. Oops....maybe not. Seems like the flag is always true now....
×
×
  • Create New...