iPhone App Directory
RPG Maker VX
 
Gallery Members Search Calendar Help


Welcome Guest ( Log In | Register )

Collapse

>Announcement

The 2nd Quarter Contest has arrived! Go check it out in the Community Announcements now!
 
Reply to this topicStart new topic
> [SOLVED] Always have the same sprite walking on the map, Even if not the party leader
TheDrifter
post Apr 15 2012, 10:34 PM
Post #1



Group Icon


Type: Designer
Alignment: True Neutral




Hi everyone,

When I remove the main character from my party, the sprite walking on the map changes, and I don't want that.

I want the character on the map to always be the same, even if he's not in my party.
But I'd also like to be able to change the graphic to "invisible" for cut-scenes where he shouldn't be there.

I need a script for this, because I can't just put the same graphic for every actor.
Their graphics must appear during battle, so they can't all be the same.

I use KGC_LargeParty

Thanks a lot!

Why I need this:
I don't want to have to "lock" the main character and force people to use him every battle, but I still want him to appear on the map.
In my project, you should be able to switch characters even during battle, just like in Final Fantasy X.

This post has been edited by TheDrifter: Apr 16 2012, 05:09 PM
Go to the top of the page
 
+Quote Post
   
Zarby
post Apr 16 2012, 11:53 AM
Post #2



Group Icon


Type: Coder
Alignment: Neutral Good




Hi, in the "Game Player" script search that :
CODE
  def refresh
    if $game_party.members.size == 0
      @character_name = ""
      @character_index = 0
    else
      actor = $game_party.members[0]   # Get front actor
      @character_name = actor.character_name
      @character_index = actor.character_index
    end
  end


and just change it for that :

CODE
  def refresh
    if $game_party.members.size == 0
      @character_name = ""
      @character_index = 0
    else
      @character_name = "filename" # The filename of your character ex : Actor1 inside the " " (for default)
      @character_index = 0 # The index of the character ex : 0 (for default)
    end
  end


--------------------

I am french then sorry if you dont understand correctly what i write :P
Go to the top of the page
 
+Quote Post
   
TheDrifter
post Apr 16 2012, 04:55 PM
Post #3



Group Icon


Type: Designer
Alignment: True Neutral




QUOTE (Zarby @ Apr 16 2012, 11:53 AM) *
Hi, in the "Game Player" script search that :
CODE
  def refresh
    if $game_party.members.size == 0
      @character_name = ""
      @character_index = 0
    else
      actor = $game_party.members[0]   # Get front actor
      @character_name = actor.character_name
      @character_index = actor.character_index
    end
  end


and just change it for that :

CODE
  def refresh
    if $game_party.members.size == 0
      @character_name = ""
      @character_index = 0
    else
      @character_name = "filename" # The filename of your character ex : Actor1 inside the " " (for default)
      @character_index = 0 # The index of the character ex : 0 (for default)
    end
  end


Thank you very much, kind sir.

That helps a lot! However, I still need to be able to change the graphic mid-game...

Is there a way I can do that with events?
Go to the top of the page
 
+Quote Post
   
Zarby
post Apr 16 2012, 05:00 PM
Post #4



Group Icon


Type: Coder
Alignment: Neutral Good




you can use a condition like this :

CODE
  def refresh
    if $game_party.members.size == 0
      @character_name = ""
      @character_index = 0
    else
      if $game_switches[IDOFTHESWITCHYOUWANT] == true
      @character_name = "filename" # The filename of your character ex : Actor1 inside the " " (for default)
      @character_index = 0 # The index of the character ex : 0 (for default)
       end
    end
  end


juste replace the IDOFTHESWITCHYOUWANT by the id of the switch you want tongue.gif lol, when the switch is on your character is always the character you setted, if it off you can change the appearance or the other group member can be leader too

This post has been edited by Zarby: Apr 16 2012, 05:00 PM


--------------------

I am french then sorry if you dont understand correctly what i write :P
Go to the top of the page
 
+Quote Post
   
TheDrifter
post Apr 16 2012, 05:09 PM
Post #5



Group Icon


Type: Designer
Alignment: True Neutral




Thanks, that's awesome! Thank you for the quick reply and everything.

This issue is now [Solved].

This post has been edited by TheDrifter: Apr 16 2012, 05:13 PM
Go to the top of the page
 
+Quote Post
   
mithos
post Apr 19 2012, 04:23 PM
Post #6


Meowthos the zombie cat!!
Group Icon


Type: Coder
Alignment: Lawful Good




I know you put solved, but I just thought I'd post this, it's basically the same idea as Zarby's but I tweaked a couple of things:

First, it doesn't require changing the default scripts, you can just paste it in 'Materials'
Second, It uses the value of one game variable (you pick which one at the top of the script) to control which party memeber is displayed, you can just change the value of that variable in an event.

CODE
class Game_Player

DISPLAY_VARIABLE = 4         #Set this to the number of the game variable that will control the active character

def refresh
    if $game_party.members.size == 0
      @character_name = ""
      @character_index = 0
    else
      actor = $game_party.members[$game_variables[DISPLAY_VARIABLE]]
      @character_name = actor.character_name
      @character_index = actor.character_index
    end
end
end


Hope it's useful to ya wink.gif


--------------------
I've been away for a while. Here's my really quite old stuff
Spoiler:


If it's in one of my threads you can use it so long as you read this, and give me a link to any derivatives (i.e. works based off mine). Credit Mithos.
Full legal bit
(Click image for human-readable version :P )
My Stuff:
My Games:
Spoiler:

Story <60%> Mapping<20%> Art<80%> Scripts<97%> Database<50%>
The Legend of Zelda: Restoration of Time Story<20%> Mapping<0%> Art<2%> Scripts<70%> Database<0%>
Absolute Power Story<21%> Mapping<0%> Art<2%> Scripts<0%> Database<0%>

My Sprites:
My Scripts:
I support:
Spoiler:





Go to the top of the page
 
+Quote Post
   
TheDrifter
post Dec 12 2012, 02:56 AM
Post #7



Group Icon


Type: Designer
Alignment: True Neutral




QUOTE (mithos @ Apr 19 2012, 04:23 PM) *
I know you put solved, but I just thought I'd post this, it's basically the same idea as Zarby's but I tweaked a couple of things:

First, it doesn't require changing the default scripts, you can just paste it in 'Materials'
Second, It uses the value of one game variable (you pick which one at the top of the script) to control which party memeber is displayed, you can just change the value of that variable in an event.

CODE
class Game_Player

DISPLAY_VARIABLE = 4         #Set this to the number of the game variable that will control the active character

def refresh
    if $game_party.members.size == 0
      @character_name = ""
      @character_index = 0
    else
      actor = $game_party.members[$game_variables[DISPLAY_VARIABLE]]
      @character_name = actor.character_name
      @character_index = actor.character_index
    end
end
end


Hope it's useful to ya wink.gif


Thank you very much. I kinda moved to VX Ace since then, but I still work on my previous VX project from time to time, so this is still useful.
Go to the top of the page
 
+Quote Post
   

Fast ReplyReply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 21st April 2014 - 01:50 PM

RPGMakerVX.net is an Privacy Policy, Legal.