How to sort out Cumulative Flag Values? (Full Version)

All Forums >> [New Releases from Matrix Games] >> The Operational Art of War IV >> Mods and Scenarios



Message


76mm -> How to sort out Cumulative Flag Values? (4/15/2019 1:47:00 PM)

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?




76mm -> RE: How to sort out Cumulative Flag Values? (4/15/2019 2:44:33 PM)

hmmm after a bit of Googling it looks like I need to be looking at "bitwise operators" and "flag attributes"...




cathar1244 -> RE: How to sort out Cumulative Flag Values? (4/15/2019 3:29:12 PM)

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




76mm -> RE: How to sort out Cumulative Flag Values? (4/15/2019 6:47:43 PM)

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! [8D]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
2.514648E-02