dale_coop said:11/ Last thing, you should do a small modification in your StartMovingPlayerxxx script, just moving the "++" from before the "FaceDirection" line, to AFTER "FaceDirection" line.
For exemple, StartMovingPlayerRight.Asm should be like this :
Code:;;;;; START MOVING PLAYER RIGHT: ;;;;; We will use this when the right button is pressed. ;;;;; If we are already showing the walking animation, which is for this module ;;;;; action step 1, we will skip changing to the walking state. LDX player1_object GetCurrentActionType player1_object CMP #$02 ;; if the state is invincible BEQ ++ ; skip movement if attacking CMP #$03 BEQ ++ ;skip if we are casting spell CMP #$01 BEQ + ;; if the action type already equals 1, jump forward ChangeObjectState #$01, #$04 + ;;;;;; Then, we will begin moving. StartMoving player1_object, MOVE_RIGHT ;;;;;; Lastly, we will change the facing direction. FaceDirection player1_object, FACE_RIGHT ++ RTS
VoilĂ , your Melee weapon should work as expected...
Note: you should get rid of your GetSword pickup object, make it a health pickup or anything else you want (change the script assign to the "Power Up 00" in the "Project Settings > Script Settings").
rimoJO said:...What hex-number-code-digit-converter-adapter-file plugin? I don't see one. Not in NESM, nor in the NESM folder. And I'm really bad with hex.
???
rimoJO said:...
Is there any way to have a projectile in a platform game? I watched the tutorial but it was for the old NESM version. The game also wouldn't export. Maybe I used the wrong script...? (a_create_projectile)... I also tried searching it, but it said that "projectile platform" is too commonly used.
???
WillElm said:rimoJO said:...
Is there any way to have a projectile in a platform game? I watched the tutorial but it was for the old NESM version. The game also wouldn't export. Maybe I used the wrong script...? (a_create_projectile)... I also tried searching it, but it said that "projectile platform" is too commonly used.
???
Right now I'm doing this by using this melee script, the only difference is that I have the object the melee script creates use the Shoot Forward AI action, which in turn creates the projectile.
I'm sure there's a simpler way but this works. I have it affected by gravity, so it's like a secondary throw holy water attack. You could probably have it shoot straight if you have the projectile ignore gravity, which might require you to change some things.
The fix ignore gravity thread: http://nesmakers.com/viewtopic.php?f=35&t=1939&p=13785&hilit=ignore+gravity#p13785
;(omitted rest)
CreateObject temp, temp1, #OBJECT_PLAYER_MELEE, #$00, temp3
meleeCreated:
;;;; x is now the newly created object's x.
STX player1_weapon ; <---- Actually store the object at player1_weapon for later reference
LDA Object_movement,x
ORA temp2
STA Object_movement,x
PlaySound #SND_ATTACK
; (omitted rest)
GetCurrentActionType player1_object
CMP #$03 ; <-- Attack
BNE done ; This label jumps passed Oracle's code
Mugi said:well for starters, it should be #$00, not #&00
sans that, does the #OBJECT_PLAYER_MELEE constant exist ?
dale_coop said:Which version of NESmaker are you? 4.1.5? What module are you using? Platformer? Adventure?
For the "OBJECT_PLAYER_MELEE" constant... check the 1/ of my tutorial.
LDA gameHandler
AND #%00100000
BEQ notNPCstate_attack
JMP doneAttacking
notNPCstate_attack:
LDA weaponsUnlocked
AND #%00000001
BNE canAttack
JMP doneAttacking
canAttack:
LDX player1_object
GetCurrentActionType player1_object
CMP #$03
BNE notAlreadyAttacking
JMP doneAttacking
notAlreadyAttacking:
;;; don't attack if already attacking.
;;; do we have to check for hurt here?
;;;;; Here, we WOULD create melee
ChangeObjectState #$00, #$03
LDA Object_movement,x
AND #%00001111
STA Object_movement,x
LDA #$00
STA Object_h_speed_hi,x
STA Object_h_speed_lo,x
STA Object_v_speed_hi,x
STA Object_v_speed_lo,x
LDA Object_x_hi,x
STA temp
LDA Object_y_hi,x
STA temp1
LDA Object_movement,x
AND #%00000111
STA temp2
TAY
LDA Object_x_hi,x
SEC
SBC #$10 ;; width of melee weapon (="16" in decimal = 2 tiles)
STA temp
LDA Object_scroll,x
SBC #$00
STA temp3
LDA temp
;;; offset x for creation
CLC
ADC weaponOffsetTableX,y
STA temp
LDA temp3
ADC #$00
STA temp3
LDA Object_y_hi,x
CLC
ADC weaponOffsetTableY,y
SEC
SBC #$10 ;; height of melee weapon (1 tile)
STA temp1
CreateObject temp, temp1, #OBJECT_PLAYER_MELEE, #$00, temp3
meleeCreated:
;;;; x is now the newly created object's x.
LDA Object_movement,x
ORA temp2
STA Object_movement,x
;;; PlaySound #sfx_slash
doneAttacking:
RTS