Need help with lua? - LunaLua General Help

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?
DeMuZ
Fighter Fly
Fighter Fly
Posts: 37
Joined: Thu Aug 18, 2016 2:35 pm

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
Swooper
Swooper
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.

loop
Ninji
Ninji
Posts: 984
Joined: Sun Apr 17, 2016 5:56 pm
Flair: i may be dumb but im not stupid!
Pronouns: he/him/they

Re: Need help with lua? - LunaLua General Help

Postby loop » 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.

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
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
Swooper
Swooper
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...

loop
Ninji
Ninji
Posts: 984
Joined: Sun Apr 17, 2016 5:56 pm
Flair: i may be dumb but im not stupid!
Pronouns: he/him/they

Re: Need help with lua? - LunaLua General Help

Postby loop » 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. :|

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
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

timocomsmbx2345
Foo
Foo
Posts: 853
Joined: Sat Feb 06, 2016 1:44 pm
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.

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
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

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

Re: Need help with lua? - LunaLua General Help

Postby Emral » 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.

TDK
Phanto
Phanto
Posts: 1440
Joined: Wed Nov 11, 2015 12:26 pm
Flair: Retired

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?

DeMuZ
Fighter Fly
Fighter Fly
Posts: 37
Joined: Thu Aug 18, 2016 2:35 pm

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)

underFlo
Wart
Wart
Posts: 4456
Joined: Mon Jul 14, 2014 10:44 am
Flair: sup im lesbiab
Pronouns: They/She
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.

timocomsmbx2345
Foo
Foo
Posts: 853
Joined: Sat Feb 06, 2016 1:44 pm
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?

loop
Ninji
Ninji
Posts: 984
Joined: Sun Apr 17, 2016 5:56 pm
Flair: i may be dumb but im not stupid!
Pronouns: he/him/they

Re: Need help with lua? - LunaLua General Help

Postby loop » 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.

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.

timocomsmbx2345
Foo
Foo
Posts: 853
Joined: Sat Feb 06, 2016 1:44 pm
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

Quantix
Chain Chomp
Chain Chomp
Posts: 333
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.

Angelus
Tweeter
Tweeter
Posts: 132
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?

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

Re: Need help with lua? - LunaLua General Help

Postby PixelPest » Sun Dec 11, 2016 1:35 pm



Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari