Jump to content

nebuluski

Members
  • Posts

    145
  • Joined

  • Last visited

1 Follower

About nebuluski

  • Birthday 06/25/1960

Personal Information

  • Flight Simulators
    Black Shark 2, FC3, A10C, Huey, FF5, Falcon 4 AF, OF4.7, BMS, FS9, FSX
  • Location
    Leatherhead, UK
  • Occupation
    Retired

Recent Profile Visitors

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

  1. Have resolved the issue. It appears this was not working to the parameters to the firetask not being correct in some way! As soon as Ichanged these to just target x, y and radius it started working! -- CONFIGURATION local sovietGroupPrefix = "USSR" local artilleryGroupPrefix = "USSR-ARTY-BTY-" local timeDelaySeconds = 120 local minKillzoneRadius = 75 local maxKillzoneRadius = 300 local maxArtilleryRange = 30000 -- 30km -- INTERNAL VARIABLES local attackedGroups = {} -- EVENT HANDLER local eventHandler = {} function eventHandler:onEvent(event) if event.id == world.event.S_EVENT_HIT then if event.target and event.target:getCategory() == Object.Category.UNIT then local targetGroup = event.target:getGroup() if targetGroup and string.find(targetGroup:getName(), sovietGroupPrefix) == 1 then local groupName = targetGroup:getName() if not attackedGroups[groupName] then attackedGroups[groupName] = { hitTime = timer.getTime(), enemyUnits = {} } end if event.initiator and event.initiator:getCategory() == Object.Category.UNIT then table.insert(attackedGroups[groupName].enemyUnits, event.initiator) env.info(string.format("[ArtilleryScript] Enemy unit %s fired on %s", event.initiator:getName(), groupName)) end end end end end world.addEventHandler(eventHandler) -- FUNCTION TO CALCULATE CENTER local function calculateCenter(units) local sumX, sumZ = 0, 0 local count = 0 for _, unit in ipairs(units) do if unit:isExist() then local pos = unit:getPoint() sumX = sumX + pos.x sumZ = sumZ + pos.z count = count + 1 end end if count == 0 then return nil end return { x = sumX / count, z = sumZ / count } end -- FUNCTION TO FIND NEAREST ARTILLERY local function findNearestArtillery(centerPos) local nearestGroup = nil local nearestDistance = math.huge for i = 1, 20 do local groupName = artilleryGroupPrefix .. tostring(i) local group = Group.getByName(groupName) if group and group:isExist() then local unit = group:getUnit(1) if unit and unit:isExist() then local pos = unit:getPoint() local dx = pos.x - centerPos.x local dz = pos.z - centerPos.z local distance = math.sqrt(dx * dx + dz * dz) env.info(string.format("[ArtilleryScript] Checking artillery %s at (%.1f, %.1f), distance: %.1f", groupName, pos.x, pos.z, distance)) if distance < nearestDistance then nearestDistance = distance nearestGroup = group end end else env.info("[ArtilleryScript] Artillery group not found: " .. groupName) end end return nearestGroup, nearestDistance end -- FUNCTION TO ORDER ARTILLERY FIRE local function fireArtillery(enemyUnits) local centerPos = calculateCenter(enemyUnits) if not centerPos then env.error("[ArtilleryScript] No valid enemy units found to fire at!") return end local nearestGroup, nearestDistance = findNearestArtillery(centerPos) if not nearestGroup then env.error("[ArtilleryScript] No artillery groups found!") return end if nearestDistance > maxArtilleryRange then env.info(string.format("[ArtilleryScript] Nearest artillery group too far away (%.1f meters), no fire mission.", nearestDistance)) return end local radius = math.random(minKillzoneRadius, maxKillzoneRadius) local fireTask = { id = 'FireAtPoint', params = { point = { x = centerPos.x, y = centerPos.z }, -- Correct mapping! radius = radius, } } nearestGroup:getController():pushTask(fireTask) env.info(string.format("[ArtilleryScript] Ordered %s to fire at (X=%.1f, Y=%.1f) with radius %d", nearestGroup:getName(), centerPos.x, centerPos.z, radius)) end -- SCHEDULED FUNCTION TO CHECK TIME local function checkArtilleryTrigger() for groupName, data in pairs(attackedGroups) do if timer.getTime() >= data.hitTime + timeDelaySeconds then env.info(string.format("[ArtilleryScript] Triggering artillery response for group %s", groupName)) fireArtillery(data.enemyUnits) attackedGroups[groupName] = nil end end return timer.getTime() + 5 end -- INITIALIZATION env.info("[ArtilleryScript] Soviet Recce Artillery Response Script Started") timer.scheduleFunction(checkArtilleryTrigger, {}, timer.getTime() + 5)
  2. Yes if setup as intial waypoint action it works fine. Unit is artillery so does not need LOS to target. Target in this case was 11Km away.
  3. Having problems getting this to work on Germany map. It is just not working. Anybody else noticed this? The code I was using is this below. Have also attached a stripped out miz file used to demonstrate, issue. It appears to pushTask but nothing happens. Thanks -- CONFIGURATION local sovietGroupPrefix = "USSR" local artilleryGroupPrefix = "USSR-ARTY-BTY-" local timeDelaySeconds = 120 local minKillzoneRadius = 50 local maxKillzoneRadius = 200 local maxArtilleryRange = 30000 -- Fire parameters local expendQty = 20 local expendQtyEnabled = true local weaponType = 0 -- 0 = any local alt_type = 0 -- 0 = BARO local counterbatteryRadius = 0 -- INTERNAL VARIABLES local attackedGroups = {} -- EVENT HANDLER local eventHandler = {} function eventHandler:onEvent(event) if event.id == world.event.S_EVENT_HIT then if event.target and event.target:getCategory() == Object.Category.UNIT then local targetGroup = event.target:getGroup() if targetGroup and string.find(targetGroup:getName(), sovietGroupPrefix) == 1 then local groupName = targetGroup:getName() if not attackedGroups[groupName] then attackedGroups[groupName] = { hitTime = timer.getTime(), enemyUnits = {} } end if event.initiator and event.initiator:getCategory() == Object.Category.UNIT then table.insert(attackedGroups[groupName].enemyUnits, event.initiator) env.info("Enemy unit " .. event.initiator:getName() .. " fired on " .. groupName) end end end end end world.addEventHandler(eventHandler) -- FUNCTION TO FIND NEAREST ARTILLERY local function findNearestArtillery(targetPos) local nearestGroup = nil local nearestDistance = math.huge for i = 1, 20 do local groupName = artilleryGroupPrefix .. tostring(i) local group = Group.getByName(groupName) if group and group:isExist() then local unit = group:getUnit(1) if unit and unit:isExist() then local pos = unit:getPoint() local dx = pos.x - targetPos.x local dz = pos.z - targetPos.z local distance = math.sqrt(dx * dx + dz * dz) if distance < nearestDistance then nearestDistance = distance nearestGroup = group end end end end return nearestGroup, nearestDistance end -- FUNCTION TO STOP ARTILLERY local function stopArtillery(group) if group and group:isExist() then local controller = group:getController() if controller then controller:setTask({ id = 'Hold', params = {} }) env.info(" Ordered artillery group " .. group:getName() .. " to HOLD position before firing.") end end end -- FUNCTION TO ORDER ARTILLERY FIRE local function fireArtillery(enemyUnits) if #enemyUnits == 0 then env.error("No enemy units to attack!") return end local validEnemy = nil for _, enemy in ipairs(enemyUnits) do if enemy:isExist() then validEnemy = enemy break end end if not validEnemy then env.error("No valid enemy units exist to target!") return end local enemyPos = validEnemy:getPoint() local nearestGroup, nearestDistance = findNearestArtillery(enemyPos) if not nearestGroup then env.error("No artillery groups found!") return end if nearestDistance > maxArtilleryRange then env.info("Nearest artillery group too far away (" .. math.floor(nearestDistance) .. "m), no fire mission.") return end -- STOP THEM FIRST! stopArtillery(nearestGroup) local randomAngle = math.random() * 2 * math.pi local randomDistance = math.random(0, 50) local targetX = enemyPos.x + math.cos(randomAngle) * randomDistance local targetZ = enemyPos.z + math.sin(randomAngle) * randomDistance local terrainHeight = land.getHeight({x = targetX, y = targetZ}) local targetPos = { x = targetX, y = terrainHeight, z = targetZ } local radius = math.random(minKillzoneRadius, maxKillzoneRadius) local fireTask = { id = 'FireAtPoint', params = { point = { x = targetPos.x, y = targetPos.z }, radius = radius, expendQty = expendQty, expendQtyEnabled = expendQtyEnabled, weaponType = weaponType, altitude = targetPos.y, alt_type = alt_type, counterbatteryRadius = counterbatteryRadius } } local controller = nearestGroup:getController() if controller then controller:pushTask(fireTask) env.info(string.format(" Artillery %s firing at (X:%.2f, Z:%.2f, Height:%.2f, Radius:%d)", nearestGroup:getName(), targetPos.x, targetPos.z, targetPos.y, radius)) else env.error("No controller for group: " .. nearestGroup:getName()) end end -- SCHEDULED FUNCTION TO CHECK ARTILLERY TRIGGER local function checkArtilleryTrigger() for groupName, data in pairs(attackedGroups) do if timer.getTime() >= data.hitTime + timeDelaySeconds then env.info(" Checking artillery fire for group: " .. groupName) fireArtillery(data.enemyUnits) attackedGroups[groupName] = nil end end return timer.getTime() + 5 end -- INITIALIZATION env.info(" Soviet Recce Artillery Final Script with Hold Before Fire v2 Started") timer.scheduleFunction(checkArtilleryTrigger, {}, timer.getTime() + 5) 24 -=Shrek=- Meat Grinder-TEST.miz
  4. Still see the missing texture in DCS 2.9.6.58056
  5. Surely we need some motorcycles with insurgents on with and without AKs to differentiate between civilian's and players/insurgents!
  6. Try here in viperpits - Taipan did a second run of CPDs and then released all drawings etc here https://www.viperpits.org/smf/index.php?action=downloads;sa=view;down=204
  7. The following: 1. Al Mounib Axis bridges N 29 59 22,33 E 031 13 35.66 2. Middle Ring Road bridges across Nile! N29 51 50.98 E 031 17 19.03 3. Probably affects other bridges across Nile. - cannot be "Assigned as:" in the mission editor; - cannot be detroyed! This prevents them being used as targets! The El Ferdan Railway bridge and Suez Canal bridge are OK. Cheers - love the map by the way!!!
      • 2
      • Like
  8. Hi SUNTSAG I am trying to use your Modern AM2 mat mod from the link provided above but it no longer appears to be working. Has it been removed or withdrawn? Thanks!
  9. BUG Still present after todays update! BUG Still present after today's update!
  10. Cheers that was it just needed to push the steer points out as you say for the wingman to join up. Its quite finicky to get them to continue to climb though. They also insisted on diving when entering weapons engagement area/zone, the way around this was to replace ROE = WEAPONS FREE at an early steer point with ROE = DESIGNATED TARGET ONLY at the attack steer point.
  11. So if the SA10 is changed to an SA2 the flights do attack but at about 15 miles and from an altitude of about 4000 feet. So the AI SEAD flight is not flying at the altitudes set in the ME! Which appears to be a bug! Unless of course it is a feature. Considering the AGM88 has a range greater than this and especially at higher altitudes.
  12. Hi Exorcet The test mission was setup as follows: Set Options : ROE = Weapon Free Reaction to Threat = PASSIVE DEFENCE Chaff - Flare = USE WHEN FLYING IN SAM WEZ ECM Using = USE IF DETECTED OR LOCK BY RADAR About 64 Miles from target SA10 WP action set to: Attack Group = SA10 group I have now tried options as you suggested, AI Flight behaviour same and ignores restrict Jettison option as well! Also tried F18 with AGM88s and AGM154s, same behaviour. Thanks for the suggestions though!
  13. If a flight is setup to attack an SA10 SAM site, the flight follows flight path ignoring set flight heights and fails to attack the site. Have tried this with F16c blk 52 and F18 lot 20 to no avail. Test mission and track attached! Thanks in advance In latest OpenBeta patch as of 19/11/19 SEAD AI Test.trk AI SEAD test.miz
  14. 1. Ability to save kneepad files to individual aircraft groups (similiar to saving briefing files) not aircraft type! 2. Ability to change a groups coalition via trigger ie from Neutral to Red etc. 3. More callsigns. 4. Infantry for UK. 5. ATGM Infantry for US etc. 6. Landrover and Rapier vehicles for UK as they should have them as well as Iran! 7. Ability to rotate groups of units altogether, rather than individual units. 8. A radio load COMM 1 and COMM 2 UHF and VHF presets CH1-CH20 section for all aircraft in a formation. 9. Add a "Switch Waypoint" command for ships. 10. Additional Parameters for role-specific missions such as CAP or Antiship AG engagement range Preferred weapons to employ Fall back if enemy gets too close RTB is enemy gets too close 11.`Set Bingo Fuel Level 12. Allow bombers to fly in groups that have formations. 13. Launch decoy/drone at specific bearing/altitude The lack of this functionality is already a problem for the F-14B as the plane's AI will dive to the deck and shoot it like a rocket. 14. Paradrop capability both infantry and appropriate vehicles based on aircraft type. 15. Ability to copy triggers from one mission to another. 16. More fortifications like HESCO barriers, emplacements, fences and gates for building more realistic FOBs and FARPs 17. Trigger to determine if any static objects built into the map, like bridges or buildings, are damaged or destroyed in a zone. 18. Simple covered position (revetments from earth/sand) for Tanks and vehicles. 19. Neutral Coalition. 20. Data Cartridges similiar to Falcon BMS. PPTs etc 21. Ability to group and save statics as a template.
  15. Still bugged in latest release. If you leave weapons as spawned with seems to work as you say!
×
×
  • Create New...