How can I make a friendly NPC that follows you around and attacks enemies?

Post here for help and support regarding LunaLua and SMBX2's libraries and features.

Moderator: Userbase Moderators

Chilly14
Snifit
Snifit
Posts: 236
Joined: Thu Jul 18, 2019 10:28 pm
Flair: wash your hands and stay at home
Pronouns: he/him

How can I make a friendly NPC that follows you around and attacks enemies?

Postby Chilly14 » Thu Nov 21, 2019 10:42 am

I'd like to have some kind of Toad that does the thing I said in the title.

Cedur
Link
Link
Posts: 7073
Joined: Tue Jun 28, 2016 10:14 am
Flair: I'm gone, for chess and minesweeper
Pronouns: he/him

Re: How can I make a friendly NPC that follows you around and attacks enemies?

Postby Cedur » Thu Nov 21, 2019 11:18 am

This will quite surely require high-level coding.

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

Re: How can I make a friendly NPC that follows you around and attacks enemies?

Postby Emral » Thu Nov 21, 2019 12:35 pm

If you don't know how to approach the code for this I cannot help you with the details. This is a mix of all the lunalua fundamentals applied in a logically sound manner (NPC scripting, state machines, colliders, interaction with environment, edge cases like the player climbing throughout an entire level), and the fine details depend on exactly what kind of code you have in mind.


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 34 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari