make boos and twomps only killable by hammer?

This is the place for discussion and support for LunaLua and related modifications and libraries.

Moderator: Userbase Moderators

Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?
Shadowblitz16
Swooper
Swooper
Posts: 62
Joined: Tue Aug 09, 2016 1:41 pm

make boos and twomps only killable by hammer?

Postby Shadowblitz16 » Thu Aug 11, 2016 9:48 pm

how do I edit the thwomps and boos so they can only be killed by the hammer projectile?

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: make boos and twomps only killable by hammer?

Postby PixelPest » Thu Aug 11, 2016 10:17 pm

I'd suggest using NPC.get() and NPC.getIntersecting() to check for collisions by other NPCs that can harm them (really only shells I think) and then either change their direction or despawn them before they collide

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9891
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: make boos and twomps only killable by hammer?

Postby Emral » Fri Aug 12, 2016 6:48 am

PixelPest wrote:I'd suggest using NPC.get() and NPC.getIntersecting() to check for collisions by other NPCs that can harm them (really only shells I think) and then either change their direction or despawn them before they collide
Too complicated. Just use onNPCKill and a getIntersecting ID check.

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: make boos and twomps only killable by hammer?

Postby PixelPest » Fri Aug 12, 2016 7:02 am

Enjl wrote:
PixelPest wrote:I'd suggest using NPC.get() and NPC.getIntersecting() to check for collisions by other NPCs that can harm them (really only shells I think) and then either change their direction or despawn them before they collide
Too complicated. Just use onNPCKill and a getIntersecting ID check.
But then wouldn't the Boo or Thwomp already be killed?

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: make boos and twomps only killable by hammer?

Postby Hoeloe » Fri Aug 12, 2016 7:09 am

PixelPest wrote:
Enjl wrote:
PixelPest wrote:I'd suggest using NPC.get() and NPC.getIntersecting() to check for collisions by other NPCs that can harm them (really only shells I think) and then either change their direction or despawn them before they collide
Too complicated. Just use onNPCKill and a getIntersecting ID check.
But then wouldn't the Boo or Thwomp already be killed?
Uhh no. That would defeat the whole point of onNPCKill if that were the case. onNPCKill runs juuust before the NPC is killed, and you can cancel the kill event to prevent it.

Shadowblitz16
Swooper
Swooper
Posts: 62
Joined: Tue Aug 09, 2016 1:41 pm

Re: make boos and twomps only killable by hammer?

Postby Shadowblitz16 » Fri Aug 12, 2016 8:00 pm

Hoeloe wrote:
PixelPest wrote:
Enjl wrote: Too complicated. Just use onNPCKill and a getIntersecting ID check.
But then wouldn't the Boo or Thwomp already be killed?
Uhh no. That would defeat the whole point of onNPCKill if that were the case. onNPCKill runs juuust before the NPC is killed, and you can cancel the kill event to prevent it.
how do I cancel the kill event?

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9891
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: make boos and twomps only killable by hammer?

Postby Emral » Fri Aug 12, 2016 8:06 pm



Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari