RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Manual Leader Control

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
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


Code: [Select]
#==============================================================================
#    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.
« Last Edit: April 10, 2011, 02:33:57 AM by modern algebra »

***
Rep:
Level 74
I'm baaack!
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
« Last Edit: March 16, 2011, 12:44:00 AM by RPGMakerVX52 »

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
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

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
10 minutes, + 15 to add all the instructions and comments.

***
Rep:
Level 74
I'm baaack!
i don't want the topic to die...

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Script topics never die.

***
Rep:
Level 74
I'm baaack!
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

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
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

***
Rep:
Level 74
I'm baaack!
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.

****
Rep:
Level 76
Praise the Sun (Arcana)
GIAW 14: 1st Place (Hard Mode)
Is there a way to activate and deactivate the script?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Yeah, you set the variable to 0.

***
Rep:
Level 74
I'm baaack!
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  :-[)

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
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.

***
Rep:
Level 74
I'm baaack!
i didn't think of that! Thanks for your help!


EDIT: It's been exactley 1 month...   :D
« Last Edit: May 15, 2011, 09:05:00 PM by RPGMakerVX52 »