LunaLua Request: Entering Combat (Earthbound)

This is the place for discussion and support for LunaLua and related modifications and libraries.
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?
Devan2002
Ripper II
Ripper II
Posts: 304
Joined: Sun Oct 02, 2016 9:46 am

LunaLua Request: Entering Combat (Earthbound)

Postby Devan2002 » Wed Aug 01, 2018 10:15 pm

Basically, I want it like, if an enemy approaches you from behind, it sends you to a different section than if you were to approach the enemy from behind (and different if neither approach each other from behind).


To make things simple here's how it should work:

If an enemy walks in range of the player when their back is facing towards them (activate a trigger)

If an enemy walks in range of the player when their back is facing away from them, or if the player and enemy collide with each other (activate a different trigger)

If the player walks into an enemy while they're moving in the direction that is away from the player (activate a trigger different from the other 2)


After I'm done with my current project, I may work with an Earthbound project.

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

Re: LunaLua Request: Entering Combat (Earthbound)

Postby PixelPest » Wed Aug 01, 2018 10:28 pm

So just to be clear, you're asking someone to help you with code for a project that you haven't started and that you might only possibly do in the future?

Anyway, just in a vague sense, you basically need to check if the player's direction and the NPC's direction are the same, and then check their positions relative to each other. You can use colliders.collideNPC to determine if an NPC collides with the player object. Not sure about your level of LunaLua experience so someone else (or I) can elaborate as needed

Devan2002
Ripper II
Ripper II
Posts: 304
Joined: Sun Oct 02, 2016 9:46 am

Re: LunaLua Request: Entering Combat (Earthbound)

Postby Devan2002 » Wed Aug 01, 2018 10:32 pm

PixelPest wrote:
Wed Aug 01, 2018 10:28 pm
So just to be clear, you're asking someone to help you with code for a project that you haven't started and that you might only possibly do in the future?
Yeah, I had this idea just out of curiousity, and if someone had the time to do it, I'd probably make a project about it. Perhaps someone else could even use it if they really wanted an Earthbound/Mother episode in SMBX.
PixelPest wrote:Not sure about your level of LunaLua experience so someone else (or I) can elaborate as needed
I have no experience with using LunaLua, all I know is that you place it in your level folder and it works (putting the code you want in it), unless of course, something doesn't go right.

hacheipe399
Bit
Bit
Posts: 64
Joined: Mon Feb 10, 2014 12:29 pm

Re: LunaLua Request: Entering Combat (Earthbound)

Postby hacheipe399 » Wed Aug 08, 2018 8:39 pm

Do you have a video of the original game where the mechanic is functioning?

Devan2002
Ripper II
Ripper II
Posts: 304
Joined: Sun Oct 02, 2016 9:46 am

Re: LunaLua Request: Entering Combat (Earthbound)

Postby Devan2002 » Wed Aug 08, 2018 11:41 pm

hacheipe399 wrote:
Wed Aug 08, 2018 8:39 pm
Do you have a video of the original game where the mechanic is functioning?
There is a green screen of it:


But if you want the colors:

Enemy approaches you from behind: Red
Both you and enemy collide: Blue
Player approaches enemy from behind: Green

Boss Fight: Blue

This is particularly to show what shade of red, blue, and green they are:



This sound effect plays whenever a red spiral appears:

hacheipe399
Bit
Bit
Posts: 64
Joined: Mon Feb 10, 2014 12:29 pm

Re: LunaLua Request: Entering Combat (Earthbound)

Postby hacheipe399 » Thu Aug 09, 2018 3:19 pm

I'm sure that something like this is better to be implemented on the world map. However, I did a little test and the main algorithm is done. It spawns koopa shells in the colour it should and play different sound effects from the game. I left commented lines if you manage to find the swirls in gif format so you can load them. Just make a level and place a SMW Blue Koopa to test with, if you want to change it to a fireflower for example, go to line 15 and change the ID in NPC.get().

Download it
Tell me if this suits you.

Devan2002
Ripper II
Ripper II
Posts: 304
Joined: Sun Oct 02, 2016 9:46 am

Re: LunaLua Request: Entering Combat (Earthbound)

Postby Devan2002 » Fri Aug 10, 2018 12:50 pm

hacheipe399 wrote:
Thu Aug 09, 2018 3:19 pm
I'm sure that something like this is better to be implemented on the world map. However, I did a little test and the main algorithm is done. It spawns koopa shells in the colour it should and play different sound effects from the game. I left commented lines if you manage to find the swirls in gif format so you can load them. Just make a level and place a SMW Blue Koopa to test with, if you want to change it to a fireflower for example, go to line 15 and change the ID in NPC.get().

Download it
Tell me if this suits you.
I've never really used LunaLua, after putting the zip you posted in a test folder, and using SMBX 2.0, the level wouldn't load due to "SMBX with LunaLua is not running"

hacheipe399
Bit
Bit
Posts: 64
Joined: Mon Feb 10, 2014 12:29 pm

Re: LunaLua Request: Entering Combat (Earthbound)

Postby hacheipe399 » Fri Aug 10, 2018 1:04 pm

Devan2002 wrote:
Fri Aug 10, 2018 12:50 pm
I've never really used LunaLua, after putting the zip you posted in a test folder, and using SMBX 2.0, the level wouldn't load due to "SMBX with LunaLua is not running"
Strange. Make a level (for example: "Earthbound level.lvl"), and then make a folder called Earthbound level (the exact name of the lvl file). The place the lunadll.lua and the sounds inside the folder you created.

Devan2002
Ripper II
Ripper II
Posts: 304
Joined: Sun Oct 02, 2016 9:46 am

Re: LunaLua Request: Entering Combat (Earthbound)

Postby Devan2002 » Fri Aug 10, 2018 1:10 pm

This is what's in my folder:
Image

Though one thing, why are the .wav files in a higher pitch sound?

hacheipe399
Bit
Bit
Posts: 64
Joined: Mon Feb 10, 2014 12:29 pm

Re: LunaLua Request: Entering Combat (Earthbound)

Postby hacheipe399 » Fri Aug 10, 2018 1:33 pm

Devan2002 wrote:
Fri Aug 10, 2018 1:10 pm
Though one thing, why are the .wav files in a higher pitch sound?
High pitch or high volume? I know they're very loud. In the lunadll.lua file is the code I wrote, the luna.lua file created by the editor isn't needed.
This is the structure you need:
/folder where your levels are/yourlevel.lvl
/folder where your levels are/yourlevel/lunadll.lua
/folder where your levels are/yourlevel/eb_ambush.wav
/folder where your levels are/yourlevel/eb_behind.wav
/folder where your levels are/yourlevel/eb_boss.wav
/folder where your levels are/yourlevel/any-custom-graphic.gif
The lunadll.lua and the sounds need to be where you store the custom graphics for the each level.

Devan2002
Ripper II
Ripper II
Posts: 304
Joined: Sun Oct 02, 2016 9:46 am

Re: LunaLua Request: Entering Combat (Earthbound)

Postby Devan2002 » Fri Aug 10, 2018 1:39 pm

It's higher pitch.


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari