intfiction.org

The Interactive Fiction Community Forum
It is currently Sat May 25, 2013 8:38 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Creating Equipment
PostPosted: Wed Apr 18, 2012 5:08 am 
Offline

Joined: Mon Apr 16, 2012 12:12 pm
Posts: 56
Location: South Africa
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?

_________________
Ever notice how the "happy face :)" looks more like a "trying to pass gas face"


Top
 Profile Send private message  
 
 Post subject: Re: Creating Equipment
PostPosted: Wed Apr 18, 2012 12:33 pm 
Offline

Joined: Wed Oct 13, 2010 1:42 am
Posts: 343
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?


Top
 Profile Send private message  
 
 Post subject: Re: Creating Equipment
PostPosted: Wed Apr 18, 2012 12:36 pm 
Offline

Joined: Mon Apr 16, 2012 12:12 pm
Posts: 56
Location: South Africa
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.

_________________
Ever notice how the "happy face :)" looks more like a "trying to pass gas face"


Top
 Profile Send private message  
 
 Post subject: Re: Creating Equipment
PostPosted: Thu Apr 19, 2012 9:29 am 
Offline

Joined: Tue Nov 08, 2011 8:11 am
Posts: 79
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.


Top
 Profile Send private message  
 
 Post subject: Re: Creating Equipment
PostPosted: Thu Apr 19, 2012 9:39 am 
Offline

Joined: Tue Nov 08, 2011 8:11 am
Posts: 79
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]."


Top
 Profile Send private message  
 
 Post subject: Re: Creating Equipment
PostPosted: Thu Apr 19, 2012 9:41 am 
Offline

Joined: Fri May 06, 2011 7:15 pm
Posts: 489
Location: The Big Apple
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


Top
 Profile Send private message  
 
 Post subject: Re: Creating Equipment
PostPosted: Thu Apr 19, 2012 12:21 pm 
Offline

Joined: Mon Apr 16, 2012 12:12 pm
Posts: 56
Location: South Africa
I like roberts idea. I'll try to work on it

_________________
Ever notice how the "happy face :)" looks more like a "trying to pass gas face"


Top
 Profile Send private message  
 
 Post subject: Re: Creating Equipment
PostPosted: Sat Apr 21, 2012 3:23 am 
Offline

Joined: Mon Apr 16, 2012 12:12 pm
Posts: 56
Location: South Africa
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.

_________________
Ever notice how the "happy face :)" looks more like a "trying to pass gas face"


Top
 Profile Send private message  
 
 Post subject: Re: Creating Equipment
PostPosted: Sun Apr 22, 2012 6:26 am 
Offline

Joined: Sun Dec 05, 2010 11:07 am
Posts: 321
Location: ኢትዮጵያ
KGentle wrote:
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".
That way each person acts as the sentinel/nothing held value for each of their hands, so you can make definitions like
Code:
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.


Top
 Profile Send private message  
 
 Post subject: Re: Creating Equipment
PostPosted: Sun Apr 22, 2012 3:17 pm 
Offline

Joined: Fri May 06, 2011 7:15 pm
Posts: 489
Location: The Big Apple
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


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group