Changing Player Graphic With a Script Command

Hello, I've been working on a custom script for my game that allows me to transform the player in the overworld with the press of a button. However, I do not know the syntax of how to change a player's graphic via scripting. I have created a code, so far, but I don't know where to go with this. I've been looking for examples of something similar, but I haven't been able to find something that is SPECIFICALLY for changing graphics.

Here is the code:

def pbTransform
transform = RPG::MoveRoute.new
transform.repeat = false
transform.list = []
transform.list.push( RPG::MoveCommand.new(36, []) )
transform.list.push( RPG::MoveCommand.new(17, []) )
transform.list.push( RPG::MoveCommand.new(15, [3]) )
transform.list.push( RPG::MoveCommand.new(18, []) )
transform.list.push( RPG::MoveCommand.new(15, [3]) )
transform.list.push( RPG::MoveCommand.new(41,['transform1'])) <---- This is the part that I am unsure about, because everything else works fine.
transform.list.push( RPG::MoveCommand.new )
$game_player.force_move_route(transform)
end

So yes, I can get everything else but that to work. Even still, going off of the RGSS Reference Manual I couldn't find any good examples of one in action.
doesn't XP has an event command to change player sprites? That was always included with the later makers as well.

If you need to use script code, simply search for that event command in the code and check how it is done there.
doesn't XP has an event command to change player sprites? That was always included with the later makers as well.

If you need to use script code, simply search for that event command in the code and check how it is done there.

Yes it does, however, I do not want to have a parallel processed event on every map, because that gets annoying and tedious after awhile. Also, the scripts in the script editor don't have any examples, hence why I was asking in the first place. I mostly want to learn how this is done, so that way I can use this for several other methods as well.
I wasn't talking about making parallel processes.
Somewhere in the core scripts of the XP game there is the script for the event interpreter. That script checks every event command in an event and executes it by regular script - the event commands inside the events don't work directly, they are always interpreted by that script.

I was asking you to look for that script, and then inside that script for the place where the event command "change actor sprite" gets transformed into the real script command - and then you can use the script command you find there.

Yes, going through the code that way is a lot of work - but it's either that or wait here in the hope that someone who knows XP-scripting comes along and points you to that command. And since XP is extremely old and most scripters moved on to Ace and even MV, that might take a while as well...
I wasn't talking about making parallel processes.
Somewhere in the core scripts of the XP game there is the script for the event interpreter. That script checks every event command in an event and executes it by regular script - the event commands inside the events don't work directly, they are always interpreted by that script.

I was asking you to look for that script, and then inside that script for the place where the event command "change actor sprite" gets transformed into the real script command - and then you can use the script command you find there.

Yes, going through the code that way is a lot of work - but it's either that or wait here in the hope that someone who knows XP-scripting comes along and points you to that command. And since XP is extremely old and most scripters moved on to Ace and even MV, that might take a while as well...

Well, yes I did end up finding it in the interpreter, however, there's not much in the way of a good example to go off of:

def command_322; command_dummy; end # Change Actor Graphic

and there is another that does nothing but return command_322.

The thing is, the form that I am writing this method in is also used in VX, but the only problem that I have is how I would go about setting the parameters for: RPG::MoveCommand.new(41, ['transform1'])

The original version in the Modules states:

Graphic = 41 # Name, hue, direction, pattern

There is also an example, but I don't quite understand it:

when PBMoveRoute::Graphic
route.list.push(RPG::MoveCommand.new(commands,
[commands[i+1],commands[i+2],commands[i+3],commands[i+4]]))
i+=4

Original thread: https://forums.rpgmakerweb.com/threads/changing-player-graphic-with-a-script-command.76312/