Weapon Stuns Enemy and Enemy Stunned Action State ?

Post Reply
User avatar
TolerantX
Posts: 68
Joined: Fri Jan 18, 2019 7:58 am

Weapon Stuns Enemy and Enemy Stunned Action State ?

Post by TolerantX » Sun Dec 08, 2019 4:12 pm

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)
User avatar
dale_coop
Posts: 5601
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Weapon Stuns Enemy and Enemy Stunned Action State ?

Post by dale_coop » Fri Dec 20, 2019 10:43 am

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

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

		JMP notMonsterDeath
Just before that line, add this code:

Code: Select all

	;; 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.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
My son's game: KUBO 3
User avatar
TolerantX
Posts: 68
Joined: Fri Jan 18, 2019 7:58 am

Re: Weapon Stuns Enemy and Enemy Stunned Action State ?

Post by TolerantX » Tue Jan 07, 2020 9:21 pm

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.)
User avatar
dale_coop
Posts: 5601
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Weapon Stuns Enemy and Enemy Stunned Action State ?

Post by dale_coop » Wed Jan 08, 2020 9:39 am

I'll check that today... It could a bug in my (2 player module) code.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
My son's game: KUBO 3
User avatar
dale_coop
Posts: 5601
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Weapon Stuns Enemy and Enemy Stunned Action State ?

Post by dale_coop » Wed Jan 08, 2020 10:19 am

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").
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
My son's game: KUBO 3
User avatar
TolerantX
Posts: 68
Joined: Fri Jan 18, 2019 7:58 am

Re: Weapon Stuns Enemy and Enemy Stunned Action State ?

Post by TolerantX » Wed Jan 08, 2020 8:18 pm

Thank you. This helped a lot. It fixed my problem. :)
Post Reply