Page 1 of 1

Player kills monster just by touching?

Posted: Sat Sep 01, 2018 4:44 am
by Craigery
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?

Re: Player kills monster just by touching?

Posted: Sat Sep 01, 2018 6:35 am
by dale_coop
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.
;)

Re: Player kills monster just by touching?

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

Re: Player kills monster just by touching?

Posted: Sun Sep 02, 2018 10:53 pm
by WolfMerrik
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

Re: Player kills monster just by touching?

Posted: Sun Sep 02, 2018 11:50 pm
by Convoy_Avenger
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

Re: Player kills monster just by touching?

Posted: Fri Oct 19, 2018 2:42 am
by hairycarrot
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.

Re: Player kills monster just by touching?

Posted: Mon Jan 07, 2019 4:03 pm
by torseelos
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

Re: Player kills monster just by touching?

Posted: Wed Jan 09, 2019 11:09 pm
by stevecrucial
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)?

Re: Player kills monster just by touching?

Posted: Thu Jan 10, 2019 12:17 am
by dale_coop
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).

Re: Player kills monster just by touching?

Posted: Thu Jan 10, 2019 12:44 pm
by dale_coop
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