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.

Player Swap Dead Actor

Player Swap Dead Actor
Version: 2.5
By: Kain Nobel

Introduction

Short and simple, if your lead character dies it'll swap to the next living character in their place.

Script

Code:
#===============================================================================

# ** Player : Swap Dead Actor

#===============================================================================

 

#-------------------------------------------------------------------------------

# * SDK Log

#-------------------------------------------------------------------------------

SDK.log('Player.SwapDeadActor', 'Kain Nobel ©', 2.5, '12.10.2008')

#-------------------------------------------------------------------------------

# * SDK Enabled Test : BEGIN

#-------------------------------------------------------------------------------

if SDK.enabled?('Player.SwapDeadActor')

  

#===============================================================================

# ** Scene_Map

#===============================================================================

 

class Scene_Map < SDK::Scene_Base

  #-----------------------------------------------------------------------------

  # * Alias Listings

  #-----------------------------------------------------------------------------

  alias_method :swap_dead_leader_scene_map_update, :update

  #-----------------------------------------------------------------------------

  # * Update

  #-----------------------------------------------------------------------------

  def update

    swap_dead_leader_scene_map_update

    unless $game_party.actors.empty?

      if ($game_party.actors[0].hp).zero?

        unless $game_party.all_dead?

          $game_party.actors << $game_party.actors.shift

          $game_player.refresh

        else ; $game_temp.gameover = true

        end

      end      

    end

  end

end

 

#-------------------------------------------------------------------------------

# * SDK Enabled Test : END

#-------------------------------------------------------------------------------

end

Instructions

The usual song 'n dance... place below 'Scene_Debug'/'SDK' if using and above 'main'

Compatibility

Should be compatible with almost anything, most likely to encounter some kinda conflict if you use a special party script which locks characters into a certain position in the party.

Author's Notes

If you need anything modified to work with your party script, you'll have to PM me because I'm not going to be watching this topic.

Terms and Conditions

Free to use in any game, I don't care if you credit me for this one.
 
Well... It sounded like a kickass idea until I saw the SDK requirement. If you could make a non-SDK version, I'm sure you'd get more popularity.
 
Barchetta":2di0vy28 said:
Well... It sounded like a kickass idea until I saw the SDK requirement. If you could make a non-SDK version, I'm sure you'd get more popularity.
Perhaps it will work by removing SDK log/check lines.(beware alias_method)
 
Well I haven't setup my game to include the next set of characters in my menu so I won't be messign with this just yet. I still have around thirty other scripts to fully configure on my game, anyway.

I'll give it a look-over tomorrow and give some feedback.
 

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