New account registration is temporarily disabled.

[RMXP] CHANGING SPRITE WHEN HITTING WALLS/OBJECTS

Posts

Pages: 1
(English is not my native tongue)

Hi, I really need help for my project. I wanna use a feature in "Zelda : Link's awakening" that's when the hero hits an object or a wall, the sprite changes like this. And when we release the key, so when the hero stops pushing the sprite come back to the original one. I prefer to do this as a script but I don't know what to change/add in the RPG XP scripts. Can someone help me please ? :)
Hi,

here's something you can try in script, hopefully it is what you wanted.

first, go to Game_Player (make sure to backup the script page)
then, right after the first end after the line that contains the term Input::C, add this (the green text explains what the line above does and what you need to do):



What this add does is that when the sprite is facing an unpassable tile, when you press the shift key, sprite will change to sprite_a and when shift key is released, it will be changed back.

Afterwards, for the movable event, add a conditional branch event outside of whatever event you use to move the event and use the script condition:
Input.press?(Input::SHIFT)
So it will only be moved if you are interacting with it while pressing shift.

The downside for this edit is that whenever the player moves onto facing an unpassable tile, the sprite will change back to that of the first actor in party, so if you want to change the graphic into a different one, it may be preferable to use the event "change actor graphic" over the "set move route", and with that, you need to make a copy of the sprite file with "_a" added at the end like the example above to prevent error. It is possible to edit script in Game_Temp to create a temporary variable that stores the file name of the changed sprite, then add a condition to this script to bypass this problem.

There is also the problem that the sprite only repeat the play first two frames the move animation when pushing, which I don't know how to resolve at the moment.
Pages: 1