Swapping actors in battle.

twsauthor

Villager
Member
Joined
Aug 17, 2013
Messages
20
Reaction score
1
First Language
English
Primarily Uses
Let's see if I can explain this right.

First off, this is 100% about aesthetics.

Second, I apologize if this can be done without any scripting and is in the wrong forum.

Situation:

I've got a character that summons a monster to take their place through a common event that simply removes the summoner and adds the monster until releasing it or battle ends.

The problem:

If i have any actors in the party below the summoner, the monster gets summoned to the last position in the formation, causing the other actors to shift their positions. Instead of into whatever position the summoner was in, which is what I want. Not really an issue until the monster disappears and the summoner returns.

I've found a few scripts like Yanfy's http://yanflychannel.wordpress.com/rmvxa/core-scripts/party-system/ or Tsukihime's http://xtsukihime.wordpress.com/2013/01/29/free-formation/.

I'm trying my best to avoid locking the formation in any way, which takes away some of the players control.

1.jpg

starting positions.

2.jpg

positions after monster summoned.

3.jpg

positions after monster leaves.

The request:

Is there anyway I can store the summoner's position in the formation and use it to set the monster's position when summoned and vice versa?

this will prevent players from having to reorder the formation after every battle they summon in.
 

Yato

(aka Racheal)
Veteran
Joined
Mar 17, 2012
Messages
825
Reaction score
346
Primarily Uses
To set a new actor's position in the party, you're going to need to use a small script.

Code:
class Game_Party < Game_Unit  #--------------------------------------------------------------------------  # * Change Members  #--------------------------------------------------------------------------  def swap_members(id1, id2)    i = @actors.index(id1)    @actors[i] = id2 unless @actors.include?(id2) or i == nil    $game_player.refresh    $game_map.need_refresh = true  endend
To use this, just make a script call of $game_party.swap_members(id1, id2) in your common event to swap the members using their IDs (their number on the Actors tab). It won't do anything if id1 isn't in the party or id2 is in the party.
 
Last edited by a moderator:

twsauthor

Villager
Member
Joined
Aug 17, 2013
Messages
20
Reaction score
1
First Language
English
Primarily Uses
Thank you! That worked out great.  I do have an add-on request if possible. 

Can you add the option to initialize id2 when swapping that actor in?

i have it set up so the summoned monster's initialized level gets increased by a variable each time its summoned.

I appreciate the help! :D
 

Yato

(aka Racheal)
Veteran
Joined
Mar 17, 2012
Messages
825
Reaction score
346
Primarily Uses
Easy enough

Code:
class Game_Party < Game_Unit  #--------------------------------------------------------------------------  # * Change Members  #--------------------------------------------------------------------------  def swap_members(id1, id2, init = false)    $game_actors[id2].setup(id2) if init    i = @actors.index(id1)    @actors[i] = id2 unless @actors.include?(id2) or i == nil    $game_player.refresh    $game_map.need_refresh = true  endend
The script call becomes $game_party.swap_members(id1, id2, true) when you want id2 to be initialized. You can either leave it the same as before or change true to false when you don't want them initialized.
 

twsauthor

Villager
Member
Joined
Aug 17, 2013
Messages
20
Reaction score
1
First Language
English
Primarily Uses
Thank you again.  This has streamlined of an entire class for my game and will give me the ability to make a few new skills when i have the time.
 

ShinGamix

DS Style 4Ever!
Veteran
Joined
Mar 18, 2012
Messages
3,905
Reaction score
451
First Language
April Fools
Primarily Uses
N/A
What if I wanted to make this a in battle option?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,081
Members
137,582
Latest member
Spartacraft
Top