Save-Point
Lives System - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Archives (https://www.save-point.org/forum-105.html)
+--- Forum: Creation Asylum Archives (https://www.save-point.org/forum-90.html)
+---- Forum: Scripts & Code Snippets (https://www.save-point.org/forum-92.html)
+----- Forum: RPG Maker XP Code (https://www.save-point.org/forum-93.html)
+----- Thread: Lives System (/thread-6936.html)



Lives System - Constance - 08-10-2006

Lives System
by Constance
Version: 1.0
Aug 10 2006

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Introduction

A quick script I made before I forgot the idea. Just a simple lives system shown on your map. You can add lives and remove lives. Once it gets to 0, game over. You can even call the gameover command from an event, and the process will still be the same.

Features
  • Add Lives (multiple if you like)
  • Remove Lives (multiple if you like)
  • Call Gameover Command and process is still the same
  • After Battle process is still the same
  • Once you reach 0 lives, all looping will break itself, and therefore any commands you press will be invalid.
  • Set Default number of lives
  • Set "Gameover Level" (0 by default)
  • Show on map at all times
  • Have negative lives (don't know why you would want it though)


Script


The Script


Instructions

To install, simply copy and paste this above your Main Script. Be sure you also have the SDK latest version (1.5), as it is needed.

Adding Lives

To add a life, simply use this code in an event's script editor.

Code:
$game_party.add_lives(1)

or:


Code:
$game_party.lives += 1



Whichever one works for you.

You can change that number to whatever amount of lives you want to give a character.

Removing Lives

To remove a life you can use either one in an event's script editor.


Code:
$game_party.remove_lives(1)

or:


Code:
$game_party.lives -= 1




Replace the 1 with the number of lives you want removed.

You can also remove as an extra bonus use the Gameover command, and it will in fact remove 1 life for you.

Be sure when your calling a battle to make it a win/lose condition so that you may remove 1 life (if you want) in that battle.

FAQ

How do you increase the default lives?

At line 39. You can change it there.

How can I change the number my gameover screen will appear?

At lines 154 and 155 you will see this:


Code:
case $game_party.lives
when 0



Replace the 0 with the number you want to be the "gameover level".

Compatibility

SDK. That's it for now.

Credits and Thanks

My brain...I finally got the time to do a script. First one in a long time. But it was a spare of the moment before I forgot.

Author's Notes

More and better releases of this will be coming soon. Just sit tight. Enjoy.

~Constance