Switch Characters/Change player to different Game Object midgame 4.1.5 (easy)

mouse spirit

Well-known member
All i used was an input script used with the Select Button,a user constant, and an object. Press Select to switch! You could have a different character or even get turned into a blob?! (If you want to)

This should work in the platformer module with NESmaker 4.1.5.

1. Create a user constant in project settings.Name it
whatever you like but make it's value equal to your new player objects postion in the line up in Game Objects.(mine is object 15, so i made my value 15)

It would be best to export your Player Game Object, then import it in the Game Object that you want to be character two. That way when you change you essentially won't notice(ha), but then edit that new object to your liking and then you will notice when we are done.This way you basically copy your player object and the way it works instead of rebuilding it.But you don't have to...

2. Make a new asm script.Name it what you like, it will be an input script so place it in the appropriate folder for when we import it.
Code:
;changing characters
TXA
STA tempx
TYA
STA tempy

LDX player1_object
LDA Object_x_hi,x
STA temp
LDA Object_y_hi,x
STA temp1

DeactivateCurrentObject

CreateObject temp, temp1 #(your user constant), #$00, currentNametable

LDX tempx
LDY tempy

3. Save that script and import as an input script and assign it to the Select Button.(You could actually import this as a collectable script or probly a tile script.)

Hope it works for you as it does for me. It should normally unless i made a typo in the code on here.
 

mouse spirit

Well-known member
Oh my goodness you're right dale_coop, i did forget that one. It is a great tutorial and you're cowboy turtle guy is amazing.
 

Necrozys

Member
All i used was an input script used with the Select Button,a user constant, and an object. Press Select to switch! You could have a different character or even get turned into a blob?! (If you want to)

This should work in the platformer module with NESmaker 4.1.5.

1. Create a user constant in project settings.Name it
whatever you like but make it's value equal to your new player objects postion in the line up in Game Objects.(mine is object 15, so i made my value 15)

It would be best to export your Player Game Object, then import it in the Game Object that you want to be character two. That way when you change you essentially won't notice(ha), but then edit that new object to your liking and then you will notice when we are done.This way you basically copy your player object and the way it works instead of rebuilding it.But you don't have to...

2. Make a new asm script.Name it what you like, it will be an input script so place it in the appropriate folder for when we import it.
Code:
;changing characters
TXA
STA tempx
TYA
STA tempy

LDX player1_object
LDA Object_x_hi,x
STA temp
LDA Object_y_hi,x
STA temp1

DeactivateCurrentObject

CreateObject temp, temp1 #(your user constant), #$00, currentNametable

LDX tempx
LDY tempy

3. Save that script and import as an input script and assign it to the Select Button.(You could actually import this as a collectable script or probly a tile script.)

Hope it works for you as it does for me. It should normally unless i made a typo in the code on here.
Hey there! I tried to asign this script to a tile but it doesn't seem to work. Do I have to do some changes for it to work in a tile script? I am using version 4.5.6 and the adventure module. I want my player to change into another object when he touches a certain tile. Thanks in advance for the help!
 

mouse spirit

Well-known member
Yeah 4.1 and 4.5 code has different stuff to it. It wont just translate without some
editing and such.Sorry.
 

dale_coop

Moderator
Staff member
Top Bottom