Creating Equipment

Im trying to create a unique combat system for my game. I am having troublewith a command I want to create something like a inventory list but it must show like this:

Right Hand:
Left Hand
Helmet:
Armor:
Shield:

But the left hand right hand is causing me trouble, I am trying to get it to equip that if the right hand is being used the left will then be used and vice versa. If anyone could show me how to do it I will be very grateful?

Can you show us what you have so far? Did you just create different body parts to be part of the player, or are you using a more abstract system?

Here is the action:

Understand the command “q” as something new.

Equipment checking is an action applying to nothing. Understand “q” as equipment checking.

Carry out equipment checking:
say “Right hand:[line break]Left hand:”.

The problem I have is making a way of keeping track of a sword being in each hand. I originally tried making hands but then if I used it on the player I would also have to use it on enemies and that would make to many hands.

Could you possibly just make the weapon a certain type of thing and only allow the player to hold two things of that type?

(Pseudo code)

A thing can be full handed.
Check taking a full handed thing when the player carries more than one full handed thing:
Say "You are weilding [a list of full handed things carried by the player] so you’ll need to drop one first. " instead.

After printing the name of a full handed thing when taking inventory:
Say “[one of] in your right hand[or] in your left hand[cycling].”

What about the following approach:

Provide that “A person has a thing called RWeapon. The RWeapon of a person is usually nothing. A person has a thing called LWeapon. The LWeapon of a person is usually nothing.”

Now for each person, there are two things associated with that person, which keep track of what is in each hand. When you equip something in the right hand, you would provide that “Now the RWeapon of the actor is the noun,” etc. You can check for what is in the right hand of a particular person with “the Rweapon of [whoever]”, similarly with the left hand. I haven’t worked out the precise code but this may be a workable approach.

Robert Rothman

I like roberts idea. I’ll try to work on it

I’m having a problem with your code robert here is the error:

Problem. In the sentence ‘The RWeapon of a person is usually nothing’ , it looks as if you intend ‘The RWeapon of a person is usually nothing’ to be asserting something, but that tries to set the value of the ‘RWeapon’ property to an object - which must be wrong because this property has to be a thing.

I think that’s because “nothing” is technically an object, not a thing.

Try[code]There is room.

A person has a thing called RWeapon. A person has a thing called LWeapon.

When play begins:
repeat with guy running through people:
now the RWeapon of guy is guy;
now the LWeapon of guy is guy.

Bob is a person, here.

test me with “showme bob”.[/code]That way each person acts as the sentinel/nothing held value for each of their hands, so you can make definitions like Definition: a person is empty-left-handed if the RWeapon of it is it. Definition: a person is empty-right-handed if the LWeapon of it is it.

Sorry, I wasn’t thinking. What about creating a place-holder thing called “null weapon” (or something like that) which you use solely to set RWeapon and LWeapon (and to which you reset the RWeapon or LWeapon if a player unequips or drops an equipped weapon)? If you make the printed name of null weapon “nothing” then it would appear to the player that the character has nothing equipped in his right hand, even though, behind the scenes, he actually had a thing (called “null weapon”) equipped.

Robert Rothman