View Single Post
Old 06-28-2003, 06:50 PM   #1
karlan
Member
 
Join Date: Apr 2002
Location: Brisbane Australia
Posts: 74
karlan is on a distinguished road
Arrow

Possibly something that could be done in the coders forum, but...

I was looking at equipment and was considering ways of doing objects that cover multiple positions (for CircleMUD, but the concept is codebase independant, unless thtere is somehow a codebase that doesn't support ANY equipment) From what I have seen alot of codebases say a helmet is worn on the head, but given the follwing positions.
ON_HEAD
OVER_FACE
NAPE

there are helmets that can be full faced ON_HEAD && OVER_FACE, and Full helmets that cover the face, and protect the back of the neck (should also have appropriate penalties) ON_HEAD && OVER_FACE && NAPE. Similar situations exist for HANDS, WRISTS, FOREARMS, ARMS and FEET, ANKLE, LOWER_LEG, LEG.

One simple way of doing this is to add in the appropriate extra positions (FACE_HEAD, FACE_HEAD_NAPE, HAND_FOREARM and so on), and checks... [code] if ((wear_pos == FACE_HEAD_NAPE) && (IS_WEARING(ch, ON_HEAD) || IS_WEARING(ch, OVER_FACE) || IS_WEARING(ch, NAPE))
{
  .... // Can't wear it, sorry
}[/quote]
But it uses up wear positions quickly, Ok, so you could do away with the bitvector (use a type with size = 8 bytes) as a means of storing where an object MAY be worn, but linked lists suck, and bitwise operations are very fast in hardware.

From there I got thinking about dependant positions (although these are much, much more simple), picture a military banner worn strapped to the armour (Incan warrior style), you could have a BANNER and BANNER_POLE position, with BANNER requiring, an appropraite object in BANNER_POLE which requires an appropraite object in BODY, or BACK, and if on BODY, nothing should be worn ABOUT_BODY - a cloak would really annoy.

Then I got onto the strand of race specific positions, you could have a race that has wings, or a race with no eyes, or a race without fingers.......

SO, I posted this as a way of seeing how others have/would deal with situations like the above ones.
karlan is offline   Reply With Quote