Main Menu
  • Welcome to The RPG Maker Resource Kit.

Manual Leader Control

Started by modern algebra, March 13, 2011, 08:58:52 PM

0 Members and 1 Guest are viewing this topic.

modern algebra

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




  • modern algebra

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.

Infinate X

#1
Thank you SOOOOO much for making this for me!!!!!! Here's something that looks like pac-man with the flu (for ur troubles):  :V

EDIT: I forgot to ask before but is it alright if I post this on another website and credit you for making it for me and I also made a crappy demo for when I was testing. Do you want it?

EDIT2: Lol next comment is by someone wholikes pac-man a lot (probably) and I put a pac-man ^ up there ;D

pacdiggity

I am Pac-man with the flu!
This is actually a very good idea for inactive actors. And I suppose that you could recreate the No Zombie Leaders with this script, by placing a parellel process common event that says that if the first actor is unconious or dead you change the variable so that it doesn't display him/her anymore. I could explain that more in-depth, if you want, but that's probably not nessacery.
How long did it take to script this, MA?
it's like a metaphor or something i don't know

modern algebra

10 minutes, + 15 to add all the instructions and comments.

Infinate X

i don't want the topic to die...

modern algebra


Infinate X

After 60 days most people wont reply because of the necropost warning and I didn't want that to happen to this awesome new script

pacdiggity

He means that you can post in script threads whenever, regardless of last post. People won't (and don't) refrain from posting in them. The same applies for recourse threads.
However, you might get yelled at if you have nothing important to say. If you say "dis script is relly good gaiz." after 2 years, people get mad.
Also, can you please make your sig smaller?
it's like a metaphor or something i don't know

Infinate X

Quote from: Welfare-Daddy Pacman on April 10, 2011, 02:08:17 AM
He means that you can post in script threads whenever, regardless of last post. People won't (and don't) refrain from posting in them. The same applies for recourse threads.
However, you might get yelled at if you have nothing important to say. If you say "dis script is relly good gaiz." after 2 years, people get mad.
Also, can you please make your sig smaller?

You can't get banned for necroposting? Well sorry for my sig but I can make the dog smaller.

hiromu656

Is there a way to activate and deactivate the script?

modern algebra

Yeah, you set the variable to 0.

Infinate X

I just remembered something!!!!!!!!


If you don't want the actor graphics to start as Party Member 1, is the only possibility to add the actors to your party after the variable is set? What that would do is make the illusion of your character being invisible for the first second of the game in which case not as many people would acknowledge it. (I couldn't remember how to spell acknowledge  :-[)

modern algebra

That's how you spell it. And a parallel process in the very first map should take care of it before you see the screen even for a second I would think. If not, then another option would be just to make the first actor in the party be the actor you want to lead, and then remove that actor from the party as soon as you set the variable. That way there wouldn't be any dissonance and it would be quick enough that the player could never visit the menu and see the fake actor there.

Infinate X

#13
i didn't think of that! Thanks for your help!


EDIT: It's been exactley 1 month...   :D