Bot Questions - Player Position packet weapons question Anonymous - Sun Jun 12, 2005 1:41 am Post subject: Player Position packet weapons question
Hey everyone, I'm attempting to write in some better weapons stuff for TWCore and when I looked at the packet def's for weapons I noticed something weird, the there are only 9 different types of weapons but it has 5bits available for it... why does it seem to have 1 more bit than necessary and does it want the to process 01000 as 8 or 10000 as 8?
Thanks,
Ikrit
Contempt+ - Sun Jun 12, 2005 2:48 am Post subject:
it should be 01000 or 1000
Anonymous - Sun Jun 12, 2005 3:45 am Post subject:
Ok... so, an overall thing could be like 0000111000000000 for regular level 3 bullet? which would put it at a huge number ... right?
Contempt+ - Sun Jun 12, 2005 4:32 am Post subject:
Well, there's only 1 number there. 00001110 is 14, and 00000000 is just 0.
I'm not really sure about the level 3 bullet, hopefully either you figure it out, or someone else can help. sorry man
Mr Ekted - Sun Jun 12, 2005 7:12 am Post subject:
Weapons types go from 0 to 8 in 5 bits (00000 to 01000). JeffP likely left an extra bit for future weapon types. A weapon field in the various structures is 16 bits long:
MM SH SH SH SH SH SL SL SB WL WL WT WT WT WT WT
MM = multi-mine
SH = # shrap
SL = shrap level
SB = shrap bounce
WL = weapon level
WT = weapon type
Note that in the packet itself (and in memory under Intel), these 2 bytes are physcially reversed (Intel order).
Anonymous - Sun Jun 12, 2005 2:59 pm Post subject:
Ah, thanks Ekted the order was confusing me, I had it backwards lol.