Killevent for Koopa Troopas (id4)?

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?
seiteom
Goomba
Goomba
Posts: 4
Joined: Mon Jun 27, 2016 5:59 pm

Killevent for Koopa Troopas (id4)?

Postby seiteom » Mon Jan 01, 2018 3:32 pm

Hi!

I am using LunaLua to make a few changes to NPC id=4, the koopa troopas. Succeeded overall, but not figured out how to deal with the onNPCKill () event for these creatures. Seems that if you jump on them, they actually have no kill event. Are they turned into shells instead (id 5)? If so, are there any offset values that indicate this shift? Put simply, I want to be able to cancel any kill event and allow the koopa troopas better health. I've tried to turn any new shells into koopa troopas (NPC.id=4), but am not entirely happy with the results.

Hope someone knows a resolution.

Best /A
Last edited by seiteom on Mon Jan 01, 2018 5:12 pm, edited 1 time in total.

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

Re: Killevent for Koopa Troopas (id4)?

Postby Emral » Mon Jan 01, 2018 3:35 pm

I suggest using a non-koopa npc that dies when jumped on as your koopa replacement and then turning it into a shell manually once the excess HP has been depleted. You could use the SMB1 goombas, for example. It requires a bit of manipulating NPC txt files, but there's currently no way to easily find that ID change. There are solutions, but they're much more complex and prone to error than using a different ID for the walking koopa.

seiteom
Goomba
Goomba
Posts: 4
Joined: Mon Jun 27, 2016 5:59 pm

Re: Killevent for Koopa Troopas (id4)?

Postby seiteom » Mon Jan 01, 2018 5:11 pm

Thank you for your reply, Enji! Yes, I think you are right - better to fall back on an easier solution than to overwork a more complicated one.

Out of curiosity, and if you have time, could you please hint at the complicated way to - I assume - identify the koopa to shell shift? Always eager to learn new things about Lua.

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

Re: Killevent for Koopa Troopas (id4)?

Postby Emral » Mon Jan 01, 2018 7:14 pm

seiteom wrote:Thank you for your reply, Enji! Yes, I think you are right - better to fall back on an easier solution than to overwork a more complicated one.

Out of curiosity, and if you have time, could you please hint at the complicated way to - I assume - identify the koopa to shell shift? Always eager to learn new things about Lua.
You can check the HP variable of the koopa after it transformed by constantly being on the lookout for that variable when looping over all shells (and then immediately transforming them back as you catch one). It's incredibly wasteful performance-wise and seems like the kind of solution that has a dozen warnings attached to it beyond that.


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 3 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari