1/ Add a new "User Constant" in the "Script Settings > User Constants" tab, name it "OBJ_PLAYER_XTRA" and give it the value of the object index you want to use for your Player to switch to, for this example, I used "14".
But HERE, you can change to any object index you want to use to with! (monster objects start from 16).
2/ Make a script named for example "SwithPlayerToXtraObject.asm", with this code:
Code: Select all
;; change character to OBJ_PLAYER_XTRA switchPlayerXTRA LDX player1_object LDA Object_x_hi,x STA newX LDA Object_y_hi,x STA newY DeactivateCurrentObject LDA playerToSpawn BEQ goSwitchingPlayerXTRA ;; put back tehe initial player object LDA #$00 JMP continueSwitchingPlayerXTRA goSwitchingPlayerXTRA: ;; we use another one : LDA #OBJ_PLAYER_XTRA continueSwitchingPlayerXTRA: STA playerToSpawn CreateObject newX, newY, playerToSpawn, #$00, currentNametable TXA STA player1_object ;PlaySound #SND_TRANSFORM RTS
3/ Add this script to your "Input Scripts" and add this script to the "PRESS" "Select" button for example. When you press select it switch the character (more fast one, or invincible one, ...)!
Voilà, it's just a small test script, do whatever you want with it.
In fact, I would not recommend to use this script
In your great game, because it’s full of bug
Need to work more on that before being useable.