Page 1 of 1

Callback bit Setting

Posted: 16 Jul 2009 01:43
by wallyweb
In http://wiki.ttdpatch.net/tiki-index.php ... lbacks_1E_
and similarly http://wiki.ttdpatch.net/tiki-index.php ... lbacks_17_
wiki wrote:Bit is the bit you have to set, you do this by adding all the values for all the bits.

Bit / Value / Variable 0C value / Callback
0 1 10 Powered wagons and visual effect
1 2 11 Wagon length
2 4 12 Load amount
3 8 15 Set refitted capacity
4 10 16 Build articulated engines
5 20 19 show a suffix after the cargo type name
6 40 2D Select color mapping for vehicle
7 80 33 Sound effect callbacks
Adding 2 (Wagon length) + 8 (Set refitted capacity) + 10 (Build articulated engines) = 20
but 20 is the bit value for "show a suffix after the cargo type name".
Are the posted bit values incorrect or does the Patch have some way of knowing what I want?

Re: Callback bit Setting

Posted: 16 Jul 2009 02:32
by DaleStan
2+8+10 = 1A

Think in hex and everything will make sense. Or possibly completely stop making sense.

Re: Callback bit Setting

Posted: 16 Jul 2009 02:57
by wallyweb
DaleStan wrote:2+8+10 = 1A

Think in hex and everything will make sense. Or possibly completely stop making sense.
Actually, I figured it out just before your reply landed on my desk. :wink: so now everything makes perfectly good sense, although a note somewhere in the wiki for us novice coders might save some desks from severe headbanging damage.
Thanks for the reply.

Re: Callback bit Setting

Posted: 16 Jul 2009 04:07
by PikkaBird
Taking on grf coding, wally?

Re: Callback bit Setting

Posted: 16 Jul 2009 08:51
by wallyweb
PikkaBird wrote:Taking on grf coding, wally?
Actually, I think it has taken on me. :wink:

Re: Callback bit Setting

Posted: 16 Jul 2009 21:55
by DaleStan
wallyweb wrote:a note somewhere in the wiki for us novice coders might save some desks from severe headbanging damage.
Go for it. You have a far better idea what would have gotten you to think hex from the start than I have.

Re: Callback bit Setting

Posted: 16 Jul 2009 22:12
by wallyweb
DaleStan wrote:Go for it. You have a far better idea what would have gotten you to think hex from the start than I have.
EEK! I'm caught somewhere between "I thought you'd never ask" and "I was afraid you'd ask".
Fair enough. I'll chalk the experience up to the learning process.
Before I do this, are you aware of any bit-masks in NewGraphicSpecs that are summed in DEC rather than HEX and if so, which ones(s)?

Re: Callback bit Setting

Posted: 17 Jul 2009 01:03
by DaleStan
I'm not aware of any that are in decimal. (If it mentions 10, 20, 40, and/or 80, it's hex. If it mentions 16, 32, 64, and/or 128, it's decimal. If it mentions some from group A and some from group B, it's broken.)

And if I found one in decimal, I'd promptly edit it into hex.

Re: Callback bit Setting

Posted: 17 Jul 2009 01:45
by PikkaBird
Bitmasks make no sense in decimal.

Re: Callback bit Setting

Posted: 17 Jul 2009 02:49
by wallyweb
Ok ... I have done my damag... erm ... duty, in the Preliminaries section which looked most appropriate as it already had a section on HEX.