How do I end the game?
From OHRRPGCE-Wiki
How do you make it so when the player completes your game, the game ends?
The best way to do this is with a plotscript. You will probably want a plotscript anyway for making the ending sequence. To end the game, just use the plotscripting command game over. Note that there are 3 different ends.
# The game can end because you have just lost.(no more life points)
To make this kind of end, one of the most easy and efficient way is to make a game over script which includes a backdrop with "game over" on it and launch an ambient music that makes the player he has lost the game.
#Player loses the game
script, game is over, begin
suspend npcs
suspend player
play song (song:game over)
show backdrop (2)
game over
resume npcs
resume player
end
# The game can also end because the version of the game is finished and the programmer has still not finished and you shall check for a further version of the game.
The best way to include this script is to make it launch in a autorun script of the map in which the hero is supposed to go next. This way you are sure the player knows he has completed the version and should not try to go forward anylonger.
#Player finished the demo version
script, demo version ends, begin
suspend npcs
suspend player
stop song # attracts player attention. Something important happens.
show text box (45) # This already the ends of the version of the game! A new one will be soon avialable. Check at ...
wait for text box
game over
resume npcs
resume player
end
- The games ends because it's the real end and the game has to finish someday.
(It happens generally after you have beaten the final boss.) For this kind of end, it is highly recommended to use plotscripting because you may need npc manipulation and backdrops.
# Player ends game
script, game ends, begin
suspend npcs
suspend player
play song (song:game is won)
show text box (14) (# )
wait for for text box
walk npc (4, 5, 7)
wait for npc (4)
walk hero (me, 4, 6)
wait for hero
game over
resume npcs
resume player
end
Note that it is perfectly possible to let understand that a new game will be created showing a backdrop or a text box with "To be continued" just before the line with "game over" in it.
For more info on plotscripting, see the Plotscripting Tutorial or the Dictionary of Plotscripting Commands
# An end without using plotscripting? If you don't want to use plotscripting, another simpler way is to make a text box that says "Game Over" and link it to itself (using the Next box: property in the text box editor). This method does not automatically return the player to the title screen, they still have to pick "Quit" from the menu manually, but it is nice and simple, and makes it abundantly clear to the player that they have won the game.
Note that just before the player returns to the title screen the player will see the hero on the map.