attributes
Tim the Squid
06 Nov 2015, 21:56Hi, I'm a new quest user and I want to give my player character money to start off with and use money throughout the game. I'm using the online version and there isn't much out there about using/making attributes online, so I was wondering if someone could give me a hand? I'm not that experienced in using codes, sorry.
Thanks.
Thanks.
HegemonKhan
07 Nov 2015, 03:06set your first Page to be Page Type: [script] or [script+text]
then, follow this, for the scripts that you add to your first page:
http://docs.textadventures.co.uk/quest/ ... ation.html
and, here is a question+answer on it too:
http://docs.textadventures.co.uk/ifansw ... track.html
^^^^^
http://docs.textadventures.co.uk/ifansw ... stats.html
-----------
and here's my guide on the basics of game-making with quest:
viewtopic.php?f=18&t=5559
-----------
let me know if you need help with anything.
---------
HK EDIT: ack, I did it again, confusing online with Gamebook, arg... let me know if you're still stuck...
then, follow this, for the scripts that you add to your first page:
http://docs.textadventures.co.uk/quest/ ... ation.html
and, here is a question+answer on it too:
http://docs.textadventures.co.uk/ifansw ... track.html
^^^^^
http://docs.textadventures.co.uk/ifansw ... stats.html
-----------
and here's my guide on the basics of game-making with quest:
viewtopic.php?f=18&t=5559
-----------
let me know if you need help with anything.
---------
HK EDIT: ack, I did it again, confusing online with Gamebook, arg... let me know if you're still stuck...
The Pixie
07 Nov 2015, 18:54The basic tool here is to add a script that sets the value.
To give a starting value, say 100, go to the game object, click on the Start tab, then click on Add new script. Then select: Variables: Set a variable of attribute. Type into the boxes, so it looks like this:
[Set variable] player.money = [expression] 100
The player.money bit is the attribute HK is talking about; it is called "money" and belongs to the player. To change the money, let us say to remove 25, go to the appropriate script (easy for me to say, but it depends why the player is losing £25), and click on Add new script, then again you select: Variables: Set a variable of attribute. this time you want to put in this:
[Set variable] player.money = [expression] player.money - 25
... because the the new value for the money will be 25 less than it was.
To give a starting value, say 100, go to the game object, click on the Start tab, then click on Add new script. Then select: Variables: Set a variable of attribute. Type into the boxes, so it looks like this:
[Set variable] player.money = [expression] 100
The player.money bit is the attribute HK is talking about; it is called "money" and belongs to the player. To change the money, let us say to remove 25, go to the appropriate script (easy for me to say, but it depends why the player is losing £25), and click on Add new script, then again you select: Variables: Set a variable of attribute. this time you want to put in this:
[Set variable] player.money = [expression] player.money - 25
... because the the new value for the money will be 25 less than it was.
Tim the Squid
07 Nov 2015, 23:32Thanks! Everyone has been so helpful!