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

Post Reply
User avatar
dale_coop
Posts: 1629
Joined: Fri Feb 16, 2018 7:05 am
Location: France

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

Post by dale_coop » Thu Dec 06, 2018 3:03 pm

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: Select all

	LDX player1_object
	LDA Object_status,x
	AND #%00000100
	BEQ +
	LDA #$00
	SEC
	SBC #$04  ;; <-- jump value
	STA Object_v_speed_hi,x
	LDA Object_status,x
	AND #%11111011
	STA Object_status,x
+
	RTS

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

Image

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

Image

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

Image
(I'd recommand to use a timer value greater than 1 to give enough time for the jump)
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
Redherring32
Posts: 228
Joined: Sat Aug 11, 2018 2:48 pm
Location: Usa

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

Post by Redherring32 » Thu Dec 06, 2018 3:53 pm

This is really awesome!
Now I'm gonna have to make a monster that uses this.
User avatar
ZeGGamer1
Posts: 42
Joined: Thu Nov 29, 2018 11:26 pm

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

Post by ZeGGamer1 » Thu Dec 06, 2018 4:42 pm

Is it possible to turn this into a tile so that an enemy with a flag checked jumps when it touches it? (ie, the flagged enemy get's to an edge and touches the tile, jumping over the edge.)
User avatar
dale_coop
Posts: 1629
Joined: Fri Feb 16, 2018 7:05 am
Location: France

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

Post by dale_coop » Thu Dec 06, 2018 6:59 pm

I suppose, if you assign this script to a unused "Tile Collision XX" in the "Script settings" (and rename the corresponding Tile Type label) and make a tile with it... It could work.
You should modify the jump values the script (maybe 06 or 07) to have bigger jump,... over the edge.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
Redherring32
Posts: 228
Joined: Sat Aug 11, 2018 2:48 pm
Location: Usa

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

Post by Redherring32 » Thu Dec 06, 2018 7:04 pm

ZeGGamer1 wrote:
Thu Dec 06, 2018 4:42 pm
Is it possible to turn this into a tile so that an enemy with a flag checked jumps when it touches it? (ie, the flagged enemy get's to an edge and touches the tile, jumping over the edge.)
That's an awesome idea, if you figure out how to do it, I'd love to use it.
User avatar
ZeGGamer1
Posts: 42
Joined: Thu Nov 29, 2018 11:26 pm

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

Post by ZeGGamer1 » Thu Dec 06, 2018 8:32 pm

How did you do that? I'm mean I know how, but how did you code that?
User avatar
dale_coop
Posts: 1629
Joined: Fri Feb 16, 2018 7:05 am
Location: France

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

Post by dale_coop » Thu Dec 06, 2018 9:40 pm

I just assign the script to a unused « tile collision » in the Scripts Settings.
And used this new tile type to make a tile.
But any object would jump... even the player >_<
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
CutterCross
Posts: 288
Joined: Sat Apr 28, 2018 9:42 pm

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

Post by CutterCross » Thu Dec 06, 2018 10:01 pm

I made a similar AI Action script to make my boss change between different levels of altitude in The Tower of Turmoil ;)
The Tower of Turmoil: viewtopic.php?f=12&t=1348
User avatar
dale_coop
Posts: 1629
Joined: Fri Feb 16, 2018 7:05 am
Location: France

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

Post by dale_coop » Thu Dec 06, 2018 10:21 pm

CutterCross wrote:
Thu Dec 06, 2018 10:01 pm
I made a similar AI Action script to make my boss change between different levels of altitude in The Tower of Turmoil ;)
Yeah, ramember that. Your bosses were great!
This weekend I will flash the new version and try to beat the game this time (my wife will be out, I will have more time)
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
Post Reply