Manual Leader Control
Version: 1.0
Author: modern algebra
Date: March 13, 2011
Version History
- <Version 1.0> 03.13.2011 - Original Release
Description
This script allows you to override the default fact that the lead actor in the party is the one shown on the map and instead control it by setting an in-game variable to the ID of the actor you want. This makes it useful for games where you either don't want the main character to be in battles or where you have a party organization screen and always want the main character showing.
Features
- Allows you to represent the party on the map with an actor who isn't the lead actor in the party
- Easy to use and controlled by a single in-game variable
Instructions
Paste this script into its own slot in the script editor, above Main but below Materials. For instructions on use, see the header.
Script
#==============================================================================
# Manual Leader Control
# Version: 1.0
# Author: modern algebra (rmrk.net)
# Date: March 13, 2011
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
#
# This script allows you to override the default fact that the lead actor in
# the party is the one shown on the map and instead control it by setting an
# in-game variable to the ID of the actor you want. This makes it useful for
# games where you either don't want the main character to be in battles or
# where you have a party organization screen and always want the main
# character showing.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Instructions:
#
# Paste this script into its own slot above Main and below Materials in the
# script editor.
#
# To set which in-game variable controls this script, simply go down to line
# 32 and change it to the ID of the variable you want. By default, it is 1,
# which means that changing the value of the first in-game variable will
# change which actor is shown. If the variable's value is 0 or does not refer
# to an existing actor, then it will go back to the default of showing the
# lead actor.
#==============================================================================
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# EDITABLE REGION
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
LEAD_CHARACTER_VAR_ID = 1 # For description, see instructions at line 21.
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# END EDITABLE REGION
#//////////////////////////////////////////////////////////////////////////////
#==============================================================================
# ** Game Player
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - refresh
#==============================================================================
class Game_Player
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Refresh
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias marvx52_mnldr_refrs_4gb7 refresh
def refresh (*args, &block)
actor = $game_actors[$game_variables[LEAD_CHARACTER_VAR_ID]]
if actor.nil?
marvx52_mnldr_refrs_4gb7 (*args, &block)
else
@character_name = actor.character_name
@character_index = actor.character_index
end
end
end
#==============================================================================
# ** Game Variables
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - []=
#==============================================================================
class Game_Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Set Variable
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias marv52_manlead_setvar_6tc2 []=
def []=(variable_id, *args)
marv52_manlead_setvar_6tc2 (variable_id, *args)
$game_player.refresh if variable_id == LEAD_CHARACTER_VAR_ID
end
end
Credit
Thanks
- RPGMakerVX52, for the request
Support
Please post in this topic at RMRK.net if you encounter any problems with this script or have any suggestions for improvement.
Known Compatibility Issues
No currently known compatibility issues, though it won't work well with Caterpillar scripts. If you put it below the caterpillar, then this script will still work, but I would assume that it won't show the first actor in the party as a follower. It will also override scripts like No Zombie Leaders if placed under it.