Changing Status Attributes in Game
brano3000
23 Dec 2013, 07:01In my text adventure game, I want to have it where the currently worn armor is displayed in the status bar.
I think I have set up the attributes right, but I do not understand how to change it in game.
For Example:
*On the status bar* "You are wearing nothing"
Player types: equip armor
*ON the status bar* "You are wearing armor"
How would I do this? Thanks.
I think I have set up the attributes right, but I do not understand how to change it in game.
For Example:
*On the status bar* "You are wearing nothing"
Player types: equip armor
*ON the status bar* "You are wearing armor"
How would I do this? Thanks.
The Pixie
23 Dec 2013, 09:58Have an attribute called "armourstatus" that is a string, and is set to be "You are wearing nothing". Set it to be a status attribute, with just "!" as the second parameter. In the WEAR command, have a line:
or maybe:
and in the REMOVE command:
armourstatus = "You are wearing armor"
or maybe:
armourstatus = "You are wearing " + armour.alias
and in the REMOVE command:
armourstatus = "You are wearing nothing"
brano3000
23 Dec 2013, 15:38I tried doing what you said to do but it isn't seeming to work. I have pictures of how I am doing it attached below. Tell me where I messing up. Thanks for the quick response last time.





HegemonKhan
23 Dec 2013, 19:50You're missing the Object (which would be the "player" Player Object) of your "armorstatus" String Attribute in your "Rag Clothes' " Object's Verb's "Set" script:
if you want to use "Set", this is how it looks in code:
http://quest5.net/wiki/Set
you'll have to figure out how to set up (lol) the "Set" script in the GUI~Editor.
personally, you should use this script inside (it's easier to work with, and is used for A LOT of stuff too):
Add a~new script -> Variables -> Set a variable or attribute ->
-> and the proper form~format~syntax that you use is this ->
Object.Attribute=Value_or_Expression
some examples of this are:
player.strength=100
player.strength=player.strength + 5
player.dead=false
player.right_hand=wooden_sword
game.turns=game.turns + 1
wooden_sword.physical_damage=10.6
for your case, using the GUI~Editor:
Rag Clothes (Object) -> Verb (Tab) -> Add a~new script -> Variables -> Set a variable or attribute ->
(the quotes are needed to tell the game engine that the value is a String Type, so it matches up with the attribute being a String Type, as you setup~created~added via your "player" Player's Attribute)
(the equal sign is already there within the GUI~Editor, so you don't need ~ can't as it'll cause an error ~ to type in the equal sign)
player.armorstatus="You're wearing the armor that you just equipped."
whereas, in your "Set" script, you've just got:
(Set) armorstatus="You're wearing the armor that you just equipped."
you're missing the Object:
"player" Player Object
(Set) player.armorstatus="You're wearing the armor that you just equipped."
-----------------
you must have attributes "attached" to an Object, as because:
okay, I've got this "armorstatus" attribute, but WHAT IS IT AN ATTRIBUTE OF... ????
Quest game engine: "ERROR !!! ERROR !!! Can not compute !!!! "
Is it an attribute of the "player" Player Object, the "HK" Player Object, the "orc" (monster) Object, the Game Object, the "rag clothes" (equipment) Object, the "castle" Room Object, etc... etc... etc...
if you want to use "Set", this is how it looks in code:
http://quest5.net/wiki/Set
you'll have to figure out how to set up (lol) the "Set" script in the GUI~Editor.
personally, you should use this script inside (it's easier to work with, and is used for A LOT of stuff too):
Add a~new script -> Variables -> Set a variable or attribute ->
-> and the proper form~format~syntax that you use is this ->
Object.Attribute=Value_or_Expression
some examples of this are:
player.strength=100
player.strength=player.strength + 5
player.dead=false
player.right_hand=wooden_sword
game.turns=game.turns + 1
wooden_sword.physical_damage=10.6
for your case, using the GUI~Editor:
Rag Clothes (Object) -> Verb (Tab) -> Add a~new script -> Variables -> Set a variable or attribute ->
(the quotes are needed to tell the game engine that the value is a String Type, so it matches up with the attribute being a String Type, as you setup~created~added via your "player" Player's Attribute)
(the equal sign is already there within the GUI~Editor, so you don't need ~ can't as it'll cause an error ~ to type in the equal sign)
player.armorstatus="You're wearing the armor that you just equipped."
whereas, in your "Set" script, you've just got:
(Set) armorstatus="You're wearing the armor that you just equipped."
you're missing the Object:
"player" Player Object
(Set) player.armorstatus="You're wearing the armor that you just equipped."
-----------------
you must have attributes "attached" to an Object, as because:
okay, I've got this "armorstatus" attribute, but WHAT IS IT AN ATTRIBUTE OF... ????
Quest game engine: "ERROR !!! ERROR !!! Can not compute !!!! "
Is it an attribute of the "player" Player Object, the "HK" Player Object, the "orc" (monster) Object, the Game Object, the "rag clothes" (equipment) Object, the "castle" Room Object, etc... etc... etc...
brano3000
23 Dec 2013, 20:40Thank You to both of you!!!!! I got it to work thanks to you!!