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.
User avatar
Chilly14
Swooper
Swooper
Posts: 100
Joined: Thu Jul 18, 2019 10:28 pm
Current Project: Lots
Chat Username: Chilly Bean BAM!

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.
Image
For the love of god, please use an adblocker when using MediaFire to download my stuff.
My stuff:
Spoiler: show
Image
Image
I support:
Spoiler: show
Image

User avatar
Cedur
Blue Yoshi Egg
Blue Yoshi Egg
Posts: 5343
Joined: Tue Jun 28, 2016 10:14 am
Flair: Save climate, cut fridays for whole-week future
Current Project: various playthroughs and tests

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.
Image
More Supports: show

Image
Image

Still using the legacy editor? Get SMBX2 and PGE, it will improve your experience significantly. Here's why.

iphtechnologies wrote: NEO super mario world x is a really nice game. This Episode is 2,7 GB large at the moment.That`s crazy!
Please find similar post:
[ads]

User avatar
Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 7801
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

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

Postby Enjl » 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.
ImageImageImageImage
ImageImageImageImageImageImage


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 2 guests