help with Hime's Party Rotate script

in my game, the main overworld mechanic is cycling between the four party members to solve puzzles and navigate, so i have Hime's Party Rotate script installed and set to cycle with L and R (AKA the Q and W keys)

however, two of the characters have overworld skills that put them in unique states where cycling isn't ideal, as it glitches out the sprites until you leave the state:
Laika, the dog character, is able to bury herself underground to find treasures and go under grates and small spaces. obviously, you shouldn't be able to cycle to the other characters while underground
Lio, the gecko character, can cling to certain walls and climb. it's considerably less buggy, as these walls are just set as ladders that only they can hop onto or off of, but it's still a unique state only Lio should be in

my big question here is if there's something to code, be it editing the thing itself or through a script call, and make it so these unique states (which have switches attached) disable the cycling, keeping you as either character until they're back in a default state

i'm not at all proficient with any RGSS and i'd, personally, prefer a script call solution simply because editing someone else's script directly just feels wrong

EDIT: I suppose, more generally, i want a way to bypass and disable custom script features that can't be disabled in the script itself, bc i'm sure Hime's Party Rotate isn't the only thing where it would be handy to turn off temporarily in a game
unique states
Based on that, I wrote this.
Specify in the array the states to look for.
Spoiler: original 1.00a
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Skip Rotate on State         ║  Version: 1.00     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║   Bypass rotation when inflicted    ╠════════════════════╣
# ║   with a specific state on actor    ║    06 Sep 2022     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║                                                          ║
# ║   Specify the states to check rotation function          ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Updates:                                                 ║
# ║   2022-Sep-06 - Initial publish                          ║
# ╚══════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║ Free for all uses in RPG Maker except nudity                       ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║ No part of this code can be used with AI programs or tools         ║
# ╚════════════════════════════════════════════════════════════════════╝

module R2_Rotate_Formation_Blocked_States
  States = [3,4]
end
# ╔══════════════════════════════════════════════════════════╗
# ║          End of Editable Region                          ║
# ╚══════════════════════════════════════════════════════════╝
class Game_Party < Game_Unit
 
  def rotate_formation_left
    j = [@actors.size, max_battle_members].min
    loop do
      @actors = @actors[0...j].rotate.concat((@actors[j..-1] || []))
      actor = $game_actors[@actors[0]]
      clean = true
      actor.states.each do |st|
        clean = false if R2_Rotate_Formation_Blocked_States::States.include?(st.id)
      end
      break if clean == true
    end
    $game_player.refresh
  end
 
  def rotate_formation_right
    j = [@actors.size, max_battle_members].min
    loop do
      @actors = @actors[0...j].rotate(-1).concat((@actors[j..-1] || []))
      actor = $game_actors[@actors[0]]
      clean = true
      actor.states.each do |st|
        clean = false if R2_Rotate_Formation_Blocked_States::States.include?(st.id)
      end
      break if clean == true
    end
    $game_player.refresh
  end
end
Spoiler: updated terms/code
Ruby:
# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Rotate Lock on State                   ║  Version: 1.01a    ║
# ║ Author: Roninator2                            ║                    ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function:                                     ║   Date Created     ║
# ║   Block rotation when inflicted               ╠════════════════════╣
# ║   with a specific state on actor              ║    06 Sep 2022     ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires:                                                          ║
# ║        TsukiHime's Formation Rotation                              ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description:                                                 ║
# ║       Lock rotate when state applied                               ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions:                                                      ║
# ║                                                                    ║
# ║   Specify the states to block rotation function                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates:                                                           ║
# ║ 1.00 - 06 Sep 2022 - Script finished                               ║
# ║ 1.01 - 06 Sep 2022 - Fixed Code                                    ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks:                                                ║
# ║   Roninator2                                                       ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║ Free for all uses in RPG Maker except nudity                       ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║ No part of this code can be used with AI programs or tools         ║
# ╚════════════════════════════════════════════════════════════════════╝

module R2_Rotate_Formation_Blocked_States
  States = [3,4]
end
# ╔══════════════════════════════════════════════════════════╗
# ║          End of Editable Region                          ║
# ╚══════════════════════════════════════════════════════════╝

class Game_Party < Game_Unit
 
  def rotate_formation_left
    j = [@actors.size, max_battle_members].min
    loop do
      actor = $game_actors[@actors[0]]
      clean = true
      actor.states.each do |st|
        clean = false if R2_Rotate_Formation_Blocked_States::States.include?(st.id)
      end
      if clean == true
        @actors = @actors[0...j].rotate.concat((@actors[j..-1] || []))
        break
      end
      break if clean == false
    end
    $game_player.refresh
  end
 
  def rotate_formation_right
    j = [@actors.size, max_battle_members].min
    loop do
      actor = $game_actors[@actors[0]]
      clean = true
      actor.states.each do |st|
        clean = false if R2_Rotate_Formation_Blocked_States::States.include?(st.id)
      end
      if clean == true
        @actors = @actors[0...j].rotate(-1).concat((@actors[j..-1] || []))
        break
      end
      break if clean == false
    end
    $game_player.refresh
  end
end
Spoiler: original 1.01b
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Rotate Lock on State         ║  Version: 1.01a    ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║   Block rotation when inflicted     ╠════════════════════╣
# ║   with a specific state on actor    ║    06 Sep 2022     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║                                                          ║
# ║   Specify the states to block rotation function          ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Updates:                                                 ║
# ║   2022-Sep-06 - Initial publish                          ║
# ║   2022-Sep-06 - Reversed script function/fixed code      ║
# ╚══════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║ Free for all uses in RPG Maker except nudity                       ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║ No part of this code can be used with AI programs or tools         ║
# ╚════════════════════════════════════════════════════════════════════╝

module R2_Rotate_Formation_Blocked_States
  States = [3,4]
end
# ╔══════════════════════════════════════════════════════════╗
# ║          End of Editable Region                          ║
# ╚══════════════════════════════════════════════════════════╝

class Game_Party < Game_Unit
 
  def rotate_formation_left
    j = [@actors.size, max_battle_members].min
    actor = $game_actors[@actors[0]]
    clean = true
    actor.states.each do |st|
      clean = false if R2_Rotate_Formation_Blocked_States::States.include?(st.id)
    end
    if clean == true
      @actors = @actors[0...j].rotate.concat((@actors[j..-1] || []))
    end
    $game_player.refresh
  end
 
  def rotate_formation_right
    j = [@actors.size, max_battle_members].min
    actor = $game_actors[@actors[0]]
    clean = true
    actor.states.each do |st|
      clean = false if R2_Rotate_Formation_Blocked_States::States.include?(st.id)
    end
    if clean == true
      @actors = @actors[0...j].rotate(-1).concat((@actors[j..-1] || []))
    end
    $game_player.refresh
  end
end
Spoiler: Updated 1.01b
Ruby:
# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Rotate Lock on State                   ║  Version: 1.01b    ║
# ║ Author: Roninator2                            ║                    ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function:                                     ║   Date Created     ║
# ║   Block rotation when inflicted               ╠════════════════════╣
# ║   with a specific state on actor              ║    06 Sep 2022     ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires:                                                          ║
# ║        TsukiHime's Formation Rotation                              ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description:                                                 ║
# ║       Lock rotate when state applied                               ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions:                                                      ║
# ║                                                                    ║
# ║   Specify the states to block rotation function                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates:                                                           ║
# ║ 1.00 - 06 Sep 2022 - Script finished                               ║
# ║ 1.01 - 06 Sep 2022 - Reversed function / Fixed Code                ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks:                                                ║
# ║   Roninator2                                                       ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║ Free for all uses in RPG Maker except nudity                       ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║ No part of this code can be used with AI programs or tools         ║
# ╚════════════════════════════════════════════════════════════════════╝

module R2_Rotate_Formation_Blocked_States
  States = [3,4]
end
# ╔══════════════════════════════════════════════════════════╗
# ║          End of Editable Region                          ║
# ╚══════════════════════════════════════════════════════════╝

class Game_Party < Game_Unit
 
  def rotate_formation_left
    j = [@actors.size, max_battle_members].min
    actor = $game_actors[@actors[0]]
    clean = true
    actor.states.each do |st|
      clean = false if R2_Rotate_Formation_Blocked_States::States.include?(st.id)
    end
    if clean == true
      @actors = @actors[0...j].rotate.concat((@actors[j..-1] || []))
    end
    $game_player.refresh
  end
 
  def rotate_formation_right
    j = [@actors.size, max_battle_members].min
    actor = $game_actors[@actors[0]]
    clean = true
    actor.states.each do |st|
      clean = false if R2_Rotate_Formation_Blocked_States::States.include?(st.id)
    end
    if clean == true
      @actors = @actors[0...j].rotate(-1).concat((@actors[j..-1] || []))
    end
    $game_player.refresh
  end
end
Based on that, I wrote this.
Specify in the array the states to look for.
Ruby:
module R2_Rotate_Formation_Blocked_States
  States = [3,4]
end
class Game_Party < Game_Unit
 
  def rotate_formation_left
    j = [@actors.size, max_battle_members].min
    loop do
      @actors = @actors[0...j].rotate.concat((@actors[j..-1] || []))
      actor = $game_actors[@actors[0]]
      clean = true
      actor.states.each do |st|
        clean = false if R2_Rotate_Formation_Blocked_States::States.include?(st.id)
      end
      break if clean == true
    end
    $game_player.refresh
  end
 
  def rotate_formation_right
    j = [@actors.size, max_battle_members].min
    loop do
      @actors = @actors[0...j].rotate(-1).concat((@actors[j..-1] || []))
      actor = $game_actors[@actors[0]]
      clean = true
      actor.states.each do |st|
        clean = false if R2_Rotate_Formation_Blocked_States::States.include?(st.id)
      end
      break if clean == true
    end
    $game_player.refresh
  end
end
i didn't really mean "States" states, but y'know what? i can make this work

"beggers can't be choosers" and all, and you're the first person to reply here lol

i'm guessing i'd attach that to the main script somewhere, correct?
i'm guessing i'd attach that to the main script somewhere, correct?
If you're unsure on how to use scripts, follow the link in my signature block for Andar's 'how to use scripts'
All scripts should go into a new slot by themselves.
Place this below Tsukihime's Rotation script.
If you're unsure on how to use scripts, follow the link in my signature block for Andar's 'how to use scripts'
All scripts should go into a new slot by themselves.
Place this below Tsukihime's Rotation script.
ok, that makes more sense-- lol

thanks a ton, how should i credit you?
how should i credit you?
If you use credits in your game, then just mention my name.
All good
I inserted it under the Party Rotate script and set the states for it, and i have a bug to report:
i can still cycle, but also it skips over the character that's supposed to be in that state
meaning i softlock myself either moving very slowly and unable to pass certain tiles or clinging to a wall and unable to get off
Any idea what might've gone wrong there?
Any idea what might've gone wrong there?
You originally stated that you did not want the actors with the specific states to be the leader because it caused issues.
So this script checks if the player has the state(s) provided and will skip to the next actor if the actor is inflicted with the state.

If you wanted something else, please clarify.
You originally stated that you did not want the actors with the specific states to be the leader because it caused issues.
So this script checks if the player has the state(s) provided and will skip to the next actor if the actor is inflicted with the state.

If you wanted something else, please clarify.
no, I did want them to be the leader if they're in that state
i wanted them to stay the leader, disabling the cycling with Q and W, because swapping to another character while they're in their state causes visual bugs

i mean, i suppose now that you clear up the function like that, i just have to apply it to the other party members instead of the leader and then it Should work

UPDATE: my common events are the tiniest bit messier by having 3 state changes each time, but it did work like that
it still causes a bit of bugging, as now Q and W just exit each character's action sprite, but at least they stay in the proper mode and you can exit, so it's progress

I suppose i should've opened Not calling them states, if i wanted to be REALLY clear, since States are their own RPG Maker concept. as i said, i never meant it as "Status Effect" States, just in a general sense how the character is, set with a switch
i mean, i suppose now that you clear up the function like that, i just have to apply it to the other party members instead of the leader and then it Should work
Probably not. Give me a minute, I should be able to reverse the effects easily enough. I'll add it as a second script below the first.


just in a general sense how the character is, set with a switch
So the script should look for switches activated?
So the script should look for switches activated?
that's what i was already doing, but honestly it's fine. having a "disable rotation" state isn't a big hassle, don't worry about changing it, and could even be better than having the switch and state functions all at once

second script seen and implemented, but it still has that minor bug i cite in my update, where it stays on the correct actor but removes them from their unique action sprite, changing them to the default sprite off the database
we are definitely getting somewhere, and i truly appreciate your help :3
where it stays on the correct actor but removes them from their unique action sprite
I don't know if I can help with that as I don't know how your changing sprites. Not that a rotation should cause the sprites to be affected in my opinion.
I don't know if I can help with that as I don't know how your changing sprites. Not that a rotation should cause the sprites to be affected in my opinion.
the overworld skills are just common events activated by a "Setup" switch and that are used with the X button (Keyboard A)
and i change the sprites with the Move Route command
i change the sprites with the Move Route command
Page 3 change actor sprite.
The move route seems to be temporary, but the event command is permanent.
Page 3 change actor sprite.
The move route seems to be temporary, but the event command is permanent.
that did it! so i got the cycling lock and the graphics dont bug out

saying it again: I appreciate your help a whole lot! thanks for putting up with me lmao
guess that's this case closed

Original thread: https://forums.rpgmakerweb.com/threads/help-with-himes-party-rotate-script.151028/