Setting different counters

Dan The Man
(Just for the record, I am very new to this game, so please excuse my ridiculously noobish behaviour)

I have started creating a gamebook-type quest game, in which the player becomes a head of state of an important country.

Now, I wanted to set several invisisible score counters for a couple of factors, influenced solely by the actions you make in the game. One such attribute would (eg) be "PR", which you would start out at a count of -15 (because you are an unpopular politician), and another would be "Diplomacy", where you'd start out at score 3 (because your country is fairly popular in the world).
Now, during the game, you can increase or decrease either factor with your decision; one decision could for instance give you +2 Diplomacy, -1 PR, while yet another would mean +4 PR, -1 Diplomacy.
And depending on what your count in one (or both) factors is, certain events will or will not kick in at certain stages in the game, and different flavour texts (ie variables and attributes) with dot the story.

The problem is, I have no idea how to implement that. I tried looking into the tutorial, but I'm afraid it's a little too complex for me to comprehend at this stage (plus, it doesn't seem to treat the Gamebook-mode).

ps: I was probably looking to implement more than two counters. Does it matter?

I'm sure it's probably something very basic and easily answered, so can anyone of you guys help me out on this one?
Thanks a lot in advance!

HegemonKhan
while to you this seems like something simple and basic to do, it actually isn't in terms of implementing this. People think that because something is simple and basic, that it is just as simple and basic to implement within a game, when it actually isn't. Even some of the simplest features (such as changing stats, dialogue, equipment, combat, and etc) can be extremely complex in terms of coding (or using the GUI~Editor for it).

so, you're asking for help with something that is probably too much for you to take on at the moment, but here we go anyways..

some links:

http://docs.textadventures.co.uk/quest/
http://docs.textadventures.co.uk/quest/tutorial/
http://docs.textadventures.co.uk/quest/ ... ebook.html
http://docs.textadventures.co.uk/quest/scripts/set.html
http://docs.textadventures.co.uk/quest/ ... _menu.html
http://docs.textadventures.co.uk/quest/ ... _menu.html
http://docs.textadventures.co.uk/quest/ ... ation.html
http://docs.textadventures.co.uk/quest/ ... split.html
http://docs.textadventures.co.uk/quest/ ... witch.html
http://docs.textadventures.co.uk/quest/ ... lists.html
http://docs.textadventures.co.uk/quest/scripts/if.html
http://docs.textadventures.co.uk/quest/ ... input.html

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

there's two parts to this:

Part 1:

initial creation~setting~adding of your Integer Attributes

Part 2:

alteration~resetting~changing of your Integer Attributes as various game events happen, via scripting (using scripts)

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

I'm not that familiar with GameBooks... so I may not be of help to you, but I'll try anyways, hehe

I believe with the Gamebook, you can change your very first 'page' as we'll be using this to set our initial Integer Attributes (your 'PR~Public Relations', 'Diplomacy', 'Scandals' ~ hehe, 'charisma', and etc), so choose for it to be either just 'scripts' or text+scripts'

for the scripts, you want to do choose this:

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

this is our base~general structure for everything: Object_name.Attribute_name = Value_or_Expression

you only have two Objects with Gamebook: 'game' and 'player'

so you want to write it in, so it looks like this (I'm using my own labeling convention):

(the equals is already forced~placed, so just write in the stuff to the left of the equals, to the left of the equals, and the stuff to the right of the equals, to the right of the equals, you want it to look exactly like the below)

player.public_relations_integer = -15
or:
game.public_relations = -15

and repeat (add a script -> variables -> set a variable or attribute) for your other Integer Attributes:

player.diplomacy_integer = 3

examples of more Integer Attributes (and different labeling conventions, you don't have to use mine, lol):
player.charisma_integer = 20
player.charisma = 20
player.integerCharisma = 20
player.scandals = 100
player.truthmeter = 0
// etc etc etc

this was part 1, creation of your initial integer attributes, your starting stats

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

now... when we want to alter~adjust them, such as after game events... (any action you want done uses scripts):

for an example, for page2:

change it to be 'text+scripts'

add in the text that you want to set up an event with a decision to make

and now for your scripts (again, this is a single example only):

run as script -> add a script -> output -> Print a message -> [MESSAGE] -> What is your decision?
add a script -> output -> show menu -> message~question: Red or Blue?, options~choices: split ("red;blue", ";"), cancel'able: false
-> add a script -> scripts -> if -> [EXPRESSION] -> result = "red"
->-> then, add a script -> variables -> set a variable or attribute -> player.public_relations_integer = player.public_relations_integer + 4
->-> add a script -> variables -> set a variable or attribute -> player.public_relations_integer = player.diplomacy_integer + 7
-> else if -> add a script -> scripts -> if -> [EXPRESSION] -> result = "blue"
->-> then, add a script -> variables -> set a variable or attribute -> player.public_relations_integer = player.public_relations_integer - 3
->-> add a script -> variables -> set a variable or attribute -> player.public_relations_integer = player.diplomacy_integer - 1

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

you might want to first work with the 'Text Adventure', going through the tutorial for it, to get an understanding of how quest works, how to do things in quest, getting the 'if' and 'code' logic mindset~mentality~thinking brain training, this takes time, lol, and etc...

then go back to 'GameBook', now that you have a basic understanding of how quest, scripts, and 'if' logic works.

jaynabonne
Dan, assuming this is the same game we discussed before, you're already using attributes for the various strings you're using. You can just use integer values as well and add and subtract from them in script.

And you can use the text processor to put in conditional text. (Not too hard, I think! :) )

Dan The Man
Okay guys, thanks a lot for everything again! :wink:

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

Support

Forums