Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

How to sort out Cumulative Flag Values?

 
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] >> The Operational Art of War IV >> Mods and Scenarios >> How to sort out Cumulative Flag Values? Page: [1]
Login
Message << Older Topic   Newer Topic >>
How to sort out Cumulative Flag Values? - 4/15/2019 1:47:00 PM   
76mm


Posts: 3726
Joined: 5/2/2004
From: Washington, DC
Status: online
OK, still making good progress on the eqp files, but have a basic question: I'm trying to build in a filter for equipment by flag values, but now see that many flags contain "cumulative" flag values, ie equipment can have a FLAG0 has a value of 12, which I guess means that they are both Active Defenders (4) and Recon Capable (8). Other equipment has a FLAG0 value of 14, so I guess Active Defenders (4), Recon Capable (8), and Armored (2)...

I've seen this kind of stuff before, so am guessing that there must be a standard formula or algorithm for figuring out what combination is represented by the various numbers? Can anyone point me towards this formula/algorithm or even tell me what this formula/algorithm/process is called so that I can Google it?
Post #: 1
RE: How to sort out Cumulative Flag Values? - 4/15/2019 2:44:33 PM   
76mm


Posts: 3726
Joined: 5/2/2004
From: Washington, DC
Status: online
hmmm after a bit of Googling it looks like I need to be looking at "bitwise operators" and "flag attributes"...

(in reply to 76mm)
Post #: 2
RE: How to sort out Cumulative Flag Values? - 4/15/2019 3:29:12 PM   
cathar1244

 

Posts: 561
Joined: 9/5/2009
Status: offline
Rusty here, but IIRC the "mod" or "modulus" operator can help here.

Flag_value mod 128 should return the remainder, then proceed down the power-of-two chain.

Cheers

(in reply to 76mm)
Post #: 3
RE: How to sort out Cumulative Flag Values? - 4/15/2019 6:47:43 PM   
76mm


Posts: 3726
Joined: 5/2/2004
From: Washington, DC
Status: online
quote:

ORIGINAL: cathar1244

Rusty here, but IIRC the "mod" or "modulus" operator can help here.

Flag_value mod 128 should return the remainder, then proceed down the power-of-two chain.

Thanks, I've got about a dozen tabs open with various Google results on this stuff, should be able to figure it out--hopefully!

(in reply to cathar1244)
Post #: 4
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> The Operational Art of War IV >> Mods and Scenarios >> How to sort out Cumulative Flag Values? 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.121