How to add a "Monster Jump" AI script [NESMaker 4.0.X - Module Platformer]

dale_coop

Moderator
Staff member
Hmm... you need to set your Action Step 0 to "advance" on End Action with a timer value (or "0" for a random timer value).... or set it for the end of animation, if you want the monsters jumps (goes to Action Step 1) at the end of the Action Step 0 animation.
 

red moon

Member
That did it Dale, I should have check that since that is how my other AI game objects are setup, thank you!

I made some videos so you could see...they have some serious jumping abilities!
I've adjusted the player jump perimeters and that was easy to track down - are the AI jump perimeters adjustable in the same way? I've looked
i the project setting under user variants but only see the player jump settings.

https://youtu.be/Tj8NhX5L74c
https://youtu.be/MfYzLJZQ-GE
 

Slime Stack

New member
Thanks for making this thread. I just messed around with the code originally posted with Notebook ++ and created a jump action for some enemy characters. This should be a stepping stone into more complex stuff. :D
 

DarthAT

Member
Version 4.5.9 - MetroidVania
Added Dale's code to the new script and attached it to my AI Behaviors. Set it to 01 in my monster action box, but monster not jumping (runs past action box 0) then monster just stands there in place.

Thoughts?
 

Attachments

  • code.PNG
    code.PNG
    8.5 KB · Views: 5
  • monster jump script.PNG
    monster jump script.PNG
    21.3 KB · Views: 5
  • monster action box.PNG
    monster action box.PNG
    14.6 KB · Views: 5

dale_coop

Moderator
Staff member
This tutorial was made for nesmaker 4.1
It won't work witht he newer version.
I think it could work, if you remove the last 3 lines (from the LDA object_status,x... to the STA object_status,x) :unsure:
 

Dietz33

Member
I thought it would be nice to add a "Jump" action for the monster's AI actions (my son wanted it for one of its monters)...
So I choose a very easy way to acheive that (just copyied the script of the player jump):

1) Make a new script "MonsterJump.asm" in the '\Routines\UserScripts\PlatformGame_Base\AiScripts" folder, with this:

Code:
    LDA #$00
    SEC
    SBC #$04  ;; <-- jump value
    STA Object_v_speed_hi,x
    LDA Object_status,x
    AND #%11111011
    STA Object_status,x


2) In the "Project settings > Script Settings", assign the "MonsterJump.asm" script to a unused AI Action (for example the "AI Action 10").

2018-12-06-15-58-45-Project-Settings.png


3) In the "Project settings > Project Labels", for the monster's "Action Types", rename the "AI_Behavior 10" to "10 - Monster Jump".

2018-12-06-15-59-24-Project-Settings.png


4) Now, you can use the action "Monster jump" for your monsters, in their Action Steps.

2018-12-06-15-59-58-Monster-Animation-Info.png

(I'd recommand to use a timer value greater than 1 to give enough time for the jump)
it didn't work for me in adventure module, but i did this and it behaves kinda like the jumping spiders in zelda. i just copied parts of the move random 8way-script and the jump-script an looked what it does. maybe there is room for improvement .
 

Attachments

  • jump.png
    jump.png
    18.6 KB · Views: 1

dale_coop

Moderator
Staff member
it didn't work for me in adventure module, but i did this and it behaves kinda like the jumping spiders in zelda. i just copied parts of the move random 8way-script and the jump-script an looked what it does. maybe there is room for improvement .

First, that tutorial was for the 4.0 version (not compatible with later versions of nesmaker). Second, you can "JUMP" without gravity. That works only for platformer modules (like specified in the title of the topic).
 
Top Bottom