Re: [bpl14] [win98] obj affects

From: Klaus Myrseth (
Date: 11/14/98

> also i was wondering how the bits were set and read for object affects
> if i put a
> C
> 1
> in the file it is blind
> C
> 2
> is invisible
> but
> C
> 3
> is both blind and invisible, so is there a way to get to 8 which is
> sanctuary?  oh and if i put C128 i get sanctuary.

Ok ill tell you how bitfields work, if you have like a long datatype that is
32 bits, when you want to add several values to that one veriable you have
to use the bitfields......When you do this you can use one variable to
represent 32 "values" (it is like a lightswitch on off, only value you can
represent), to add a value to one bitfield you have to keep within these
bit1 = 1, bit2 = 2, bit3 = 4, bit4 = 8, bit5 = 16, bit6 = 32, bit7 = 64, and
bit 8 = 128......This will go on after what bit you want to access, so when
you see 128 give sanc, you can see that its position 8 it sets. If you add
16 + 32, you get a value that represents that bitfield 5 and 6 are set, that
is why blind and invis on value 3. For these values you will have to look in
structs.h, everything is defined there with the different values that match
for it....You will see them as AFF_BLIND, AFF_SANC and so on, and the value
behind if it says something like this (1 << 7) it means put the 1 at
bitfield 7 (but remember computers start everything with 0, so that is in
reality a bitfield 8) and that is value of 128, have fun, hope this has
helped you.

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST