Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

cargo and points question

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> cargo and points question Page: [1]
Login
Message << Older Topic   Newer Topic >>
cargo and points question - 3/21/2021 11:41:27 PM   
orca

 

Posts: 501
Joined: 11/6/2013
Status: offline
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
Post #: 1
RE: cargo and points question - 3/22/2021 2:16:18 AM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline
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.


< Message edited by KnightHawk75 -- 3/22/2021 2:18:20 AM >

(in reply to orca)
Post #: 2
RE: cargo and points question - 3/22/2021 2:20:18 AM   
Gunner98

 

Posts: 5508
Joined: 4/29/2005
From: The Great White North!
Status: offline
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

_____________________________

Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/

(in reply to orca)
Post #: 3
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> cargo and points question Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.891