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?
DarvinosBobaFett
Bob-Omb
Bob-Omb
Posts: 24
Joined: Tue Jun 26, 2018 8:26 pm

Re: Need help with lua? - LunaLua General Help

Postby DarvinosBobaFett » Thu Jun 28, 2018 6:12 am

How About a Parallex in a Background for lua?

Daring Tombstone
Blooper
Blooper
Posts: 160
Joined: Mon Aug 28, 2017 10:57 pm
Flair: What? Not 1000 posts? That means I suck right?

Re: Need help with lua? - LunaLua General Help

Postby Daring Tombstone » Tue Jul 10, 2018 6:26 pm

DarvinosBobaFett wrote:
Thu Jun 28, 2018 6:12 am
How About a Parallex in a Background for lua?
I know this is 2 weeks late but no one seemed to answer and I'm not exactly a lua expert. I haven't done paralax myself but you can use the paralX API which is included in the latest smbx beta 3 editor. It also comes with a level that showcases the paralX feature called "Willhart-Shogon" that's in the "HONK" worlds folder that has the lua code you can study to have a parallax affect in your level.

Rixitic
Spike
Spike
Posts: 272
Joined: Sat Dec 12, 2015 1:00 am
Contact:

Re: Need help with lua? - LunaLua General Help

Postby Rixitic » Thu Jul 12, 2018 5:19 am

It's worth noting that the shogun level along with all of Willhart's other contributions will be removed in beta 4 (long story short, he's an unrepentant stalker) but the paralX library is also getting replaced with one that allows defining parallax backgrounds via ini files.

Teemster2
Rocky Wrench
Rocky Wrench
Posts: 622
Joined: Sat Jan 18, 2014 11:56 am

Re: Need help with lua? - LunaLua General Help

Postby Teemster2 » Thu Jul 12, 2018 10:19 am

not rockythechao wrote:
Thu Jul 12, 2018 5:19 am
It's worth noting that the shogun level along with all of Willhart's other contributions will be removed in beta 4 (long story short, he's an unrepentant stalker) but the paralX library is also getting replaced with one that allows defining parallax backgrounds via ini files.
I thought his stuff was already removed. Not a big loss here. I do wish Horikawa would come back and be more active on the project. I doubt Will is still around (Nobody wants him here) and even if he is what can he really do to her over the internet? Maybe she just had burnout. I don't really know. The dev teams needs all of the help they can get right now and losing a key player and lead dev from the team sucks. Sorry for going off topic.

Rixitic
Spike
Spike
Posts: 272
Joined: Sat Dec 12, 2015 1:00 am
Contact:

Re: Need help with lua? - LunaLua General Help

Postby Rixitic » Fri Jul 13, 2018 12:50 pm

Willhart's contributions have already been removed from the smbx2 dev repository, it's just that Beta 4 isn't ready for a public release yet.

Sewpah
Volcano Lotus
Volcano Lotus
Posts: 554
Joined: Wed Jul 09, 2014 10:07 pm
Contact:

Re: Need help with lua? - LunaLua General Help

Postby Sewpah » Mon Jul 30, 2018 4:15 pm

I'm trying to create a power-up that replaces an iceball (npc-265) with a mushroom block (npc-154), and when I'm trying to test the level, it just states an error saying "unexpected symbol near '265'" and runs the level like normal without the powerup. And when I tried to fix the code, nothing happens. The iceballs are still intact. Is this code outdated or something or am I doing something wrong?:

Code: Select all

NPCMemSet,265,0xE2,154,0,0,w

Daring Tombstone
Blooper
Blooper
Posts: 160
Joined: Mon Aug 28, 2017 10:57 pm
Flair: What? Not 1000 posts? That means I suck right?

Re: Need help with lua? - LunaLua General Help

Postby Daring Tombstone » Mon Jul 30, 2018 7:08 pm

Sewpah wrote:
Mon Jul 30, 2018 4:15 pm
I'm trying to create a power-up that replaces an iceball (npc-265) with a mushroom block (npc-154), and when I'm trying to test the level, it just states an error saying "unexpected symbol near '265'" and runs the level like normal without the powerup. And when I tried to fix the code, nothing happens. The iceballs are still intact. Is this code outdated or something or am I doing something wrong?:

Code: Select all

NPCMemSet,265,0xE2,154,0,0,w
With your code I pasted it into a text file named lunadll and it worked for me with the SMBX2 beta 3 version. The problem I had though was that it firing mushroom blocks as big as the snowball itself, so I had to make a npc-265 text file that change the height and width of the snowball to 32x32. It works but I'm sure there's another way of doing this code that I'm not aware of (since my lunalua skills are bad).

Speaking of my lunalua skills. I'm attempting to make a blooper fly through the air (like they sometimes did in SMB1) without being in water using this.

Code: Select all

function onTick()
	for k,v in pairs(NPC.get(235)) do
		v:mem (0x1C, FIELD_WORD,2)
	end
end
The blooper acts like it's in water (it floats towards the ground gently rather than just falling) but it doesn't do anything other than sit. Is there something else I should add or is it just not possible to do this without several walls of script?

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

Re: Need help with lua? - LunaLua General Help

Postby Emral » Tue Jul 31, 2018 3:38 am

It's not possible to do that without rewriting the blooper. The blooper does its own underwater checks just before it executes its behaviour, overwriting your attempts. The same goes for wanting to make Boos move while the player faces them.

Sewpah
Volcano Lotus
Volcano Lotus
Posts: 554
Joined: Wed Jul 09, 2014 10:07 pm
Contact:

Re: Need help with lua? - LunaLua General Help

Postby Sewpah » Tue Jul 31, 2018 3:12 pm

Daring Tombstone wrote:
Mon Jul 30, 2018 7:08 pm
Sewpah wrote:
Mon Jul 30, 2018 4:15 pm
I'm trying to create a power-up that replaces an iceball (npc-265) with a mushroom block (npc-154), and when I'm trying to test the level, it just states an error saying "unexpected symbol near '265'" and runs the level like normal without the powerup. And when I tried to fix the code, nothing happens. The iceballs are still intact. Is this code outdated or something or am I doing something wrong?:

Code: Select all

NPCMemSet,265,0xE2,154,0,0,w
With your code I pasted it into a text file named lunadll and it worked for me with the SMBX2 beta 3 version. The problem I had though was that it firing mushroom blocks as big as the snowball itself, so I had to make a npc-265 text file that change the height and width of the snowball to 32x32. It works but I'm sure there's another way of doing this code that I'm not aware of (since my lunalua skills are bad).
Oh, I was putting it in a .lua file rather than a .txt file. Thanks!

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

Re: Need help with lua? - LunaLua General Help

Postby Emral » Tue Jul 31, 2018 4:21 pm

Sewpah wrote:
Tue Jul 31, 2018 3:12 pm
Daring Tombstone wrote:
Mon Jul 30, 2018 7:08 pm
Sewpah wrote:
Mon Jul 30, 2018 4:15 pm
I'm trying to create a power-up that replaces an iceball (npc-265) with a mushroom block (npc-154), and when I'm trying to test the level, it just states an error saying "unexpected symbol near '265'" and runs the level like normal without the powerup. And when I tried to fix the code, nothing happens. The iceballs are still intact. Is this code outdated or something or am I doing something wrong?:

Code: Select all

NPCMemSet,265,0xE2,154,0,0,w
With your code I pasted it into a text file named lunadll and it worked for me with the SMBX2 beta 3 version. The problem I had though was that it firing mushroom blocks as big as the snowball itself, so I had to make a npc-265 text file that change the height and width of the snowball to 32x32. It works but I'm sure there's another way of doing this code that I'm not aware of (since my lunalua skills are bad).
Oh, I was putting it in a .lua file rather than a .txt file. Thanks!
Yeah uh. That's lunadll code. Not lunalua. Deprecated since 2016. Here's the lua alternative if you're interested. It's a bit longer but also more comprehensible:

Code: Select all

function onTickEnd()
	for _,npc in ipairs(NPC.get(265, player.section) do
		npc:transform(154)
	end
end
Grabs all ID 265 NPCs in the player's section and transforms them into NPC 154.
With minor alterations to this code you can do a lot more. "npc" has all of these instance variables and they can be manipulated.
https://wohlsoft.ru/pgewiki/NPC_(class)

Daring Tombstone
Blooper
Blooper
Posts: 160
Joined: Mon Aug 28, 2017 10:57 pm
Flair: What? Not 1000 posts? That means I suck right?

Re: Need help with lua? - LunaLua General Help

Postby Daring Tombstone » Tue Jul 31, 2018 10:08 pm

I figured lunadll was depreciated so thanks for correcting me in that. Also thanks for the blooper situation and being a part of my lua noobness.

IttaBaby
Bot
Bot
Posts: 55
Joined: Sat Apr 08, 2017 8:19 pm

Re: Need help with lua? - LunaLua General Help

Postby IttaBaby » Tue Aug 14, 2018 8:36 pm

I used to know how to have enemies spawn different projectiles than usual, but somehow can't anymore? Either due to forgetfulness or changing times.
Another thing is, I have a lot of trouble with everyone's explanations because of how I learn. I'm much better at dissecting and understanding an example. May I have help?

MustardCake
Snifit
Snifit
Posts: 206
Joined: Fri Mar 16, 2018 2:09 pm
Pronouns: he/him

Re: Need help with lua? - LunaLua General Help

Postby MustardCake » Tue Aug 28, 2018 2:06 pm

How can i replace sounds?

Novarender
Tweeter
Tweeter
Posts: 145
Joined: Sat Aug 06, 2016 6:59 pm
Flair: Whoa

Re: Need help with lua? - LunaLua General Help

Postby Novarender » Sat Sep 15, 2018 5:08 pm

How can I make normal bullet bills (ones shot from a bill blaster) die upon contact of a block, like the ones shot from the Billy Gun?

FireyPaperMario
Toad
Toad
Posts: 6206
Joined: Sat Sep 27, 2014 1:39 pm
Flair: 90's kid born in late 1993 ^_^"
Pronouns: He/Him
Contact:

Re: Need help with lua? - LunaLua General Help

Postby FireyPaperMario » Sat Sep 22, 2018 2:05 pm

I had this thought on a "LunaLua" script power-up quite recently while I was working my 2 paid jobs in real life:

I wonder if it's possible to make a type of shield power-up* that won't make you die or lose your current power-up form when you take damage from a enemy and/or hazard (Y'all know, a extra hit! :P ). If anyone HAVEN'T made this Lua-Power-Up, I might go make this Lua code once i get a new W10 Laptop!

*Like in the Mega Drive/Genesis masterpiece, Sonic the Hedgehog! ^_^"

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

Re: Need help with lua? - LunaLua General Help

Postby Emral » Sat Sep 22, 2018 3:41 pm

MarioRPGExpert93 wrote:
Sat Sep 22, 2018 2:05 pm
I had this thought on a "LunaLua" script power-up quite recently while I was working my 2 paid jobs in real life:

I wonder if it's possible to make a type of shield power-up* that won't make you die or lose your current power-up form when you take damage from a enemy and/or hazard (Y'all know, a extra hit! :P ). If anyone HAVEN'T made this Lua-Power-Up, I might go make this Lua code once i get a new W10 Laptop!

*Like in the Mega Drive/Genesis masterpiece, Sonic the Hedgehog! ^_^"
Certainly possible. Good luck.

FireyPaperMario
Toad
Toad
Posts: 6206
Joined: Sat Sep 27, 2014 1:39 pm
Flair: 90's kid born in late 1993 ^_^"
Pronouns: He/Him
Contact:

Re: Need help with lua? - LunaLua General Help

Postby FireyPaperMario » Sat Sep 22, 2018 4:12 pm

Enjl wrote:
Sat Sep 22, 2018 3:41 pm
Certainly possible. Good luck.
Why thank you very much, ^_^

marquise
Shy Guy
Shy Guy
Posts: 5
Joined: Sat Sep 29, 2018 5:20 pm
Flair: Family man

Re: Need help with lua? - LunaLua General Help

Postby marquise » Sat Sep 29, 2018 5:31 pm

I’ve made a custom sprite for the dry bones npc which has 7 frames, this causes the the collapse frames to not work. Is it possible to get the frames working with some sort of lua code ?

Daring Tombstone
Blooper
Blooper
Posts: 160
Joined: Mon Aug 28, 2017 10:57 pm
Flair: What? Not 1000 posts? That means I suck right?

Re: Need help with lua? - LunaLua General Help

Postby Daring Tombstone » Thu Nov 01, 2018 3:43 pm

Messing with the LsBreathMeter API and wanted to have it where if a player hits a resprited axe (a bubble) it would give air back to the player using onNPCKill. However if the axe(bubble) goes offscreen it dies and gives the player air anyways. Can I set it where it only gives air back if the player kills it?

FireyPaperMario
Toad
Toad
Posts: 6206
Joined: Sat Sep 27, 2014 1:39 pm
Flair: 90's kid born in late 1993 ^_^"
Pronouns: He/Him
Contact:

Re: Need help with lua? - LunaLua General Help

Postby FireyPaperMario » Thu Nov 01, 2018 4:14 pm

I need some help with some Lunalua for my custom Sega Genesis Mario sprites (Coming in December 20, 2018, i hope :roll: ) that involves the Extra Frames lunalua code.
I have the sprites from the Fire Flower form, the Ice Flower form, and Hammer Suit forms have frames of the player throwing fireballs/iceballs/hammers while moving, jumping, falling, & swimming*. How do i use the .lua script to display the different sprite frames of the throwing frames while moving. :?:

*Y'all know, like in Super Mario Land 2: 6 Golden Coins :D


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari