Player kills monster just by touching?

Post Reply
User avatar
Craigery
Posts: 30
Joined: Mon Apr 30, 2018 8:53 pm

Player kills monster just by touching?

Post by Craigery » Sat Sep 01, 2018 4:44 am

I have the monsters set to Jump On Kills, but if I just walk up to them I kill them too. If I get under a monster it will kill me as intended, but if I just stand still and they touch me they get killed. I have my player and monster bounding boxes set 1 pixel above the lowest pixels as the video instructed. I have watched the Player and Monster sections multiple times to match my settings, so I don't think that I have missed a step (but I've been wrong before). Anyone else encounter this or did I actually just miss something?
User avatar
dale_coop
Posts: 3721
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Player kills monster just by touching?

Post by dale_coop » Sat Sep 01, 2018 6:35 am

It happens because the code thank check if your player is jumping over the monster is not accurate.
It makes a comparaison beteeen the center of bounding box of both objects.
So if your player has a bounding box (even a little) higher then the monster. The script thinks he’s jumping on him. So he kills it.
Try to make modifications in bounding boxes and test.
;)
-----
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)
User avatar
Convoy_Avenger
Posts: 100
Joined: Tue Aug 14, 2018 1:42 am

Re: Player kills monster just by touching?

Post by Convoy_Avenger » Sun Sep 02, 2018 10:44 pm

I'm encountering the same problem. Any idea where this is handled in the scripts? Wondering if this can be adjusted and accounted for.
User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Player kills monster just by touching?

Post by WolfMerrik » Sun Sep 02, 2018 10:53 pm

Convoy_Avenger wrote:
Sun Sep 02, 2018 10:44 pm
I'm encountering the same problem. Any idea where this is handled in the scripts? Wondering if this can be adjusted and accounted for.
It is handled in HandleOnjectCollisions_Platform_Simple.as,

Search for jumpOnMonster
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
User avatar
Convoy_Avenger
Posts: 100
Joined: Tue Aug 14, 2018 1:42 am

Re: Player kills monster just by touching?

Post by Convoy_Avenger » Sun Sep 02, 2018 11:50 pm

WolfMerrik wrote:
Sun Sep 02, 2018 10:53 pm
Convoy_Avenger wrote:
Sun Sep 02, 2018 10:44 pm
I'm encountering the same problem. Any idea where this is handled in the scripts? Wondering if this can be adjusted and accounted for.
It is handled in HandleOnjectCollisions_Platform_Simple.as,

Search for jumpOnMonster
Sweet, that was enough for me to trouble shoot some answers.
For other people that may be looking:

The code was comparing selfCenterY to otherCenterY. If your character was a sprite taller than Other, this would result in your Y always*(Depending on the size of your bounding box, but likely) being taller, even when standing next to each other.

I first tried changing it to selfBottom cmp to otherTop, but this doesn't work because your bottom Y value will always be lower than their top Y value (Duh)

So I landed on this:

Code: Select all

LDA selfCenterY
CMP otherTop
User avatar
hairycarrot
Posts: 24
Joined: Sat Sep 01, 2018 4:38 pm

Re: Player kills monster just by touching?

Post by hairycarrot » Fri Oct 19, 2018 2:42 am

Why though?
your bottom Y value will always be lower than their top Y value
I was using your solution and it worked super great until I made a very short monster.
torseelos
Posts: 7
Joined: Sat Jan 05, 2019 12:44 am

Re: Player kills monster just by touching?

Post by torseelos » Mon Jan 07, 2019 4:03 pm

Related question for version 4.1.0: Are there Jump On Kills still? I can't find them in my Monsteranimation Info:
Image
If not, how do I still achieve the same result?
Thanks
stevecrucial
Posts: 2
Joined: Wed Jan 09, 2019 4:37 pm

Re: Player kills monster just by touching?

Post by stevecrucial » Wed Jan 09, 2019 11:09 pm

torseelos wrote:
Mon Jan 07, 2019 4:03 pm
Related question for version 4.1.0: Are there Jump On Kills still? I can't find them in my Monsteranimation Info:
Image
If not, how do I still achieve the same result?
Thanks
Yes, i'd like to know too. It looks like it's been taken out 4.1.0. How can we re-integrate the logic (and perhaps improve it)?
User avatar
dale_coop
Posts: 3721
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Player kills monster just by touching?

Post by dale_coop » Thu Jan 10, 2019 12:17 am

No, it's not in the modules that comes with the 4.1
It could be doable but would require lot of time, coding, to handle it correctly (I mean that the previous code had some issues with the collision detection).
-----
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)
User avatar
dale_coop
Posts: 3721
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Player kills monster just by touching?

Post by dale_coop » Thu Jan 10, 2019 12:44 pm

OK... spent some time (during my lunch time) to bring the "Jump On Kills" back for the platformer Module in 4.1
It's here:
http://nesmakers.com/viewtopic.php?f=3&t=1748
-----
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)
Post Reply