Idle animation not activating 4.1

Lother

Member
Ok, now when I export, I get this:
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\ExtraControllReadCode.asm(9): Unknown label.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\ExtraControllReadCode.asm(28): Unknown label.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\ExtraControllReadCode.asm(35): Unknown label.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\ExtraControllReadCode.asm(42): Unknown label.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\ExtraControllReadCode.asm(59): Unknown label.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\ExtraControllReadCode.asm(62): Unknown label.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\ExtraControllReadCode.asm(68): Unknown label.

Edit: I tried to replace every line like these:
Code:
skipMainGameExtraInputControl
by this:
Code:
skipMainGameExtraInputControl2

It does export correctly now, but my idle and jumping animation are the same as the beginning.

Edit 2: Alright, it works now (I forgot the bits of mandatory custom scripts) but I made a special animation for the Idle stance and it doesn't play (it stays stuck on the first frame of it)
 

dale_coop

Moderator
Staff member
Strange those errors... like if you had 2 scripts assigned to your project....???!!!
Could you share your script? And where is it assigned? In the "project settings > script settings"?
 

Lother

Member
The ExtraControllReadCode:

Code:
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

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 
    
    RTS

It is assigned here: Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\ExtraControllReadCode.asm

And as I said, I forgot to create the first two custom scripts of the very first post, I don't the unknown Labels anymore.

Edit: Ok, there's something odd. When I change screen (no scrolling) my character does play the Idle animation.... That's odd
 

Lother

Member
screen10.png


I think I didn't make any mistake here.

EDIT: Ok, so the animation plays in screens with no gravity, but when there is gravity the Idle just stays stuck.
 

dale_coop

Moderator
Staff member
Looks like you used Mugi's script?
His script is very specific... for his game. the reason you don't have the same results.
You should use the original script (that comes with NESMaker) and just change the end... with my modifications :
http://www.nesmakers.com/viewtopic.php?p=10294#p10294
 

Lother

Member
Yep that was that. It works perfectly now. So to recap:

Create the two custom scripts for Hold Left and Hold Right from Mugi's post then just add the modification brought by dale-coop to the base ExtraControllReadCode.asm
 

drexegar

Member
Lother said:
Yep that was that. It works perfectly now. So to recap:

Create the two custom scripts for Hold Left and Hold Right from Mugi's post then just add the modification brought by dale-coop to the base ExtraControllReadCode.asm

I just did the same, I used dale to get the stance to work again (my character doesn't have one but for the motorcycle the wheels was not moving so I decided it needs to work)
and then I took a few lines from mugi to get the falling to work correctly, Thanks guys!
 
Top Bottom