Alternatives to Attributes

714flame
I apologize in advance if this is a stupid question.

I've just started using Quest a couple of days ago using the online editor, as I have a Mac.

For the project I'm currently working on, I'd like to add a couple of attributes to the main character that are not visible to the player.

I'm aware that I can't actually use attributes in the online version, so I'm asking if you guys could recommend any good alternatives to using attributes to store information (i.e. could I add objects to the player's inventory that don't show up there to help keep track of things)

Thanks for your help.

HegemonKhan
You can actually (I think...), but it's a bit more indirect using the Online (or is it Gamebook version only, meh):

Gamebook:

'game' -> Setup (tab) -> 'start' script -> Add ->

run as script -> add a script -> variables -> set a variable or attribute -> (see below)

Object.Attribute = Value_or_Expression

however, in the Gamebook version, there's ONLY 2 Objects ( 'game' and 'player' ) for your use (for examples):

game.strength = 50
or
player.strength = 50

Attributes will NOT be displayed~shown UNLESS you add them as STATUS ATTRIBUTES also, or as a Command's scripting

STATUS ATTRIBUTES only exist upon~for your 'game' Game Object or (default) 'player' Player Object or custom 'whatever' Player Objects (if you were using Text Adventure version).

---------

I'm not sure what the Online version is like compared to offline~desktop Text Adventure or Gamebook (offline or online) versions.

-----------

Quest Style Types:

Text Adventure style version: offline~desktop version or online~webpage version
or
Gamebook style version: offline~desktop version or online~webpage version

---------

quest resources:

http://docs.textadventures.co.uk/quest/
http://docs.textadventures.co.uk/quest/ ... ction.html
http://docs.textadventures.co.uk/quest/tutorial/
http://docs.textadventures.co.uk/quest/ ... ebook.html

Silver
You can make objects invisible. Then when the player performs an action you can run a script making the object visible, for example (like the player removes a plaster to find an alien implant or whatever).

714flame
Thank you two both for your advice.

I tried using the start script to setup an attribute, but when I try to modify that attribute in a later script, using game.sampleattribute = game.sampleattribute +1, I get this error: Error running script: Error compiling expression 'game.sanity + 1': ArithmeticElement: Operation 'Add' is not defined for types 'Object' and 'Int32'.

I'm intending for the attribute to be an int-type variable, so I'm not sure why I'm getting this error.

HegemonKhan
the infamous error...

what this error means is that you got your two things as different Attribute Types, and quest~computer can't comprehend:

for an example:

string + integer

(or as is your error: object + integer)

to quest: an integer is an actual amount
to quest: a string a merely a collection of characters~symbols
to quest: an object is a physical entity~thing within quest's game world (during game play, though it may be hidden to the peson playing the game, hehe, such as making 'storage or dumping' Objects~Rooms, aka 'data objects' as is used as a coding term by coders).

so, how do you (or quest), combine these two things ? both humans and quest~computers have absolutely no idea how to do this.

one of your things is an (Attribute Type: OBJECT) and the other thing is (Attribute Type: INTEGER)

or... your thing(s) doesn't exist, you never created the attribute~object~whatever

-------

I might have messed up.... my apologizes!

try using this as your script instead to create your initial Attribute's settings (it's name, type, and value):

http://docs.textadventures.co.uk/quest/scripts/set.html

set (object, string attribute name, any type value)

so for example:

set (player, strength, 0)

then, see if this script works:

player.strength = player.strength + 1

-------

or... try this as well...

http://docs.textadventures.co.uk/quest/ ... toint.html

http://docs.textadventures.co.uk/quest/ ... tring.html
http://docs.textadventures.co.uk/quest/ ... ouble.html

in your 'start' script:

(for example only)
player.strength_integer = ToInt (50)
or
game.strength_integer = ToInt (50)

vs (the reverse conversion)

player.strength_string = ToString (50)
or
game.strength_string = ToString (50)


---------------------

numbers (etc, -1, 0, 1, 1.4, etc) can be EITHER a String (the character symbol for~of that number) or an Integer (the physical amount of~for that number)

so we got the 'ToXXX' Scripts to convert between these two (three with double) attribute types:

(conceptually, not actual syntax)
Type:String = ToString (any Value: letters and~or numbers symbols~characters: alphanumeric)
Type:Integer = ToInt (a number symbol~character value only: numeric)
Type:Double = ToDouble (a number symbol~character value only: numeric)

---------------------

when you're using this script:

Object.Attribute = Value_or_Expression

there's a few special pre-defined values:

('ball' is just an example, you can use any collection of characters~symbols that you want)
Object.Attribute = ball // no quotes on ball, tells quest that this is Attribute Type: Object (aka an Object)
Object.Attribute = "ball" // quotes on ball, tells quest that this is Attribute Type: String (aka merely a collection of characters~symbols)

Object.Attribute = 5 // quest knows that numeric characters~symbols are integers, but as we both learned, you must SET the Attribute as being an integer (via either the 'set' script or via the 'ToInt' script), before this type of code line can work properly.

Object.Attribute = "5" // quotes on 5, tells quest that this is Attribute Type: String (aka merely a collection of characters~symbols)

Object.Attribute = true~false // 'true' or 'false' values, are understood as being boolean~flag values.

Object.Attribute = result // 'result' is a special default variable, which will be set to: 'result = your_input_or_choice' for the 'get input' and the 'show a menu' Scripts

and maybe there's a few more special value cases... meh.

------------------------

in the online version, do you have these windows~options in the GUI~Editor ??? :

http://docs.textadventures.co.uk/quest/ ... butes.html

as I'm not familiar with the online version (I've only used offline + Text Adventure)

HK edit... err nvm... the link tells me (unless it hasn't been updated yet) this already:

"Note: The attributes editor is currently only available in the Windows desktop version of Quest"

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums