digitalbooty
New member
Anyone else having issues getting the player to activate it's idle animation while just standing without any input? I'm using the scrolling platform in case that makes a difference.
LDX player1_object
LDA Object_physics_byte,x
AND #%00000001 ; Are we in the air ?
BEQ SwitchToJump_Left
GetCurrentActionType player1_object
CMP #$01 ; Are we already walking ?
BEQ skipStateChange_Left
CMP #$03 ; Are we attacking ?
BEQ skipStateChange_Left
ChangeObjectState #$01, #$03
skipStateChange_Left:
StartMoving player1_object, MOVE_LEFT
FaceDirection player1_object, FACE_LEFT
RTS
SwitchToJump_Left:
GetCurrentActionType player1_object
CMP #$02 ; Are we already in jump animation ?
BEQ skipStateChange_Left
ChangeObjectState #$02, #$03
JMP skipStateChange_Left
LDX player1_object
LDA Object_physics_byte,x
AND #%00000001 ; Are we in the air ?
BEQ SwitchToJump_Right
GetCurrentActionType player1_object
CMP #$01 ; Are we already walking ?
BEQ skipStateChange_Right
CMP #$03 ; Are we attacking ?
BEQ skipStateChange_Right
ChangeObjectState #$01, #$03
skipStateChange_Right:
StartMoving player1_object, MOVE_RIGHT
FaceDirection player1_object, FACE_RIGHT
RTS
SwitchToJump_Right:
GetCurrentActionType player1_object
CMP #$02 ; Are we already in jump animation ?
BEQ skipStateChange_Right
ChangeObjectState #$02, #$03
JMP skipStateChange_Right
notInAir:
LDA Object_h_speed_lo,x
ORA Object_h_speed_hi,x
notInAir:
; add an extra "set to idle state" here for fixing jump state animation glitching.
ChangeObjectState #$00, #$03
LDA Object_h_speed_lo,x
ORA Object_h_speed_hi,x
Mugi said:go to project settings, script settings, and open Extra Controll Script:
at line 61, change this:
Code:notInAir: LDA Object_h_speed_lo,x ORA Object_h_speed_hi,x
to this:
Code:notInAir: ; add an extra "set to idle state" here for fixing jump state animation glitching. ChangeObjectState #$00, #$03 LDA Object_h_speed_lo,x ORA Object_h_speed_hi,x
ExtraInputControl:
;;; occasionally, there is input code that may be very specific, and it may be
;;; difficult to implement via the visual interface and accompanying scripts.
;;; this is a code that runs after all input checks, and allows for custom ASM.
LDA gameState
CMP #GS_MainGame
BEQ doMainGameUpdates
JMP skipMainGameExtraInputControl
doMainGameUpdates:
LDX player1_object
GetCurrentActionType player1_object
STA temp
LDA Object_physics_byte,x
AND #%00000010
BEQ isNotClimbing
LDA temp
CMP #$04
BNE isNotClimbing
LDA gamepad
AND #%11000000
BEQ noDirWhileClimbing
;ChangeObjectState #$02, #$04
noDirWhileClimbing:
; is climbing.
; which means don't check to change to idle.
JMP skipMainGameExtraInputControl
isNotClimbing:
LDA temp
CMP #$03 ;; is it shooting (shooting is same anim in air and on ground)
BNE isNotAttackingAction
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
JMP skipMainGameExtraInputControl
isNotAttackingAction:
LDA gamepad
AND #%11000000 ; left and right
BEQ dontskipMainGameExtraInputControl
JMP skipMainGameExtraInputControl
dontskipMainGameExtraInputControl:
; if left and right are not pressed
LDA screenFlags
AND #%00100000 ; does it use gravity?
; if it does not, it would not have jumping or ducking, so
; skip state updates for jumping and ducking.
BEQ notDucking ; just will change to idle.
LDA Object_physics_byte,x
AND #%00000001 ; if is in air
BNE notInAir
GetCurrentActionType player1_object
CMP #$02 ; is it already state 2?
BEQ skipMainGameExtraInputControl
ChangeObjectState #$02, #$04
JMP skipMainGameExtraInputControl
notInAir:
; add an extra "set to idle state" here for fixing jump state animation glitching.
ChangeObjectState #$00, #$03
LDA Object_h_speed_lo,x
ORA Object_h_speed_hi,x
BNE skipMainGameExtraInputControl
; controller is not pressed
; horizontal speed is zero.
; check to see if in air, shooting, etc.
; TO-DO: figure out what this is used for ??
; LDA gamepad
; AND #%00100000 ; if down is pressed
; BEQ notDucking
; ChangeObjectState #$05, #$04
; JMP skipMainGameExtraInputControl
notDucking:
LDA gamepad
AND #%11110000
BNE skipMainGameExtraInputControl
ChangeObjectState #$00, #$04
skipMainGameExtraInputControl:
RTS
ExtraInputControl:
;;; occasionally, there is input code that may be very specific, and it may be
;;; difficult to implement via the visual interface and accompanying scripts.
;;; this is a code that runs after all input checks, and allows for custom ASM.
LDA gameState
CMP #GS_MainGame
BEQ doMainGameUpdates
JMP skipMainGameExtraInputControl
doMainGameUpdates:
LDX player1_object
GetCurrentActionType player1_object
STA temp
LDA Object_physics_byte,x
AND #%00000010
BEQ isNotClimbing
LDA temp
CMP #$04
BNE isNotClimbing
LDA gamepad
AND #%11000000
BEQ noDirWhileClimbing
;ChangeObjectState #$02, #$04
noDirWhileClimbing:
; is climbing.
; which means don't check to change to idle.
JMP skipMainGameExtraInputControl
isNotClimbing:
LDA temp
CMP #$03 ;; is it shooting (shooting is same anim in air and on ground)
BNE isNotAttackingAction
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
JMP skipMainGameExtraInputControl
isNotAttackingAction:
LDA gamepad
AND #%11000000 ; left and right
BEQ dontskipMainGameExtraInputControl
JMP skipMainGameExtraInputControl
dontskipMainGameExtraInputControl:
; if left and right are not pressed
LDA screenFlags
AND #%00100000 ; does it use gravity?
; if it does not, it would not have jumping or ducking, so
; skip state updates for jumping and ducking.
BNE proceedFurther ; just will change to idle.
JMP notDucking
proceedFurther:
LDA Object_physics_byte,x
AND #%00000001 ; if is in air
BNE notInAir
GetCurrentActionType player1_object
CMP #$02 ; is it already state 2?
BNE proceedFurther2
RTS
proceedFurther2:
ChangeObjectState #$02, #$04
JMP skipMainGameExtraInputControl
notInAir:
; add an extra "set to idle state" here for fixing jump state animation glitching.
GetCurrentActionType player1_object
CMP #$05
BEQ skipMainGameExtraInputControl
ChangeObjectState #$00, #$03
LDA Object_h_speed_lo,x
ORA Object_h_speed_hi,x
BNE skipMainGameExtraInputControl
; controller is not pressed
; horizontal speed is zero.
; check to see if in air, shooting, etc.
; TO-DO: figure out what this is used for ??
LDA gamepad
AND #%00100000 ; if down is pressed
BEQ notDucking
ChangeObjectState #$05, #$04
JMP skipMainGameExtraInputControl
notDucking:
LDA gamepad
AND #%11110000
BNE skipMainGameExtraInputControl
ChangeObjectState #$00, #$04
skipMainGameExtraInputControl:
RTS
GetCurrentActionType player1_object
CMP #$05
BEQ skipMainGameExtraInputControl
notDucking:
LDA gamepad
AND #%11110000
BNE skipMainGameExtraInputControl
ChangeObjectState #$00, #$04
skipMainGameExtraInputControl:
RTS
skipMainGameExtraInputControl:
RTS
notDucking:
LDA gamepad
AND #%11110000
BNE skipMainGameExtraInputControl2
GetCurrentActionType player1_object ; check curren state
BEQ skipMainGameExtraInputControl2 ; if already 0, don't change it again.
ChangeObjectState #$00, #$04
skipMainGameExtraInputControl2:
RTS
GetCurrentActionType player1_object
CMP #$01
BEQ ++++++
ChangeObjectState #$01, #$04
++++++
GetCurrentActionType player1_object
CMP #$00
BEQ ++++++
ChangeObjectState #$00, #$04
++++++
dale_coop said:jermz, the "changeToIdleAnimation" and "changeToWalkingAnimation" are old scripts from previous version, they don't exists anymore in the 4.1 (and are obsolete). This leads me to this question: what version are you using? The 4.0 maybe?
Every versions of NESMaker have their own particularities, specificities, issues, ... an answer that work for the 4.1 would not work the the 4.0 and vice-versa.
So yep, if you are in 4.0 and having issues with animations... your answers are in the adventure module tutorial video for the 4.0 (on youtube) and your input editor links issues could find answers maybe here: http://nesmakers.com/viewtopic.php?t=533
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\ExtraControllReadCode.asm(50): Branch out of range.
ExtraInputControl:
;;; occasionally, there is input code that may be very specific, and it may be
;;; difficult to implement via the visual interface and accompanying scripts.
;;; this is a code that runs after all input checks, and allows for custom ASM.
LDA gameState
CMP #GS_MainGame
BEQ doMainGameUpdates
JMP skipMainGameExtraInputControl
doMainGameUpdates:
LDX player1_object
GetCurrentActionType player1_object
STA temp
LDA Object_physics_byte,x
AND #%00000010
BEQ isNotClimbing
LDA temp
CMP #$04
BNE isNotClimbing
LDA gamepad
AND #%11000000
BEQ noDirWhileClimbing
ChangeObjectState #$02, #$04
noDirWhileClimbing:
;;; is climbing.
;;; which means don't check to change to idle.
JMP skipMainGameExtraInputControl
isNotClimbing:
LDA temp
CMP #$03 ;; is it shooting (shooting is same anim in air and on ground)
BNE isNotAttackingAction
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
JMP skipMainGameExtraInputControl
isNotAttackingAction:
LDA gamepad
AND #%11000000 ;;; left and right
BEQ dontskipMainGameExtraInputControl
JMP skipMainGameExtraInputControl
dontskipMainGameExtraInputControl:
;;; if left and right are not pressed
LDA screenFlags
AND #%00100000 ;; does it use gravity?
;; if it does not, it would not have jumping or ducking, so
;; skip state updates for jumping and ducking.
BEQ notDucking ;; just will change to idle.
LDA Object_physics_byte,x
AND #%00000001 ;; if is in air
BNE notInAir
GetCurrentActionType player1_object
CMP #$02 ;; is it already state 2?
BEQ skipMainGameExtraInputControl
ChangeObjectState #$02, #$04
JMP skipMainGameExtraInputControl
notInAir:
; add an extra "set to idle state" here for fixing jump state animation glitching.
ChangeObjectState #$00, #$03
LDA Object_h_speed_lo,x
ORA Object_h_speed_hi,x
BNE skipMainGameExtraInputControl
;;;; controller is not pressed
;;;; horizontal speed is zero.
;; check to see if in air, shooting, etc.
LDA gamepad
AND #%00100000 ; if down is pressed
BEQ notDucking
ChangeObjectState #$5, #$04
JMP skipMainGameExtraInputControl
skipMainGameExtraInputControl:
RTS
notDucking:
LDA gamepad
AND #%11110000
BNE skipMainGameExtraInputControl2
GetCurrentActionType player1_object ; check curren state
BEQ skipMainGameExtraInputControl2 ; if already 0, don't change it again.
ChangeObjectState #$00, #$04
skipMainGameExtraInputControl2:
RTS