Tsukihime

Rotate Formation

28 posts in this topic

Rotate Formation

-Tsukihime

 

Rotate the formation of your battle members one position to the left on the map.

 

Download

 

Script: Download here

 

Usage

 

Press "A" and "S" to rotate members left or right

You can configure this keys in the script

 

Suppose you had 3 actors in your party

 

[A, B, C]
When you press A, the formation will rotate left by one position, resulting in

 

[B, C, A]
This only applies to battle members so if you only had 4 battle members, but 6 actors in your party, the last 2 would not move

 

[A, B, C, D, E, F] ==> [B, C, D, A, E, F]
Screenshots

 

rotate_form1.jpg

 

Press rotate key. Notice my formation changed:

 

rotate_form2.jpg

Edited by Tsukihime
Jinjo, randomstranger and tiagoms like this

Share this post


Link to post
Share on other sites

I really liked it, thanks for the script :)

One question: it's possible to have 2 keys for the rotation? I mean, one key for rotate to the right, and one for the left.

Share this post


Link to post
Share on other sites

So I guess you won't be giving Tomoaky credit for this one http://hikimoki.sakura.ne.jp/rgss3/script_map.html'>http://hikimoki.sakura.ne.jp/rgss3/script_map.html Even though he scripted this function over 10 months ago..

 

#==============================================================================

# ★ RGSS3_マップã§ä¸¦ã³é †å¤‰æ›´ Ver1.01

#==============================================================================

=begin

 

作者:tomoaky

webサイト:ã²ãも記 (http://hikimoki.sakura.ne.jp/)

 

マップシーンã§ã‚‚Lã¨ï¼²ãƒœã‚¿ãƒ³ï¼ˆåˆæœŸè¨­å®šã§ã¯ Q 㨠W)ã§ä¸¦ã³é †ãŒ

変更ã§ãるよã†ã«ãªã‚Šã¾ã™ã€‚

 

Xボタン(åˆæœŸè¨­å®šã§ã¯ A)を押ã—ãŸã¨ãã«å…ˆé ­ã«ã„るアクターã«ã‚ˆã£ã¦

ç•°ãªã‚‹ã‚³ãƒ¢ãƒ³ã‚¤ãƒ™ãƒ³ãƒˆã‚’実行ã§ãã‚‹ãŠã¾ã‘機能ãŒã¤ã„ã¦ã„ã¾ã™ã€‚

 

使用ã™ã‚‹ã‚²ãƒ¼ãƒ ã‚¹ã‚¤ãƒƒãƒï¼ˆåˆæœŸè¨­å®šï¼‰

0006

 

2011.12.16 Ver1.01

・移動中ã«ã‚³ãƒ¢ãƒ³ã‚¤ãƒ™ãƒ³ãƒˆã‚’呼ã³å‡ºã™ã“ã¨ã§æŽ¥è§¦ã‚¤ãƒ™ãƒ³ãƒˆã‚’

 無視ã™ã‚‹ã“ã¨ãŒã§ãã¦ã—ã¾ã†ä¸å…·åˆã‚’修正

 

2011.12.15 Ver1.0

公開

 

=end

 

#==============================================================================

# □ 設定項目

#==============================================================================

module TMPTSRT

# ã“ã®ç•ªå·ã®ã‚¹ã‚¤ãƒƒãƒãŒã‚ªãƒ³ã®ã¨ãã¯ãƒãƒˆãƒ«ãƒ¡ãƒ³ãƒãƒ¼ã®ã¿ã§ä¸¦ã³æ›¿ãˆã‚’ã™ã‚‹

SW_BATTLE_MEMBER = 4961

 

# アクターã”ã¨ã®ã‚³ãƒ¢ãƒ³ã‚¤ãƒ™ãƒ³ãƒˆè¨­å®š

# 設定をçœç•¥ã—ãŸã‚¢ã‚¯ã‚¿ãƒ¼ã¯å…±é€šã‚³ãƒ¢ãƒ³ã‚¤ãƒ™ãƒ³ãƒˆã‚’実行ã—ã¾ã™

# ã©ã¡ã‚‰ã‚‚çœç•¥ã•ã‚Œã¦ã„ã‚‹å ´åˆã¯ä½•ã‚‚実行ã•ã‚Œã¾ã›ã‚“

ACTOR_EVENT = []

ACTOR_EVENT[0] = 1 # 共通コモンイベント

ACTOR_EVENT[1] = 2 # 1番ã®ã‚¢ã‚¯ã‚¿ãƒ¼ãŒå…ˆé ­ã®ã¨ãã«å®Ÿè¡Œã™ã‚‹ã‚¤ãƒ™ãƒ³ãƒˆ

end

 

#==============================================================================

# â–  Game_Party

#==============================================================================

class Game_Party

#--------------------------------------------------------------------------

# â—‹ メンãƒãƒ¼ã®ä¸¦ã³é †å¤‰æ›´

#--------------------------------------------------------------------------

def change_member_top(flag)

return if members.size == 0

if $game_switches[TMPTSRT::SW_BATTLE_MEMBER]

if flag

@actors.unshift(@actors.delete_at(battle_members.size - 1))

else

@actors.insert(battle_members.size - 1, @actors.shift)

end

else

flag ? @actors.unshift(@actors.pop) : @actors.push(@actors.shift)

end

$game_player.refresh

$game_map.need_refresh = true

end

end

 

#==============================================================================

# â–  Scene_Map

#==============================================================================

class Scene_Map

#--------------------------------------------------------------------------

# ◠フレーム更新

#--------------------------------------------------------------------------

alias tmptsrt_scene_map_update update

def update

tmptsrt_scene_map_update

if scene_change_ok?

if Input.trigger?(:L)

$game_party.change_member_top(true)

elsif Input.trigger?(:R)

$game_party.change_member_top(false)

elsif Input.trigger?(:X)

if $game_party.exists && !$game_map.interpreter.running? &&

!$game_player.moving?

id = TMPTSRT::ACTOR_EVENT[$game_party.members[0].id]

id ||= TMPTSRT::ACTOR_EVENT[0]

$game_temp.reserve_common_event(id) if id

end

end

end

end

end

Share this post


Link to post
Share on other sites

@sly : what do you mean?

if you refer why tsukihime write script that someone already script...

c'mon... tsuki code is lot shorter than tomiaky. and even not... it's always better to have alternative. if you have incompatibility with other script you could seek another alternative. example: i want to use passive skill script. there a lot of them. from skyval, tsukihime, etc. but there's some compatibility issues. and finally i found neon black's passive skill script is the one that have no incompatibility issues with all my scripts. imagine if he didn't write that script because there already someone who wrote them. i won't have working passive skill in my project :P.

 

but if you refer to something else... ignore above.

oriceles likes this

Share this post


Link to post
Share on other sites

Fantastic script.

 

I would like to request that, instead of pressing the A button, there is an event on the map which, when interacted with, changes the party formation. If that is possible then I will be so happy :D

 

And if you did it like that, where you have to have an event to change formation, then there could be OTHER events that, when pressed, react differently if a certain character is in lead. For example if Actor 1 is in lead, you can press a button, but if Actor 2 is in lead, you can't. So if you're Actor 2 you have to go back to that event that switches the formation in order to change into Actor 1, then walk back over to the button, which you can now press.

 

Do you understand? I will be so excited if this happens! :) Thanks for the great script already though.

Edited by Jinjo

Share this post


Link to post
Share on other sites

Just use script calls in your event

 

$game_party.rotate_formation_left
$game_party.rotate_formation_right

 

Ah brilliant :D

 

And is it possible to do a conditional branch w/ script call to check which player is in the lead? (That would be AMAZING!)

 

I am so excited by this script + its potential for enhancing games! Great job! You are awesome!

Edited by Jinjo

Share this post


Link to post
Share on other sites

There is a script call in the conditional branch

 

eg: check whether the leader is actor 2

 

$game_party.leader == $game_actors[2]

 

If you don't like typing all that all the time you can just paste this into your scripts

 

class Game_Interpreter

 def is_leader?(actor_id)
   $game_party.leader == $game_actors[actor_id]
 end
end

 

And then in your conditional branch just say

 

is_leader?(2)

Edited by Tsukihime
Jinjo and oriceles like this

Share this post


Link to post
Share on other sites

There is a script call in the conditional branch

 

eg: check whether the leader is actor 2

 

$game_party.leader == $game_actors[2]

 

If you don't like typing all that all the time you can just paste this into your scripts

 

class Game_Interpreter

 def is_leader?(actor_id)
$game_party.leader == $game_actors[actor_id]
 end
end

 

And then in your conditional branch just say

 

is_leader?(2)

 

YIPPEE!!! :) I am so happy right now! This script + the script calls you've given me are fantastic. I can think of so many great uses for them! Thank you so much Tsukihime!

Share this post


Link to post
Share on other sites

Hello,

 

There is a big problem with your script. It makes it impossible to change player graphic!

 

I don't have this problem at all.

 

Strange, I do :s I tested it by disabling the script + when I did that, I could change player graphic. Only when I had this script enabled was it impossible!

Share this post


Link to post
Share on other sites

Does this happen in a default project? I am not getting the issue either and my project is full of features and effects and yanfly battle engine.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Does this happen in a default project? I am not getting the issue either and my project is full of features and effects and yanfly battle engine.

 

I know nothing about scripting but I wanted to have it so you could only change formation by clicking an event (no keyboard controls). To do that I deleted bits of the script until that became possible. Maybe you could try inserting my copy of the script into your game and seeing if it lets you change player graphic then?

 

 

=begin
#==============================================================================
** Rotate Formation
Author: Tsukihime
Date: Oct 30, 2012
------------------------------------------------------------------------------
** Change log
Oct 30, 2012
  - changed it to rotate left or rotate right. Just delete what you don't need
Oct 29, 2012
  - initial release
------------------------------------------------------------------------------  
** Terms of Use
* Free to use in commercial/non-commercial projects
* No real support. The script is provided as-is
* Will do bug fixes, but no compatibility patches
* Features may be requested but no guarantees, especially if it is non-trivial
* Preserve this header
------------------------------------------------------------------------------
Rotates the formation of your battle members on the map left by 1.
Press A to rotate formation.

You can configure this button below.
You can also configure which direction they rotate
#==============================================================================
=end
$imported = {} if $imported.nil?
$imported["Tsuki_RotateFormation"] = true
#==============================================================================
# ** Configuration
#=============================================================================
module Tsuki
 module Rotate_Formation
   Rotate_L_Button = :X   # key to rotate formation
   Rotate_R_Button = :Y
 end
end
#==============================================================================
# ** Rest of the script
#=============================================================================
class Game_Party < Game_Unit

 def rotate_formation_left
   j = [@actors.size, max_battle_members].min
   @actors = @actors[0...j].rotate.concat((@actors[j+1..-1] || []))
   $game_player.refresh
 end

 def rotate_formation_right
   j = [@actors.size, max_battle_members].min
   @actors = @actors[0...j].rotate(-1).concat((@actors[j+1..-1] || []))
   $game_player.refresh
 end
end
class Scene_Map < Scene_Base

 alias :th_rot_form_update_scene :update_scene
 def update_scene
   th_rot_form_update_scene
   update_rotate_formation unless scene_changing?
 end

 # new
 def update_rotate_formation
   $game_party.rotate_formation_left
   $game_party.rotate_formation_right
 end

end

 

Share this post


Link to post
Share on other sites

That's very strange. Don't worry about it, I'll keep experimenting my end. I'm sure it must just be something I've done wrong. No worries Tsukihime - this is a fantastic script + I love the way you have such great functionality with only a few lines of code! :)

Share this post


Link to post
Share on other sites

Tsukihime, would there be a way one could use this script to lock the formation of the party in the field even if it's not the same order used in combat/status screen?

 

*edit* Oh, my apologies, I misunderstood that the script was changing the actual formation rather than just the order they appeared in the field, don't suppose I can use it for what I want.

Edited by ShionKreth

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.