Each campaign and scenario need to re-tuned by the devs after the introduction of new missile mechanics

Take command of air and naval assets from post-WW2 to the near future in tactical and operational scale, complete with historical and hypothetical scenarios and an integrated scenario editor.

Moderator: MOD_Command

thewood1
Posts: 9910
Joined: Sun Nov 27, 2005 6:24 pm
Location: Boston

Re: Each campaign and scenario need to re-tuned by the devs after the introduction of new missile mechanics

Post by thewood1 »

I run the Latakia scenario all the time to test new features. It runs fine. You must be doing something wrong.

Also, there are no changes that have been made to CMO that would have any impact on Latakia. I suspect this is an old Harpoon player coming in and not really paying attention to how you play CMO. It kind of makes some of my original points that the changes in CMO have had minimal impacts on scenarios, overall.
thewood1
Posts: 9910
Joined: Sun Nov 27, 2005 6:24 pm
Location: Boston

Re: Each campaign and scenario need to re-tuned by the devs after the introduction of new missile mechanics

Post by thewood1 »

So I went in and turned on opportunity fire for the Saars and the had no issues firing. I did a rerun and created two ASuW missions for the Saars and they won with no losses with hands off.

That's something you had to do from day one on missions and opportunity was added within weeks of CMNAO's release.
User avatar
MausMan2
Posts: 150
Joined: Mon Aug 13, 2007 5:35 am
Location: Minnesota, USA

Re: Each campaign and scenario need to re-tuned by the devs after the introduction of new missile mechanics

Post by MausMan2 »

Confirmed, yes I had the engage opportunity off. -so no problems here.
but still getting older everyday..
thewood1
Posts: 9910
Joined: Sun Nov 27, 2005 6:24 pm
Location: Boston

Re: Each campaign and scenario need to re-tuned by the devs after the introduction of new missile mechanics

Post by thewood1 »

MausMan2 wrote: Mon Oct 02, 2023 1:51 am Confirmed, yes I had the engage opportunity off. -so no problems here.
but still getting older everyday..
So its all better now?
User avatar
Tcao
Posts: 516
Joined: Thu Oct 10, 2013 2:52 pm
Location: 盐城

Re: Each campaign and scenario need to re-tuned by the devs after the introduction of new missile mechanics

Post by Tcao »

blu3s wrote: Fri Sep 15, 2023 4:42 pm I made this script on my own, anyone with basic Editor/Lua knowledge can execute it and try to play the scen with the WRA changes and see if it fits better with his desires?

The script takes into account the max range of each missile to assign a WRA value, shorter range missiles have a WRA of NEZ or 20% of the maximum range, while longer range missiles have a WRA of 60 or 80%. The script assigns a WRA range for each unit, so equal units can have different WRA ranges. This is more fun than the same WRA for all units.

My recommendation is open the scen you wanna try, save it to a new .scen file so you don't override the original and open the Lua Console, change only the first line to enter the name of the AI side. You can run it with all the sides you want, only change the side name.

Edited the script so as not to modify the doctrine of the side and only that of the units. 16/09/23

Code: Select all

local side_name = 'Iraq' ------- NAME OF THE AI SIDE

function AssignWRA(unit,dbid,max_range)
  local range
  if max_range > 80 then
    range = math.ceil(math.random(5,8)/10*max_range)
    SetDoctrineUnit(unit,dbid,range)
  elseif max_range > 40 then 
    range = math.ceil(math.random(3,6)/10*max_range)
    SetDoctrineUnit(unit,dbid,range)
  elseif max_range > 20 then
    range = math.ceil(math.random(1,3)/10*max_range)
    SetDoctrineUnit(unit,dbid,range)
  else
    SetDoctrineUnit(unit,dbid,'NEZ')
  end
end
local side = VP_GetSide({side=side_name})
local weapons_t = {}


for k2,unit in ipairs(side.units) do
  local u = SE_GetUnit({guid=unit.guid})
  local weapons
  if u.type == 'Aircraft' then
    weapons = ScenEdit_GetLoadout({unitname = u.guid})
    for k3,w in ipairs(weapons.weapons) do
      if w.wpn_type == 2001 then
          local data = ScenEdit_QueryDB( 'weapon', w.wpn_dbid )
          AssignWRA(u, w.wpn_dbid, data.ranges.air.max)
      end
    end
  elseif u.type == 'Facility' then
    local mounts = u.mounts
    if mounts ~= nil and #mounts > 0 then
      for i,m in ipairs(mounts) do
      local mount_weapons = m.mount_weapons
        if mount_weapons ~= nil then
            for _,w in ipairs(mount_weapons) do
              if w.wpn_type == 2001 then
                  local data = ScenEdit_QueryDB( 'weapon', w.wpn_dbid )
                  AssignWRA(u, w.wpn_dbid, data.ranges.air.max)
              end
            end
        end
      end
    end
  end
end


P.D: There are some beautiful scenarios made by command users that has into account the recent changes of the game. Check the Mod and Scenarios forum or the workshop on Steam.
Thx! but I got the result as:
ERROR: [string "Console"]:13: attempt to call a nil value (global 'SetDoctrineUnit')

Looks like 'SetDoctrineUnit' is not defined?

Thank you
User avatar
blu3s
Posts: 970
Joined: Fri Jul 08, 2022 9:45 am

Re: Each campaign and scenario need to re-tuned by the devs after the introduction of new missile mechanics

Post by blu3s »

Hi Tcao, you are absolutely right, my fault. Here is the script with the function, (I edit the first script and when copy/paste I didn't copy the SetDoctrineUnit function)

I've added to the random function more numbers to vary the enemy range a little bit more.

Another thing to keep in mind is that the WRA Range does not always reflect the optimal point to achieve a kill (that's what NEZ is for). Sometimes you just want to move the enemy away so that he can't perform his mission.

Code: Select all

local side_name = 'Iraq' ------- NAME OF THE AI SIDE

function SetDoctrineUnit(unit,dbid,range)
  
  for k,i in ipairs({1999,2000}) do
    ScenEdit_SetDoctrineWRA({guid=unit.guid, target_type=i, weapon_dbid=dbid}, {'inherit','inherit',range,'inherit'})
  end
end
function AssignWRA(unit,dbid,max_range)
  local range
  if max_range > 80 then
    range = math.ceil(math.random(60,80)/100*max_range)
    SetDoctrineUnit(unit,dbid,range)
  elseif max_range > 40 then 
    range = math.ceil(math.random(30,50)/100*max_range)
    SetDoctrineUnit(unit,dbid,range)
  elseif max_range > 20 then
    range = math.ceil(math.random(20,30)/100*max_range)
    SetDoctrineUnit(unit,dbid,range)
  else
    SetDoctrineUnit(unit,dbid,'NEZ')
  end
end
local side = VP_GetSide({side=side_name})
local weapons_t = {}


for k2,unit in ipairs(side.units) do
  local u = SE_GetUnit({guid=unit.guid})
  local weapons
  if u.type == 'Aircraft' then
    weapons = ScenEdit_GetLoadout({unitname = u.guid})
    for k3,w in ipairs(weapons.weapons) do
      if w.wpn_type == 2001 then
          local data = ScenEdit_QueryDB( 'weapon', w.wpn_dbid )
          AssignWRA(u, w.wpn_dbid, data.ranges.air.max)
      end
    end
  elseif u.type == 'Facility' then
    local mounts = u.mounts
    if mounts ~= nil and #mounts > 0 then
      for i,m in ipairs(mounts) do
      local mount_weapons = m.mount_weapons
        if mount_weapons ~= nil then
            for _,w in ipairs(mount_weapons) do
              if w.wpn_type == 2001 then
                  local data = ScenEdit_QueryDB( 'weapon', w.wpn_dbid )
                  AssignWRA(u, w.wpn_dbid, data.ranges.air.max)
              end
            end
        end
      end
    end
  end
end
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

Re: Each campaign and scenario need to re-tuned by the devs after the introduction of new missile mechanics

Post by kevinkins »

The community could make new scenarios and abandon the old ones. Or update them and post. There is an editor. However, the great tutorials have to be up to date with changes to the base software. I would expect that from the devs.
“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
Post Reply

Return to “Command: Modern Operations series”