Multiple endings?

E.Z. Play

I've been considering multiple endings for a planned game, if not the current game I'm working on.

I want it to be based on points where if you have a certain amount of points out of a number you get a different ending. Say, you manage to earn between 51 and 75 points you would get one ending, but if you were to earn between 26 and 50 points you would get a different ending. However, I can't find anything within the program (desktop version) that will allow me to do this. This is a trial and error game, where doing certain things affects your score and health, so this is crucial. You can't have score or health if you're making a gamebook (which needs to be added if this program gets another update.), so I've already had to resort to a modified text adventure.

If there is no possible way to base an event on points, ending or not, then this needs to be added.


hegemonkhan

this can be done for a Game Book (which of means also for a Text Adventure), but the Game Book only has scripting (for Attribute creation and usage), whereas the Text Adventure also has the nice/convenient GUI/Editor (for those who're not comfortable with scripting/coding).

the scripting is the same between a Text Adventure and Game Book, only how you can access the scripting is different between them (the Game Book is more limited)

Also, the Text Adventure has unlimited Objects for your Attributes, whereas, the Game Book only has two:

  1. the 'player' Player Object
  2. the 'game' special Game Settings Object

so, for the Game Book, your Attributes have to be like this:

game.NAME_OF_ATTRIBUTE
and/or
game.NAME_OF_ATTRIBUTE = VALUE_OR_EXPRESSION

and/or

player.NAME_OF_ATTRIBUTE
and/or
player.NAME_OF_ATTRIBUTE = VALUE_OR_EXPRESSION


so, you need to learn the 'bread and butter' of coding / game making: Attribute and the 'if' Script usage:

(these are on Text Adventure, so some things aren't found within the Game Book, such as the 'statusattributes' feature, but the scripting is the same)

http://textadventures.co.uk/forum/samples/topic/5559/attributes-and-if-script-guide-by-hk
http://textadventures.co.uk/forum/quest/topic/5387/i-really-need-help (this is a step by step walkthrough guide demo game on basic Attribute usage for the Text Adventure)

or

https://textadventures.co.uk/forum/samples/topic/5559/attributes-and-if-script-guide-by-hk
https://textadventures.co.uk/forum/quest/topic/5387/i-really-need-help (this is a step by step walkthrough guide demo game on basic Attribute usage for the Text Adventure)


to access the scripting via the Game Book:

'NAME_OF_PAGE' Page Object -> 'Page' Tab -> Page Type: [script] or [script+text] -> scripting (set it up, see the links above)

a good idea is to use your first page (determined by having your 'player' Player Object being within that page) to create/add/set-up your Attributes and their (initial/starting) Values, then you use other pages to use (including changing their values) them to do whatever actions/events you want

this 'use of first page' for your 'character creation / Attribute creation/initial-setup', is similar to using the Text Adventure's 'game' special Game Settings Object's 'start' Script Attribute for the same thing


and this is somewhat the idea/concept of coding that you want with/for your scripting for your endings:

http://textadventures.co.uk/forum/quest/topic/liesbkx4iugwnh6g4_fivw/exit-question-unsolved-again#0f4bae44-3ce7-4ba0-80cc-54b55c89c842
or
https://textadventures.co.uk/forum/quest/topic/liesbkx4iugwnh6g4_fivw/exit-question-unsolved-again#0f4bae44-3ce7-4ba0-80cc-54b55c89c842


DarkLizerd

Sounds more like you have a "grading" system...
A room, after the last room, of your game, could have multiple exits, but only show the one for your score range...

(Let me check what I come up with...)


hegemonkhan

the 'grading' system is the same as multiple endings (same code logic/structure), I was hoping he/she could just look at it and apply it, but here's how it'd be applied:

'YOUR_PAGE_1' Page Object's scripting:

game.score_integer_attribute = 0 // creating our 'score' Integer Attribute and it's initial Value, so that we can then have/use this Integer Attribute for whatever we want/need with the rest of the game, as it now exists, having been created.
// goto 'YOUR_PAGE_2' Page Object

// ----------------------------------

a lame/simple-quick/poor-bad example of using your 'score' Attribute:

'YOUR_PAGE_2' Page Object's scripting:

// optional: introduction for your game play/story/plot (your first actual game-playing page)
msg ("goto page 3 if you want +50 score, or goto page 4 if you want +100 score")
// goto 'YOUR_PAGE_3' Page Object
// or
// goto 'YOUR_PAGE_4' Page Object

'YOUR_PAGE_3' Page Object's scripting:

game.score_integer_attribute = game.score_integer_attribute + 50 // game.score_integer_attribute (new) = (old: 0) + 50 = 50
// goto 'YOUR_ENDING_PAGE' Page Object

'YOUR_PAGE_4' Page Object's scripting:

game.score_integer_attribute = game.score_integer_attribute + 100 // game.score_integer_attribute (new) = (old: 0) + 100 = 100
// goto 'YOUR_ENDING_PAGE' Page Object

// -----------------------------------------------------

'YOUR_ENDING_PAGE' Page Object's scripting:

(for this example, I got 5 endings as I used, aka copy-pasted, the 'A to F school grading system' lol, but you can do whatever amount of conditions/results you want, as well as the score ranges values too)

if (game.score_integer_attribute > 89) {
  // ending 1 scripting
} else if (game.score_integer_attribute > 79) {
  // ending 2 scripting
} else if (game.score_integer_attribute > 69) {
  // ending 3 scripting
} else if (game.score_integer_attribute > 59) {
  // ending 4 scripting
} else {
  // ending 5 scripting
}

DarkLizerd

Oh, well...
Someone else is so much quicker than me, that they already had the answer BEFORE the question was asked...


hegemonkhan

learn and use quest's coding for 5 years and you'll be jsut as fast with how to script/code stuff in quest, laughs.

You probably understand Game Book structure better than I, as it's similar to jumping code lines of Basic and the other early languages (and which includes Assembly language too, though I do like this proceedural stuff of jumping code lines, so I'm pretty good at it myself, as my brain operates like this, where I, and maybe you too, struggle with the more structural Object Oriented design/programming of higher level languages, argh - for me anyways, as I struggled with Data Structures... chained links and beyond, grr, whereas I had an easier time with Assemby once jay helped me with understanding it's code design/logic/structure)


Log in to post a reply.

Support

Forums