mouse spirit
Well-known member
All i used was an input script (b_create_melee_weapon.asm) used with the B Button ,a user variable, and a Game Object (your object melee weapon).
This uses different actions in the same Game Object to be used as different looking weapons.
This is for graphical changes, but could help with other things.
This should work in the platformer module with NESmaker 4.1.5. but assumes that you already have a working object melee weapon, not sprite weapon.
1. Create a user variable in project settings.Name it
whatever you like but make it's value 0.
2. Open your melee object weapon input script.Go to around line 85 (probly). You will see CreateObject temp, blah blah....Erase that line and enter this...
3. Save your script.( That JMP to meleeCreated assumes that it is in your object melee script already.If not, just make sure to JMP to right after the code we just went over.)(Also I assume that you already are using constant OBJECT_PLAYER_MELEE)
4. Go to your first action of you melee object weapon Game Object, that action 0 now essentially represents weapon 1.Action 1 is weapon 2, and so on. Make graphics/animations accordingly and set your end animation/actions n stuff in each action step(like destroy at end step,if thats what you already have goin on with your weapon).
Our code we implimented changes the action state of object melee weapon to whatever your user variable currently equals.
This script is a simple check for 2 weapons.If you understand it,you can add as many weapons as actions for that weapon(8).If you want to change weapons,simply have a tile/collectable/whatever change the user variable you created. I have a collectable change my which_weapon variable (INC which_weapon).
Hope it works for you as it does for me. It should normally unless i made a typo in the code on here
This uses different actions in the same Game Object to be used as different looking weapons.
This is for graphical changes, but could help with other things.
This should work in the platformer module with NESmaker 4.1.5. but assumes that you already have a working object melee weapon, not sprite weapon.
1. Create a user variable in project settings.Name it
whatever you like but make it's value 0.
2. Open your melee object weapon input script.Go to around line 85 (probly). You will see CreateObject temp, blah blah....Erase that line and enter this...
Code:
;changing object melee weapon
LDA (your user variable)
CMP #$00
BEQ ++
JMP weap2
++
;;;weap1:
CreateObject temp, temp1 , #OBJECT_PLAYER_MELEE, #$00, temp3
JMP meleeCreated
weap2:
CreateObject temp, temp1 , #OBJECT_PLAYER_MELEE, #$01, temp3
3. Save your script.( That JMP to meleeCreated assumes that it is in your object melee script already.If not, just make sure to JMP to right after the code we just went over.)(Also I assume that you already are using constant OBJECT_PLAYER_MELEE)
4. Go to your first action of you melee object weapon Game Object, that action 0 now essentially represents weapon 1.Action 1 is weapon 2, and so on. Make graphics/animations accordingly and set your end animation/actions n stuff in each action step(like destroy at end step,if thats what you already have goin on with your weapon).
Our code we implimented changes the action state of object melee weapon to whatever your user variable currently equals.
This script is a simple check for 2 weapons.If you understand it,you can add as many weapons as actions for that weapon(8).If you want to change weapons,simply have a tile/collectable/whatever change the user variable you created. I have a collectable change my which_weapon variable (INC which_weapon).
Hope it works for you as it does for me. It should normally unless i made a typo in the code on here