Page 69 of 76

Re: Need help with lua? - LunaLua General Help

Posted: Thu Jun 28, 2018 6:12 am
by DarvinosBobaFett
How About a Parallex in a Background for lua?

Re: Need help with lua? - LunaLua General Help

Posted: Tue Jul 10, 2018 6:26 pm
by Daring Tombstone
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.

Re: Need help with lua? - LunaLua General Help

Posted: Thu Jul 12, 2018 5:19 am
by Rixitic
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.

Re: Need help with lua? - LunaLua General Help

Posted: Thu Jul 12, 2018 10:19 am
by Teemster2
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.

Re: Need help with lua? - LunaLua General Help

Posted: Fri Jul 13, 2018 12:50 pm
by Rixitic
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.

Re: Need help with lua? - LunaLua General Help

Posted: Mon Jul 30, 2018 4:15 pm
by Sewpah
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

Re: Need help with lua? - LunaLua General Help

Posted: Mon Jul 30, 2018 7:08 pm
by Daring Tombstone
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?

Re: Need help with lua? - LunaLua General Help

Posted: Tue Jul 31, 2018 3:38 am
by Emral
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.

Re: Need help with lua? - LunaLua General Help

Posted: Tue Jul 31, 2018 3:12 pm
by Sewpah
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!

Re: Need help with lua? - LunaLua General Help

Posted: Tue Jul 31, 2018 4:21 pm
by Emral
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)

Re: Need help with lua? - LunaLua General Help

Posted: Tue Jul 31, 2018 10:08 pm
by Daring Tombstone
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.

Re: Need help with lua? - LunaLua General Help

Posted: Tue Aug 14, 2018 8:36 pm
by IttaBaby
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?

Re: Need help with lua? - LunaLua General Help

Posted: Tue Aug 28, 2018 2:06 pm
by MustardCake
How can i replace sounds?

Re: Need help with lua? - LunaLua General Help

Posted: Sat Sep 15, 2018 5:08 pm
by Novarender
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?

Re: Need help with lua? - LunaLua General Help

Posted: Sat Sep 22, 2018 2:05 pm
by FireyPaperMario
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! ^_^"

Re: Need help with lua? - LunaLua General Help

Posted: Sat Sep 22, 2018 3:41 pm
by Emral
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.

Re: Need help with lua? - LunaLua General Help

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

Re: Need help with lua? - LunaLua General Help

Posted: Sat Sep 29, 2018 5:31 pm
by marquise
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 ?

Re: Need help with lua? - LunaLua General Help

Posted: Thu Nov 01, 2018 3:43 pm
by Daring Tombstone
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?

Re: Need help with lua? - LunaLua General Help

Posted: Thu Nov 01, 2018 4:14 pm
by FireyPaperMario
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