cargo and points question (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios



Message


orca -> cargo and points question (3/21/2021 11:41:27 PM)

I loaded 16 infantry sections onto a C-130 and assigned it to a cargo mission to air drop over a location. When dropped the infantry sections are grouped into a single unit containing the multiple mounts etc for the 16 individual infantry sections. I did the same with a MV-22 but it only can carry 6 infantry sections

I want to give the points equal to the number of infantry sections successfully dropped so that once a threshold is reached an airfield changes sides. But if I give points when an infantry section enters an area the points are the same for the 16 and for the 6 infantry sections. Is there a way to give points proportional to the number of infantry sections entering the area using a cargo mission like this?

I could award the points based on the aircraft entering the area that are proportional to what they can carry. But I was hoping to use a cargo mission for this.

Any suggestions?

Thanks




KnightHawk75 -> RE: cargo and points question (3/22/2021 2:16:18 AM)

unit entering area triggers event for the type\types of units they are grouped by.

Then check triggering Unit for type|class| dbid you want whatever to make sure you got the one(s) you want.. Then then loop through mounts on said unit, if a mount match the ones you want, award a points for each found, if not ignore.

local function awardPointsPerMount(u,awardside,thedbid,mountid,pointsper,msg)
    if pointsper == nil then pointsper = 1; end
    if msg == nil then msg = "Points awarded." end
    if ((u ~= nil) and u.mounts ~=nil) and u.dbid == thedbid then --if valid and a "Inf"
      local matchingMountCount = 0;
      for _,v in pairs(u.mounts) do -- run thought the mounts.
        if v.mount_dbid == mountid then --Infantry Section [7.62mm MG/Unguided Infantry Anti Tank Weapon]
           matchingMountCount =  matchingMountCount + 1;
        end
      end
      if matchingMountCount > 0 then
        ScenEdit_SetScore(awardside,ScenEdit_GetScore(awardside) + (matchingMountCount * pointsper),msg);
      end
    end
end
u = ScenEdit_UnitX()
awardPointsPerMount(u,"Argentina",2987,2884,1,"Airdrop points awarded.")

Just an example for "inf", and a inf sec 7.62 mount,point side being Argentina with 1 point per. Adjust as needed of course, like if you want a scoring entry per point remove the counting and just put the score line into the if contained in the for instead of the batched way I have it.




Gunner98 -> RE: cargo and points question (3/22/2021 2:20:18 AM)

Orca

I'm sure there is by using lua, but I haven't tried.

I usually trigger the capture on the first infantry in the area, but then keep checking to see if there are enemy infantry there as well (say every 15 min or so) - if there are you can flip the base back which could be embarrassing if AC have landed.

My logic is weak but workable I believe. If you get one group of infantry into the trigger area, the defences are suppressed enough that the base will be captured in short order.

Flipping the base back to the bad guys if they have units in the area is a counterbalance and also forces the capturing force to garrison the base.

Didn't answer your question but know exactly where you're coming from.

B




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.59375