Gamebook: How to include a player's attributes/stats?

0 votes
75 views
asked Sep 6 in Authoring by Javalar (1 point)
retagged Sep 6 by Javalar

I just discovered "Quest" and the Interactive Fictions and I am basically a complete newbie to the whole system. So please forgive me this very simple question, but the help files on the "gamebook" type seem not to be very helpful for me. In fact, I still struggle with the most basic questions on how to include simple script. If somebody could show me a few basic steps, I'd be very, very grateful.
I have two questions for the moment.

1.) How do I include a player's attribute into the story?

Basically, I plan the following: I want to have an attribute like "Happiness". It can start on 0. (I am already thinking of maybe including a random starting stat, but that's for later). How do I establish this in the first place? Where do I have to click to include it and what do I have to define?

I want to have this attribute or stat to increase and decrease at certain occasions. Player experiences something nice = Happiness +1. And so on. At the moment I plan for this to be a hidden stat, but I don't mind if somebody can explain me how to make it visible.

2.) How can I make an attribute/stat influence the text being shown?

I am pretty sure it has something to do with the "IF" command, but again, I struggle with the simple basic questions: Say the player enters a certain place, and if his happiness is >5, I want to add text to the paragraph like "This is a beautiful place", whereas if his happiness is 0, the text should read "You feel depressed by the dark colours of this place."

Again, I apologize for these very basic questions, and if somebody can guide me to a link with a comprehensible explanation that's just as fine. I searched the Wiki and this site here though, and most texts and answers seem to be directed at people who already know a bit what they are doing. I seem to lack the main understanding of: What do I have to click and write where to put the basic system in place.
Thank you so much in advance! :)
System is Windows Vista, Quest is 5.6.1.

1 Answer

0 votes
answered Sep 6 by hegemonkhan (161 points)
edited Sep 6 by hegemonkhan

read this thread:

http://ifanswers.com/1091/using-gamebook-style-game-create-game-wide-variables-track

and also for more details into using Attributes, read this thread:

http://ifanswers.com/1141/online-version-quest-how-change-the-value-status-attributes

and also any of the links found within it too

if you have any questions or don't understand anything, ask away!, hehe :D


Randomization:

http://docs.textadventures.co.uk/quest/functions/corelibrary/diceroll.html
http://docs.textadventures.co.uk/quest/functions/getrandomint.html
http://docs.textadventures.co.uk/quest/functions/getrandomdouble.html
http://docs.textadventures.co.uk/quest/functions/corelibrary/randomchance.html


other useful links:

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

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

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

http://docs.textadventures.co.uk/quest/tutorial/
http://docs.textadventures.co.uk/quest/guides/
http://docs.textadventures.co.uk/quest/guides/character_creation.html
http://forum.textadventures.co.uk/viewforum.php?f=18&sid=b5d87e430462d5289c1e0464a4ed4fa4 (more guides: libraries and code samples)

http://docs.textadventures.co.uk/quest/elements/
http://docs.textadventures.co.uk/quest/types/ (Attributes)

http://docs.textadventures.co.uk/quest/scripts/
http://docs.textadventures.co.uk/quest/functions/ (categorical order)
http://docs.textadventures.co.uk/quest/functions/index_allfunctions.html (alphabetical order)

http://docs.textadventures.co.uk/quest/guides/using_lists.html
http://docs.textadventures.co.uk/quest/using_dictionaries.html
http://docs.textadventures.co.uk/quest/scripts/foreach.html
http://docs.textadventures.co.uk/quest/scripts/for.html
http://docs.textadventures.co.uk/quest/scopes.html
http://docs.textadventures.co.uk/quest/asl_requirements.html

etc etc etc

commented Sep 6 by hegemonkhan (161 points)
here's a link for creating a sample game you can test-play involving statusattributes:

http://forum.textadventures.co.uk/viewtopic.php?f=10&t=5387&hilit=statusattributes

--------

'statusattributes' is for the DISPLAYMENT of your Game Object's and~or Player Object's Attributes on the right side's status pane during game play. You can't display something that doesn't exist...

'attributes' creates your Attributes

it's a bit confusing at first between 'attributes' and 'statusattributes'
commented Sep 8 by Javalar (1 point)
Thank you very much for your help.

I had read the first link already, but from what I saw it covered the topic of gender and that was not what I had in mind. I realized now that it basically doesn't matter what type of attribute you tackle, because they can be defined differently along the String or Bolean, etc type.

So I did set up an attribute like "pain" via the "Set new script -> Set a variable or attribute.

player.pain = 0
game.pain = 100

I checked the other link for an example for statusattributes. The user who wanted to set up a "player.cash", where you mentiond that his initial setting is correct. I can't duplicate the initial setting though:

I found the script to add player.statusattributes to the dictionary.

dictionary add (player.statusattributes, "pain", "Pain" + player.pain)

But the user seems to have done something like [Set variable] player.statusattributes = [New String Dictionary] first.

I don't find this script anywhere, and I also don't find any example on how it would look like in code.
commented Oct 19 by Toris (1 point)
Same, as above, I don't get a New String Dictionary option.  Not sure how to get it in gamebook
This site is now closed.
As of 1st November 2015, this site is a read-only archive. For more information see the intfiction forum post

Welcome to IF Answers, a site for questions and answers about Interactive Fiction.

Technical questions about interactive fiction development tools such as Inform, Twine, Quest, QuestKit, Squiffy, Adrift, TADS etc. are all on-topic here.

Non-technical questions about interactive fiction are also on-topic. These questions could be about general IF design, specific games, entering the IF Comp etc.
...