Need help with lua? - LunaLua General Help

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?
PixelPest
Link
Link
Posts: 7116
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: Need help with lua? - LunaLua General Help

Postby PixelPest » Sat Nov 26, 2016 8:37 am

I'd suggest that the while loop is possibly running infinitely. Try replacing it with an if statement both times it appears in maskSpawner()

User avatar
DeMuZ
Bob-omb
Bob-omb
Posts: 37
Joined: Thu Aug 18, 2016 2:35 pm
Current Project: The Episode of Nonsense series

Re: Need help with lua? - LunaLua General Help

Postby DeMuZ » Sat Nov 26, 2016 9:19 am

It worked! I'm always making code too complicated. xD

pal4
Fighter Fly
Fighter Fly
Posts: 63
Joined: Wed Dec 23, 2015 7:57 pm

Re: Need help with lua? - LunaLua General Help

Postby pal4 » Sun Nov 27, 2016 1:44 pm

Is there a lunalua code for spawning/shooting other npcs and projectiles? I can't find a list to confirm this.

loop13
Eerie
Eerie
Posts: 980
Joined: Sun Apr 17, 2016 5:56 pm
Flair: I mainly play Celeste nowadays
Current Project: failing English IV
Chat Username: loop13uh

Re: Need help with lua? - LunaLua General Help

Postby loop13 » Sun Nov 27, 2016 1:51 pm

I have a topic here.
This was an attempt to change Birdo eggs into Rinkas. I never tested it, so it might not work.
Hello, I make a lot of typos
specific people know my whereabouts though

my wifi is as useful as a brick

im more active on discord

:idea: I'm not (completely) dead; I rarely talk because I usually have nothin to say; I'll talk when I actually have a comment I want to make, or if someone asks me somethin...

nostalgia is a beautiful thing, isn't it?

anything before 2020 is most likely me being a weirdo or an idiot.

PixelPest
Link
Link
Posts: 7116
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: Need help with lua? - LunaLua General Help

Postby PixelPest » Sun Nov 27, 2016 1:56 pm

pal4 wrote:Is there a lunalua code for spawning/shooting other npcs and projectiles? I can't find a list to confirm this.
There's also an NPC:transform function that works better than just changing the ID as Jayce 777 showed. I think it's part of HorikawaTools

pal4
Fighter Fly
Fighter Fly
Posts: 63
Joined: Wed Dec 23, 2015 7:57 pm

Re: Need help with lua? - LunaLua General Help

Postby pal4 » Sun Nov 27, 2016 2:40 pm

PixelPest wrote:
pal4 wrote:Is there a lunalua code for spawning/shooting other npcs and projectiles? I can't find a list to confirm this.
There's also an NPC:transform function that works better than just changing the ID as Jayce 777 showed. I think it's part of HorikawaTools
That's not even close to what I meant; what I meant is can you make an npc that normally doesn't shoot something do so? I'm hoping to make an npc that shoots in all four diagonals. If you could just provide a link to a list of lunalua codes...

loop13
Eerie
Eerie
Posts: 980
Joined: Sun Apr 17, 2016 5:56 pm
Flair: I mainly play Celeste nowadays
Current Project: failing English IV
Chat Username: loop13uh

Re: Need help with lua? - LunaLua General Help

Postby loop13 » Sun Nov 27, 2016 4:00 pm

pal4 wrote:
PixelPest wrote:
pal4 wrote:Is there a lunalua code for spawning/shooting other npcs and projectiles? I can't find a list to confirm this.
There's also an NPC:transform function that works better than just changing the ID as Jayce 777 showed. I think it's part of HorikawaTools
That's not even close to what I meant; what I meant is can you make an npc that normally doesn't shoot something do so? I'm hoping to make an npc that shoots in all four diagonals. If you could just provide a link to a list of lunalua codes...
That would be difficult, but it may be possible. :|
Hello, I make a lot of typos
specific people know my whereabouts though

my wifi is as useful as a brick

im more active on discord

:idea: I'm not (completely) dead; I rarely talk because I usually have nothin to say; I'll talk when I actually have a comment I want to make, or if someone asks me somethin...

nostalgia is a beautiful thing, isn't it?

anything before 2020 is most likely me being a weirdo or an idiot.

PixelPest
Link
Link
Posts: 7116
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: Need help with lua? - LunaLua General Help

Postby PixelPest » Sun Nov 27, 2016 4:23 pm

LunaLua codes don't just exist. You have to use the Lua scripting language to write it. For this, you'll need pnpc.lua to have projectiles go in different directions, eventu to delay them (specifically eventu.setTimer()), and the NPC.spawn(). It's not too difficult if you understand how Lua works

User avatar
timocomsmbx2345
Ninji
Ninji
Posts: 826
Joined: Sat Feb 06, 2016 1:44 pm
Current Project: i dont even know anymore. . . .
Chat Username: same as my username
Contact:

Re: Need help with lua? - LunaLua General Help

Postby timocomsmbx2345 » Mon Nov 28, 2016 6:15 pm

I stil rwally want to lnow how to code the screen manipulation from the Digital SHowdown from Hypnosis 2016 redo.
SMBX 2.0 β4 is here!!! How about 2.0 β5?
ImageImage
Image
Meepyglobix wrote:DON'T SAY "38A??". OR I'll SHOOT YOU.
Spoiler: show
Image Thanks Pixelpest!!!!
Image
Image

PixelPest
Link
Link
Posts: 7116
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: Need help with lua? - LunaLua General Help

Postby PixelPest » Mon Nov 28, 2016 9:45 pm

You can look at the file itself. I'm pretty sure it has to do with drawing CaptureBuffers. I know it looks cool but I wouldn't suggest attempting something like that without much Lua experience

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

Re: Need help with lua? - LunaLua General Help

Postby Enjl » Wed Nov 30, 2016 3:14 pm

timocomsmbx2345 wrote:I stil rwally want to lnow how to code the screen manipulation from the Digital SHowdown from Hypnosis 2016 redo.
You'll need the CaptureBuffer class, experience in Graphics.glDraw, math, knowledge on tables and rotation of vectors.
Once you have experience with all of that, it won't be hard to figure out how I created the screen manipulation. I'm not gonna teach it to you, because it's a very niche case requiring specific aspects of several parts of programming and I think it'd be better if you learned all those individual aspects instead.
And, as PixelPest said, you can look at the file itself, too. Keep in mind it's a good 2700 lines long and it's easy to get lost. There's an "ai3" function which handles the "Nanoteck" attack where he grabs the top half of the screen. You can look at that if you wanna find out how things work through the file. It won't allow you to reliably create this yourself, though, without knowing how the individual aspects work.
The ABC of Creation
________________________________________________________
Image

TDK
Kamikaze Koopa
Kamikaze Koopa
Posts: 1384
Joined: Wed Nov 11, 2015 12:26 pm

Re: Need help with lua? - LunaLua General Help

Postby TDK » Sat Dec 03, 2016 9:14 am

How do you change the speed of an NPC with a chase AI using lunalua?

User avatar
DeMuZ
Bob-omb
Bob-omb
Posts: 37
Joined: Thu Aug 18, 2016 2:35 pm
Current Project: The Episode of Nonsense series

Re: Need help with lua? - LunaLua General Help

Postby DeMuZ » Sat Dec 03, 2016 11:50 am

Is it possible to load an API from custom directory instead of LuaScriptsLib folder? (For example my own episode folder)

User avatar
underFlo
Mario
Mario
Posts: 4481
Joined: Mon Jul 14, 2014 10:44 am
Flair: sup im lesbiab
Current Project: actually nothing i lied to you
Chat Username: underFlo
Contact:

Re: Need help with lua? - LunaLua General Help

Postby underFlo » Sat Dec 03, 2016 11:54 am

API.load will look in the Level Folder, the Episode Folder and LuaScriptsLib in that order (maybe also other subfolders? idk, these 3 are the most frequent uses). So if you put the API into your episode folder everything should work out fine.
im a girl yo

User avatar
timocomsmbx2345
Ninji
Ninji
Posts: 826
Joined: Sat Feb 06, 2016 1:44 pm
Current Project: i dont even know anymore. . . .
Chat Username: same as my username
Contact:

Re: Need help with lua? - LunaLua General Help

Postby timocomsmbx2345 » Sat Dec 03, 2016 12:55 pm

So, howdo you use the new rinkas for an episode?
SMBX 2.0 β4 is here!!! How about 2.0 β5?
ImageImage
Image
Meepyglobix wrote:DON'T SAY "38A??". OR I'll SHOOT YOU.
Spoiler: show
Image Thanks Pixelpest!!!!
Image
Image

loop13
Eerie
Eerie
Posts: 980
Joined: Sun Apr 17, 2016 5:56 pm
Flair: I mainly play Celeste nowadays
Current Project: failing English IV
Chat Username: loop13uh

Re: Need help with lua? - LunaLua General Help

Postby loop13 » Sat Dec 03, 2016 1:09 pm

timocomsmbx2345 wrote:So, howdo you use the new rinkas for an episode?
Use moarrinkas.lua and NPCParse.lua.
Hello, I make a lot of typos
specific people know my whereabouts though

my wifi is as useful as a brick

im more active on discord

:idea: I'm not (completely) dead; I rarely talk because I usually have nothin to say; I'll talk when I actually have a comment I want to make, or if someone asks me somethin...

nostalgia is a beautiful thing, isn't it?

anything before 2020 is most likely me being a weirdo or an idiot.

Mr10crossing
Cheep-Cheep
Cheep-Cheep
Posts: 13
Joined: Sat Sep 05, 2015 5:47 pm

Re: Need help with lua? - LunaLua General Help

Postby Mr10crossing » Sat Dec 03, 2016 2:00 pm

Is there a way I can make an NPC follow the player when the player gets a certain distance away from it? For example, when the player gets 5 units away from an SMB3 goomba, the goomba will change its direction towards the player.

User avatar
timocomsmbx2345
Ninji
Ninji
Posts: 826
Joined: Sat Feb 06, 2016 1:44 pm
Current Project: i dont even know anymore. . . .
Chat Username: same as my username
Contact:

Re: Need help with lua? - LunaLua General Help

Postby timocomsmbx2345 » Sat Dec 03, 2016 3:04 pm

Jayce 777 wrote:
timocomsmbx2345 wrote:So, howdo you use the new rinkas for an episode?
Use moarrinkas.lua and NPCParse.lua.
but that didnt work for me the engine doesnt know those files are in th folders
SMBX 2.0 β4 is here!!! How about 2.0 β5?
ImageImage
Image
Meepyglobix wrote:DON'T SAY "38A??". OR I'll SHOOT YOU.
Spoiler: show
Image Thanks Pixelpest!!!!
Image
Image

User avatar
Quantix
Ripper II
Ripper II
Posts: 329
Joined: Tue Jan 26, 2016 5:04 pm

Re: Need help with lua? - LunaLua General Help

Postby Quantix » Tue Dec 06, 2016 10:07 pm

timocomsmbx2345 wrote:
Jayce 777 wrote:
timocomsmbx2345 wrote:So, howdo you use the new rinkas for an episode?
Use moarrinkas.lua and NPCParse.lua.
but that didnt work for me the engine doesnt know those files are in th folders
Well, you need to type it as ("NPCs//moarrinkas") for it to work. Though, the API's kinda broken as of now so you're better off not using it anyway.
viewtopic.php?f=69&p=286856#p286855

Generic Quote Collection:
Spoiler: show
Skant wrote:The egg will fuck you if you don't catch it
rockythechao wrote:f6 is an over-the-counter generic run-of-the-mill store-brand bootleg knockoff f5
some people wrote:The021stYoshiFromThe021stCentury: Who would win, a tophat wearing a tophat, or hoeloe wearing hoeloe?
Hoeloe: yes
glitch4: f6
rockythecomet: that's a trick question
rockythecomet: a top hat wearing a hoeloe
Waffles & Stuff (timocomlita) wrote:No matter what you do, it's impossible to get rid of the impossible.
Petrifying wrote:Piss off with your sex doll SMBX 2.0
Enjl wrote:it puts a twist on classic 4 step level design which i like to call "2 and a half steps backwards design"

User avatar
Angelus
Bit
Bit
Posts: 129
Joined: Tue Jun 21, 2016 9:38 am

Re: Need help with lua? - LunaLua General Help

Postby Angelus » Sun Dec 11, 2016 12:44 pm

How to increase the health of a specific NPC?


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest