Make the player facing in the moving direction

dale_coop

Moderator
Staff member
After having made your player, the animations for the 4 directions and set the "Animations" directions in the "Object Details" dialog... you "Export & test" and your realize that your player moves but the facing "animation" doesn't change!



As Joe explained on the tutorial video, with the current version of NESMaker, if you want your player facing in the direction of his movement, you need to add some code in the moving scripts...

You need to modify the 4 movement scripts "StartMovingPlayerUp.asm", "StartMovingPlayerRight.asm", "StartMovingPlayerLeft.asm" and "StartMovingPlayerDown.asm" from your "GameEngineData\Routines\UserScripts\BasicScripts\MovementScripts\" folder.

First, open the "StartMovingPlayerUp.asm" script, and modify it to add those lines:
Code:
    StartMoving player1_object, MOVE_UP
	;; making the player facing UP 
	LDX player1_object
	LDA Object_movement,x
	ORA #DIR_UP
	STA Object_movement,x
	
    RTS

Just repeat the same modification for other scripts, replacing #DIR_UP by #DIR_RIGHT, #DIR_LEFT and #DIR_DOWN
 

MistSonata

Moderator
Actually, you can simply replace the MovementScripts files with the ones I posted here: http://nesmakers.com/viewtopic.php?f=19&t=390
 

SeaFoodAndButter

New member
So, I used MistSonata's fixed movement script and now my character will move and face 4 directions. (e.g., If I press and hold down he faces forwards and moves down, if I release, he stops moving and still faces down; if I press and hold up, he turns around and moves up until I release, same for right and left). This is progress from a few days ago. (TY MistSonata!) However, his animations aren't showing up so it looks like he's floating up, down, left, and right...
 

SeaFoodAndButter

New member
Ok, I realized I was missing 2 movement scripts: 1) Change to Idle animation and 2) change to walking animation. I will try and fumble through these and I think if I can figure it out, it will solve my issue. (Remember, I'm a noob so any help is appreciated!)
 
WOW, and all this time i was banging my head against the desk over this, re watching 93285798 tutorials over and over for a step i have missed, i had a hunch this program is broken.

Could someone make a list of other thing that are broken or missing? because at the state this program is in now, i cant really do anything with it and its just frustrating, even more so now that i know that theres no way to know if its something i did wrong or something missing from it.

Imma just wait for a few more releases and hope all these issues get fixed....
 

dale_coop

Moderator
Staff member
I understand it’s quite frustrating...

I think for a good start first, anyone should:
- get the fixed movements scripts from here: http://nesmakers.com/viewtopic.php?f=19&t=390
- modify the « ChangeToIdleAnimations »  script to be like like: http://nesmakers.com/viewtopic.php?p=2507#p2507
- fix the warp type tiles: http://nesmakers.com/viewtopic.php?p=2495#p2495
- fix the music not playing when player go to another screen: http://nesmakers.com/viewtopic.php?p=2472#p2472
- not use path, quite buggy
- if memory issues, keep an eye on that: http://nesmakers.com/viewtopic.php?f=19&t=353

AND of course, FIRST of all, whatch the tutorials :
- here: http://nesmakers.com/viewtopic.php?f=18&t=346
- and this one: https://youtu.be/N31cfM2l0RA
 

SeaFoodAndButter

New member
SuperMar10Brothe said:
WOW, and all this time i was banging my head against the desk over this, re watching 93285798 tutorials over and over for a step i have missed, i had a hunch this program is broken.

Could someone make a list of other thing that are broken or missing? because at the state this program is in now, i cant really do anything with it and its just frustrating, even more so now that i know that theres no way to know if its something i did wrong or something missing from it.

Imma just wait for a few more releases and hope all these issues get fixed....

Yeah, some things need fixing, but you can still use it. Look what I did in one day, after I fixed some things.
https://www.youtube.com/watch?v=LfhQqNZxVuM&t=7s
 
I think something else is still broken or missing, or the video tutorials are missing a step or two. idle animation plays fine but cant get the walk animation to play while moving left or right, it remains frozen on the first frame of walk animation till i release the key and it stops moving left or right and goes back to idle.

heres character animation test setup

nTA1vNs.png


idle animation plays fine
moving left or right displays the correct sprite that faces correct direction but the animation is frozen on first frame until i release left or right.

what am i doing wrong?
 

SeaFoodAndButter

New member
SuperMar10Brothe said:
I think something else is still broken or missing, or the video tutorials are missing a step or two. idle animation plays fine but cant get the walk animation to play while moving left or right, it remains frozen on the first frame of walk animation till i release the key and it stops moving left or right and goes back to idle.

heres character animation test setup

nTA1vNs.png


idle animation plays fine
moving left or right displays the correct sprite that faces correct direction but the animation is frozen on first frame until i release left or right.

what am i doing wrong?

You need at least 16 scripts to do what you want to do. But you only have 8. look at my screen shot, you need these, minimum.
 

Attachments

  • Screenshot 2018-08-13 11.57.52.png
    Screenshot 2018-08-13 11.57.52.png
    1.5 MB · Views: 1,479
why do i need scripts that are not related to what i want to do? i only need my character to move left and right, i have all the necessary scripts in place, hold move left/right, release stop left/right, hold walk anim left/right and release idle anim left/right. I fail to see how having scripts for moving up and down can make the animation play for moving left and right.

Im gonna try it anyway though, so thanks for the tip

Edit:

i added the rest of the scripts, now i can walk up and down too, animation is still not playing.
 

tornotlukin

Member
There looks to be a snippet of code that has to be included in the top down directional movement ASM files. (It is located at 1:44 in the launch video). Dale_coop just gave me the link:

http://nesmakers.com/viewtopic.php?f=3&t=389
 
Top Bottom