Weapon Stuns Enemy and Enemy Stunned Action State ?

TolerantX

Active member
Weapon Stuns Enemy and Enemy Stunned Action State:

Does anyone know how to and could possibly please explain the steps on how to create a weapon (*starting/first weapon) where the player could stun an enemy with a melee attack? I thought even though I could probably eventually figure this out, for others or future use it would be helpful to many people to be documented here. I also have no idea where to begin. I understand it would be changing the monster to a different action state and animation (*even if it is the same sprite for a countdown timer) then after a timer expires i would return to it's normal routine...
Please Help... Thank you.
(MODULE USED SIMPLE PLATFORMER)
 

dale_coop

Moderator
Staff member
If you are using the 2 player module... Check your HandleHurtMonster_DC.asm script... and search and comment out those lines (around line 14-something):
Code:
        ; LDA Object_status,x
        ; ORA #%00000001
        ; STA Object_status,x
        ; LDA #HURT_TIMER
        ; STA Object_timer_0,x
        ;;; assume idle is in step 0
        ; ChangeObjectState #$00,#$02

Then, around line 44-something, you'll see the line:
Code:
		JMP notMonsterDeath
Just before that line, add this code:
Code:
	;; stops the monster movements:
		LDA Object_movement,x
		AND #%00000111
		STA Object_movement,x
		;; set the monster action step 7:
		ChangeObjectState #$07,#$02
		
		JMP notMonsterDeath


Also, if you are using the sprite based weapon, you have to do the same in the "HandleSpriteWeapon_DC.asm" script... (commenting some lines around 104-something AND add smoe code line 134-soemthing before the "JMP notMonsterDeathSpriteWeapon").

It should work now.
 

TolerantX

Active member
unfortunately when I hit the monster it goes to that state but the knockback is infinite... (I'll send you the video. it's hilarious.)
 

dale_coop

Moderator
Staff member
Make sure your monster Object has a acceleration value set.
In the physic engine, "acceleration" defines the interia of an object... A small value will make the object slide.
Usually for monster we set a high value (close to "255").
 
Top Bottom