Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Lives system

Hi...first of all im spanish so sorry for the bad english
i want a lives sistem so if you die you will appear in town x(depending on where you lose)  but if you die 5 times you will loose(game over)
The script must be for RPG Maker  http://www.rmxp.org/forums/Themes/aqua/ ... t/rmxp.gif[/img] and must work whitout the SDK(because i have other scripts that aren´t compatible)

and a question:is it posible to make a chess game system?
 
You need to specify more here. What would you like the lives to effect? What battle system are you using, I mean admittedly it could be a simple matter of a variable and common event. If you really want a script, it could I think be scripted quickly. Here is a simple plan of what you need:

Upon death:
Variable+1
IF varibable >= 5
      Game over
Else
screen tone black, 0 frames,
teleport to: (map id, x, y)
screen tone normal, 20 frames,
wait 20.
end

As a side note, you'd probably want something in your menu telling you how many lives you have left, maybe a picture on screen if you're using an ABS.

Also, this would have to effect the save and load scripts also unless you dont intend to save the game, because if these wernt modified, a person could die 4 times, save, restart the game and have 5 lives again.

Hope this helps :)

Edit: I beat you panda :p

Edit 2: I just noticed the question about the chess system. I believe it has been done. But without a computer AI. If I remember correctly, a person did it, then took it one step further with games consisting of stranger pieces than the standard king, queen, bishop, knight, rook and pawns.
 
I just want  this script i´ve found but whitout the SDK-if you want to test it put $game_party.lives += 1 or $game_party.lives -= 1 oh... and forget about the chess, it would be very complex
Code:
#==============================================================================
# ** Lives System
#------------------------------------------------------------------------------
# Constance
# Version: 1.0
# 8.9.06
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Lives System', 'Constance', 1.0, '8.9.06')

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Lives System') == true

#==============================================================================
# ** Game Party
#==============================================================================

class Game_Party
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor  :lives
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias con_livessystem_gameactor_init initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Orginal Initialization Method
    con_livessystem_gameactor_init
    # Default Lives
    @lives = 3

  end
  #--------------------------------------------------------------------------
  # * Add Lives
  #--------------------------------------------------------------------------
  def add_lives(n)
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Sets n value
    $game_party.lives += n
  end
  #--------------------------------------------------------------------------
  # * Remove Lives
  #--------------------------------------------------------------------------
  def remove_lives(n)
    # Play cancel SE
    $game_system.se_play($data_system.cancel_se)
    # Sets n value
    $game_party.lives -= n
  end
end

#==============================================================================
# ** Window Lives
#==============================================================================

class Window_Lives < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 416, 250, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 160
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    cx = contents.text_size($game_party.lives.to_s).width
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 120-cx-2, 32, 'You have: ', 2)
    self.contents.draw_text(114-cx, 0, 120-cx-2, 32, "#{$game_party.lives}" + ' lives left.', 2)
    # Checks If Lives is set to 1
    case $game_party.lives
    when 0
    self.contents.clear
      self.contents.draw_text(4, 0, 120-cx-2, 32, 'You have: ', 2)
      self.contents.draw_text(114-cx, 0, 120-cx-2, 32, "no" + ' lives left.', 2)
    when 1
    self.contents.clear
      self.contents.draw_text(4, 0, 120-cx-2, 32, 'You have: ', 2)
      self.contents.draw_text(94-cx, 0, 120-cx-2, 32, "#{$game_party.lives}" + ' life left.', 2)
    end
  end
  #--------------------------------------------------------------------------
  # * Update
  #--------------------------------------------------------------------------
  #def update

  #end
end

#==============================================================================
# ** Interpreter (part 7)
#==============================================================================

class Interpreter
  #--------------------------------------------------------------------------
  # * Game Over
  #--------------------------------------------------------------------------
  def command_353
    # Play cancel SE
    $game_system.se_play($data_system.cancel_se)
    # Set Local Variable Value
    $game_party.lives -= 1
  end
end

#==============================================================================
# ** Scene Map
#==============================================================================

class Scene_Map
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias con_livessystem_scenemap_main main
  alias con_livessystem_scenemap_update update
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Set Wait Count
    @wait_count = 15
    # Set Phase for Trigger
    @phase = 2
    # Set Window Lives
    @window_lives = Window_Lives.new
    # Call Original Method
    con_livessystem_scenemap_main
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Updates Window Lives
    @window_lives.update
    # Refresh Window Lives
    @window_lives.refresh
    # Call Original Method
    con_livessystem_scenemap_update
    # Check Wait Count for 0 Lives and Call Gameover Flag
    case $game_party.lives
    when 0
      # Decrease Wait Count
      @wait_count -= 1
      # If Wait Count is 8
      if @wait_count <= 8
      # Prepare for transition
      Graphics.freeze
        # If Wait Count is 0
        if @wait_count <= 0
          # Set game over flag
          $game_temp.gameover = true
          # Return true
          return true
        end
      end
    end
  end
end

#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
 

Aeioe

Member

Yes, if someone could remove the SDK requirement from this I would like to use it as well. (I can't use the SDK because some of my scripts wont work for it)

Salutations,
Aeioe
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top