Can scores change the end of the game?

Started by Gord10, Thu 11/09/2003 14:48:17

Previous topic - Next topic

Gord10

I want the main character's behaviors change the end of the game. If he always steal items, talk impolitely and irresponsibly; the game will end bad.
Can it be?
Games are art!
My horror game, Self

Ishmael

#1
Yes... script something like:

if (GetGlobalInt(200) < 100) {
NewRoom(201);
} else if (GetGlobalInt(200) < 130) {
NewRoom(202);
} else {
NewRoom(200);
}

This checks GlobalInt 200, which you can change during game with SetGlobalInt(200,newval); is under the given number, in order (so if between 100 and 130 the middle command is run).The game will go to specified room. In the rooms "Player enter screen" room interaction events you can set what happens. The GlobalInt and room numbers are just examples, so modify it to suit your need.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Gord10

#2
Thanx. But I want to ask you one more thing: Are 200, 130, 100 scores?
Games are art!
My horror game, Self

cornjob

In TK's example, you would use global integer #200 to store the score data. However, this can also be done by accessing the normal game.score variable like this:

if (game.score < 100) {
NewRoom(201);
} else if (game.score < 130) {
NewRoom(202);
} else {
NewRoom(200);
}

You can find a lot of interesting variables in the "text script global variables" section of the manual.

Gord10

Games are art!
My horror game, Self

SMF spam blocked by CleanTalk