09-02-2025, 04:10 PM (This post was last modified: 09-02-2025, 04:24 PM by kyonides.)
How interesting. The script has not been altered, and yet it refuses to work on Ace_V 's side. And before Ace_V had already said something that worries me. Even a new project fails to execute the script, and he gets the very same error on both project's. That is why I asked the OP to upload that project's Scripts.rxdata file instead of the main project's. It was an attempt to keep the main project private for as long as possible.
(I had to edit my previous post to point to the right file. Stuff like this happened because I had not slept too much as of late.)
I don't mind if Ace_V ends up uploading one or both files so we can take a look at them. That would be great indeed.
[Deleted the rest of this post. I don't wanna make an extreme assumption about the scripts file for the time being.]
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
As DerVVulfman suggested, I am testing a duplicate of the game and removing scripts one at a time, as I do agree with kyonides that I'd prefer to upload the scripts.rxdata as a last resort.
Immediately though, I encountered an error upon starting up the game after deleting the caterpillar script (listed as Train_Actor):
I pasted a clean Scene_Load into the test game and the error persists. It refers to this line:
Code:
$game_party = Marshal.load(file)
The caterpillar script that I use is the old fukuyama one:
class Game_Party_Actor < Game_Character
def initialize
super()
@through = true
end
def setup(actor)
# キャラクターのファイル名と色相を設定
if actor != nil
@character_name = actor.character_name
@character_hue = actor.character_hue
else
@character_name = ""
@character_hue = 0
end
# 不透明度と合成方法を初期化
@opacity = 255
@blend_type = 0
end
def screen_z(height = 0)
if $game_player.x == @x and $game_player.y == @y
return $game_player.screen_z(height) - 1
end
super(height)
end
#--------------------------------------------------------------------------
# ● 下に移動
# turn_enabled : その場での向き変更を許可するフラグ
#--------------------------------------------------------------------------
def move_down(turn_enabled = true)
# 下を向く
if turn_enabled
turn_down
end
# 通行可能な場合
if passable?(@x, @y, Input::DOWN)
# 下を向く
turn_down
# 座標を更新
@y += 1
end
end
#--------------------------------------------------------------------------
# ● 左に移動
# turn_enabled : その場での向き変更を許可するフラグ
#--------------------------------------------------------------------------
def move_left(turn_enabled = true)
# 左を向く
if turn_enabled
turn_left
end
# 通行可能な場合
if passable?(@x, @y, Input::LEFT)
# 左を向く
turn_left
# 座標を更新
@x -= 1
end
end
#--------------------------------------------------------------------------
# ● 右に移動
# turn_enabled : その場での向き変更を許可するフラグ
#--------------------------------------------------------------------------
def move_right(turn_enabled = true)
# 右を向く
if turn_enabled
turn_right
end
# 通行可能な場合
if passable?(@x, @y, Input::RIGHT)
# 右を向く
turn_right
# 座標を更新
@x += 1
end
end
#--------------------------------------------------------------------------
# ● 上に移動
# turn_enabled : その場での向き変更を許可するフラグ
#--------------------------------------------------------------------------
def move_up(turn_enabled = true)
# 上を向く
if turn_enabled
turn_up
end
# 通行可能な場合
if passable?(@x, @y, Input::UP)
# 上を向く
turn_up
# 座標を更新
@y -= 1
end
end
#--------------------------------------------------------------------------
# ● 左下に移動
#--------------------------------------------------------------------------
def move_lower_left
# 向き固定でない場合
unless @direction_fix
# 右向きだった場合は左を、上向きだった場合は下を向く
@direction = (@direction == Input::RIGHT ? Input::LEFT : @direction == Input::UP ? Input::DOWN : @direction)
end
# 下→左、左→下 のどちらかのコースが通行可能な場合
if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
(passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
# 座標を更新
@x -= 1
@y += 1
end
end
#--------------------------------------------------------------------------
# ● 右下に移動
#--------------------------------------------------------------------------
def move_lower_right
# 向き固定でない場合
unless @direction_fix
# 左向きだった場合は右を、上向きだった場合は下を向く
@direction = (@direction == Input::LEFT ? Input::RIGHT : @direction == Input::UP ? Input::DOWN : @direction)
end
# 下→右、右→下 のどちらかのコースが通行可能な場合
if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
(passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
# 座標を更新
@x += 1
@y += 1
end
end
#--------------------------------------------------------------------------
# ● 左上に移動
#--------------------------------------------------------------------------
def move_upper_left
# 向き固定でない場合
unless @direction_fix
# 右向きだった場合は左を、下向きだった場合は上を向く
@direction = (@direction == Input::RIGHT ? Input::LEFT : @direction == Input::DOWN ? Input::UP : @direction)
end
# 上→左、左→上 のどちらかのコースが通行可能な場合
if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
(passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
# 座標を更新
@x -= 1
@y -= 1
end
end
#--------------------------------------------------------------------------
# ● 右上に移動
#--------------------------------------------------------------------------
def move_upper_right
# 向き固定でない場合
unless @direction_fix
# 左向きだった場合は右を、下向きだった場合は上を向く
@direction = (@direction == Input::LEFT ? Input::RIGHT : @direction == Input::DOWN ? Input::UP : @direction)
end
# 上→右、右→上 のどちらかのコースが通行可能な場合
if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
(passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
# 座標を更新
@x += 1
@y -= 1
end
end
def set_move_speed(move_speed)
@move_speed = move_speed
end
end
class Spriteset_Map
def setup_actor_character_sprites?
return @setup_actor_character_sprites_flag != nil
end
def setup_actor_character_sprites(characters)
if !setup_actor_character_sprites?
index_game_player = 0
@character_sprites.each_index do |i|
if @character_sprites[i].character.instance_of?(Game_Player)
index_game_player = i
break
end
end
for character in characters.reverse
@character_sprites.unshift(
Sprite_Character.new(@viewport1, character)
)
end
@setup_actor_character_sprites_flag = true
end
end
end
class Scene_Map
def setup_actor_character_sprites(characters)
@spriteset.setup_actor_character_sprites(characters)
end
end
class Game_Party
def set_transparent_actors(transparent)
@transparent = transparent
end
def setup_actor_character_sprites
if @characters == nil
@characters = []
for i in 1 .. 4
@characters.push(Game_Party_Actor.new)
end
end
if @actors_chach == nil
@actors_chach = []
end
if @actors_chach != @actors
@actors_chach = @actors.clone
for i in 1 .. 4
@characters[i - 1].setup(actors[i])
end
end
if $scene.instance_of?(Scene_Map)
$scene.setup_actor_character_sprites(@characters)
end
end
def update_party_actors
setup_actor_character_sprites
transparent = $game_player.transparent
if transparent == false
if TRAIN_ACTOR_TRANSPARENT_SWITCH
transparent = $game_switches[TRAIN_ACTOR_TRANSPARENT_SWITCHES_INDEX]
else
transparent = $game_player.transparent
end
end
for character in @characters
character.transparent = transparent
character.set_move_speed($game_player.get_move_speed)
character.update
end
end
def moveto_party_actors( x, y )
setup_actor_character_sprites
for character in @characters
character.moveto( x, y )
end
if @move_list == nil
@move_list = []
end
for i in 0 .. 10
@move_list[i] = nil
end
end
def move_party_actors
if @move_list == nil
@move_list = []
for i in 0 .. 10
@move_list[i] = nil
end
end
@move_list.each_index do |i|
if @characters[i] != nil
case @move_list[i].type
when Input::DOWN
@characters[i].move_down(@move_list[i].args[0])
when Input::LEFT
@characters[i].move_left(@move_list[i].args[0])
when Input::RIGHT
@characters[i].move_right(@move_list[i].args[0])
when Input::UP
@characters[i].move_up(@move_list[i].args[0])
when DOWN_LEFT
@characters[i].move_lower_left
when DOWN_RIGHT
@characters[i].move_lower_right
when UP_LEFT
@characters[i].move_upper_left
when UP_RIGHT
@characters[i].move_upper_right
when JUMP
@characters[i].jump(@move_list[i].args[0],@move_list[i].args[1])
end
end
end
end
class Move_List_Element
def initialize(type,args)
@type = type
@args = args
end
def type() return @type end
def args() return @args end
end
def add_move_list(type,*args)
@move_list.unshift(Move_List_Element.new(type,args)).pop
end
def move_down_party_actors(turn_enabled = true)
move_party_actors
add_move_list(Input::DOWN,turn_enabled)
end
def move_left_party_actors(turn_enabled = true)
move_party_actors
add_move_list(Input::LEFT,turn_enabled)
end
def move_right_party_actors(turn_enabled = true)
move_party_actors
add_move_list(Input::RIGHT,turn_enabled)
end
def move_up_party_actors(turn_enabled = true)
move_party_actors
add_move_list(Input::UP,turn_enabled)
end
def move_lower_left_party_actors
move_party_actors
add_move_list(DOWN_LEFT)
end
def move_lower_right_party_actors
move_party_actors
add_move_list(DOWN_RIGHT)
end
def move_upper_left_party_actors
move_party_actors
add_move_list(UP_LEFT)
end
def move_upper_right_party_actors
move_party_actors
add_move_list(UP_RIGHT)
end
def jump_party_actors(x_plus, y_plus)
move_party_actors
add_move_list(JUMP,x_plus, y_plus)
end
end
module Game_Player_Module
def update
$game_party.update_party_actors
super
end
def moveto( x, y )
super
$game_party.moveto_party_actors( x, y )
end
def move_down(turn_enabled = true)
if passable?(@x, @y, Input::DOWN)
$game_party.move_down_party_actors(turn_enabled)
end
super(turn_enabled)
end
def move_left(turn_enabled = true)
if passable?(@x, @y, Input::LEFT)
$game_party.move_left_party_actors(turn_enabled)
end
super(turn_enabled)
end
def move_right(turn_enabled = true)
if passable?(@x, @y, Input::RIGHT)
$game_party.move_right_party_actors(turn_enabled)
end
super(turn_enabled)
end
def move_up(turn_enabled = true)
if passable?(@x, @y, Input::UP)
$game_party.move_up_party_actors(turn_enabled)
end
super(turn_enabled)
end
def move_lower_left
# 下→左、左→下 のどちらかのコースが通行可能な場合
if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
(passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
$game_party.move_lower_left_party_actors
end
super
end
def move_lower_right
# 下→右、右→下 のどちらかのコースが通行可能な場合
if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
(passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
$game_party.move_lower_right_party_actors
end
super
end
def move_upper_left
# 上→左、左→上 のどちらかのコースが通行可能な場合
if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
(passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
$game_party.move_upper_left_party_actors
end
super
end
def move_upper_right
# 上→右、右→上 のどちらかのコースが通行可能な場合
if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
(passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
$game_party.move_upper_right_party_actors
end
super
end
def jump(x_plus, y_plus)
# 新しい座標を計算
new_x = @x + x_plus
new_y = @y + y_plus
# 加算値が (0,0) の場合か、ジャンプ先が通行可能な場合
if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)
$game_party.jump_party_actors(x_plus, y_plus)
end
super(x_plus, y_plus)
end
# -----------------------------------------------
# move_speed を外から見れるように
# -----------------------------------------------
def get_move_speed
return @move_speed
end
end
class Game_Player
include Game_Player_Module
end
I'll keep this script in and test the game while removing the other scripts slowly.
For that error message to appear, you are either using a game save that relied upon the Caterpillar script or have an event that is automatically running with movement commands reliant upon the caterpillar script.
While you would likely need to use a fresh new game after installing (due to variable changes), you may wish to look into this thread for Fukuyama's Train Actor script: https://www.save-point.org/showthread.php?tid=2705
... an English translated version exists.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
09-05-2025, 06:30 AM (This post was last modified: 09-05-2025, 06:31 AM by Ace_V.)
(09-04-2025, 04:30 AM)DerVVulfman Wrote: For that error message to appear, you are either using a game save that relied upon the Caterpillar script or have an event that is automatically running with movement commands reliant upon the caterpillar script.
While you would likely need to use a fresh new game after installing (due to variable changes), you may wish to look into this thread for Fukuyama's Train Actor script: https://www.save-point.org/showthread.php?tid=2705
... an English translated version exists.
Oh! OK, got it! You're right about the save! The fukuyama script was one of the earliest ones I implemented, and I didn't know a translated version exists. I'll implement this translated one down the line!
I am slowly testing the custom scripts, and my first method is to inject each script from my game into a new project, rather than move the full scripts.rxdata.
As kyonides pointed out, the lead actor swapper works great in a new project, and the untranslated train actor script doesn't cause an error.
However, I did notice that the caterpillar doesn't update when I swap out the lead actor (see the attached screenshot) so that's one more thing.
I'll add a few more scripts and test out today in-between tasks.
First I tried inserting the scripts one at a time into a new project, but there weren't any errors. All the scripts worked fine, and the lead actor swapper also worked. Huh.
So, I transferred my game's scripts.rxdata into the empty project and removed some of the variables for the peep/steal, weapon-skill, ring menu and other scripts that referred to database items or assets.
The lead actor swapper script still worked. So did the other scripts.
Then I remembered DerVVulfman's comment:
Quote:For that error message to appear, you are either using a game save that relied upon the Caterpillar script
So, I started a new save in my game and...it works. The lead actor swapper script works without any issue.
My mistake, as that was also the solution to a question I asked about a script last November--the Weapons Skill script by makeamidget--which was also suggested by DerVVulfman.
Big relief that the script does indeed work, but as I pointed out in my previous reply, it doesn't update the caterpillar. The lead actor may swap, but it doesn't push the former lead into the caterpillar (and remove the new lead from the caterpillar)
Is there a workaround to that? I assume both sheol's script and the caterpillar script must be altered.
Caterpillar systems (Train Actor, and other): They assume the NPC in position #1 (index #0) within Game_Party.actors is the party leader, and all others are the followers. If you remove Aluxes from the party, the array of actors shift and Basil takes position #1. And adding Aluxes back, he is stuck at the end as the last member of the party. The system is based on the actual list of party members.
Lead Actor Swap: Does not affect the list of actors within Game_Party.actors. Using the system does not change the order of the party and the first member within the list remains unaffected. It does not actually change the party order, merely making an attempt to fake who the party leader actually is during gameplay. If you change the party leader with this system and then enter the main menu, you will see that the party member order is actually unaffected.
Indeed, Lead Actor Swap may look nice, but it doesn't fully change the party leader.
I just cranked this out as a replacement for Sheol's work:
Code:
#==============================================================================
# ** DerVV's Party Order Shifter
#------------------------------------------------------------------------------
# by DerVVulfman
# version 1.0
# 09-05-2025 (mm/dd/yyyy)
# RGSS / RPGMaker XP
#==============================================================================
module D_Party_Order
BLOCK_SWITCH = 5 # Switch ID that stops cycling if turned on
FORWARD_KEY = Input::L # Defined key to cycle party forward
BACKWARD_KEY = Input::R # Defined key to cycle party backward
end
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles the player. Its functions include event starting
# determinants and map scrolling. Refer to "$game_player" for the one
# instance of this class.
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias dervv_party_actor_order_update update
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
#
dervv_party_actor_order_update
return if $game_switches[D_Party_Order::BLOCK_SWITCH]
return cycle_party if Input.trigger?(D_Party_Order::BACKWARD_KEY)
return cycle_party(true) if Input.trigger?(D_Party_Order::FORWARD_KEY)
#
end
#--------------------------------------------------------------------------
# * Cycle party forward
# d : direction cycles forward (True/false)
#--------------------------------------------------------------------------
def cycle_party(d=false)
#
temp = (d==true) ? $game_party.actors.pop : $game_party.actors.shift
(d==true) ? $game_party.actors.unshift(temp) : $game_party.actors.push(temp)
#
end
end
It not big. Its short and sweet. Its tiny config section lets you determine an RMXP switch to disable the feature and lets you determine what keys cycle the members forward or backward (should be full keyboard compatible too).
And as it actually changes the actual party order, it affects the main menu AND does work with Train Actor (and likely other caterpillars).
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
class Game_Party
def change_leader(n)
if n < 0
@actors.unshift @actors.pop
else
@actors << @actors.shift
end
end
def leader
@actors[0]
end
end
class Game_Player
alias :kyon_kuick_leader_swap_gm_plyr_up :update
def update
kyon_kuick_leader_swap_gm_plyr_up
if Input.trigger?(Input::L)
$game_party.change_leader(-1)
refresh
return
elsif Input.trigger?(Input::R)
$game_party.change_leader(1)
refresh
end
end
end
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
Thank you so much for these two scripts!! I tried them both but Dervv's script seems to only move around the caterpillar and not the main character? (the three characters behind do swap around, but it duplicates the lead into the second, then into the third, and fourth, but the lead doesn't swap out for some reason.)
kyonides' script works as I need it to, though! Also updates the gear/skills menu order, as well! I'm using that one.
If I may make one more request: is it possible to force a specific character (if they are in the party, via a conditional branch in an event) into the lead? Say for a specific area or cutscene, you'd want that character as the lead of the caterpillar. (And the player is then free to swap out the lead after dialogue / cutscene is over)
class Game_Party
def change_leader(n)
if n < 0
@actors.unshift @actors.pop
else
@actors << @actors.shift
end
end
def temp_leader=(n)
@temp_leader_index = n
@actors[0], @actors[n] = @actors[n], @actors[0]
$game_player.refresh
end
def restore_leader
n = @temp_leader_index
@actors[0], @actors[n] = @actors[n], @actors[0]
@temp_leader_index = nil
$game_player.refresh
end
def leader
@actors[0]
end
end
class Game_Player
alias :kyon_kuick_leader_swap_gm_plyr_up :update
def update
kyon_kuick_leader_swap_gm_plyr_up
if Input.trigger?(Input::L)
$game_party.change_leader(-1)
refresh
return
elsif Input.trigger?(Input::R)
$game_party.change_leader(1)
refresh
end
end
end
Temporarily Change the Leader:
Code:
$game_party.temp_leader = Index
Restore the Original Leader to his rightful place:
Code:
$game_party.restore_leader
SIDE NOTE
I think Wulfo inverted the order of how the actors should cycle and that's why Ace_V got an unexpected result there. Yet, it's interesting to learn that it duplicated actors the more he used the swap feature.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
class Game_Party
def change_leader(n)
if n < 0
@actors.unshift @actors.pop
else
@actors << @actors.shift
end
end
def temp_leader=(n)
@temp_leader_index = n
@actors[0], @actors[n] = @actors[n], @actors[0]
$game_player.refresh
end
def restore_leader
n = @temp_leader_index
@actors[0], @actors[n] = @actors[n], @actors[0]
@temp_leader_index = nil
$game_player.refresh
end
def leader
@actors[0]
end
end
class Game_Player
alias :kyon_kuick_leader_swap_gm_plyr_up :update
def update
kyon_kuick_leader_swap_gm_plyr_up
if Input.trigger?(Input::L)
$game_party.change_leader(-1)
refresh
return
elsif Input.trigger?(Input::R)
$game_party.change_leader(1)
refresh
end
end
end
Temporarily Change the Leader:
Code:
$game_party.temp_leader = Index
Restore the Original Leader to his rightful place:
Code:
$game_party.restore_leader
SIDE NOTE
I think Wulfo inverted the order of how the actors should cycle and that's why Ace_V got an unexpected result there. Yet, it's interesting to learn that it duplicated actors the more he used the swap feature.
Oh SWEET! Thank you! I'll test this out. So Aluxes = index value of of 1, correct? (I assume when I do a script call to make Aluxes the lead, it'll be $game_party.temp_leader = 1) EDIT: seems putting 1 just swaps the current 2nd (actor1?) in the caterpillar with the lead (actor0?), so I don't know how to swap the specific character (Dorothy--regardless of her position on the caterpillar--into the lead to swap with the current leader, for example)
My plan is to use conditional branches to first check if a character is in the party (there are more than 4 characters in my game, so most will be in reserve), then run your script call to make that character the lead. I try to ensure the right characters are in the party for specific cutscenes, but in case said character isn't in the party for some reason, then I won't run the script call.
Some questions:
1. The code notes a temporary leader and storing that value. What if I don't intend to restore that leader at all (the player is free to swap back or to some other character entirely after the cutscene) but then the player goes to another cutscene that requires a different character as the lead, and I run a script call for that character, does it replace the value stored without any issues? (From my limited script knowledge, I assume it'll be fine.)
2. What happens if in between those two cutscenes, the player accesses party change and removes the "original" leader from the party (moving them into the reserve) and I call the restore leader script? (I'll probably never call the restore script anyway, but I wanted to know in the off chance that I do. )
Quote:it's interesting to learn that it duplicated actors the more he used the swap feature.
I didn't word that properly, sorry! I meant that it moved the original lead further down the caterpillar, but only the caterpillar (the leader remains that same duplicate).
So it went from
Quote:1. Aluxes
2. Basil
3. Cyrus
4. Dorothy
to
Quote:1. Aluxes
2. Aluxes
3. Cyrus
4. Dorothy
to
Quote:1. Aluxes
2. Cyrus
3. Aluxes
4. Dorothy
to
Quote:1. Aluxes
2. Cyrus
3. Dorothy
4. Aluxes
And Basil just disappears from the caterpillar altogether without a way to bring him back (even though he's still in the party when you check status / equipment)