LunaLua Offical Thread - SMBX Usermod Framework

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?

Shall I steam some LunaLua live development?

Yes
200
92%
No
17
8%
 
Total votes: 217
Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9890
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Emral » Sun Mar 13, 2016 3:20 pm

PixelPest wrote:I know that to adjust/find the player's power-up you can use player.Powerup. Is there something like that you can use for a ride (Yoshi, boot, etc.) or is there a memory value I can use? I need to test to see if the player is wearing a boot (or if one is spawned works too).
player.powerup, not player.Powerup

also, http://wohlsoft.ru/pgewiki/SMBX_Player_Offsets
You're likely going to find what you're looking for here. I think you want

SMBX PC+0x108 PC+0x108 FIELD_WORD Mount identity (0 no mount,1 boot, 2 clowncar, 3 yoshi)

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PixelPest » Sun Mar 13, 2016 3:22 pm

Thanks Enjl! Couldn't find that page when I searched it. Going to bookmark it now

EDIT: So shouldn't this work? Because it isn't:

Code: Select all

mountID = {}

layer(3) = boot1

mem(PC+0x108,FIELD_WORD,mountID)

function onLoop()
	if mountID == 1 then
		boot1:show(false)
	end
end

snoruntpyro
Snifit
Snifit
Posts: 226
Joined: Sun Oct 11, 2015 9:36 am
Pronouns: she/her
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby snoruntpyro » Sun Mar 13, 2016 3:46 pm

w-what

no

no

you just check if player:mem(0x108,FIELD_WORD) == 1

and if you're trying to get a layer "boot1", you have to do something like
myLayer = Layer.get("boot1")

and then myLayer:hide(true) at the relevant location

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Emral » Sun Mar 13, 2016 3:47 pm

PixelPest wrote:Thanks Enjl! Couldn't find that page when I searched it. Going to bookmark it now

EDIT: So shouldn't this work? Because it isn't:

Code: Select all

mountID = {}

layer(3) = boot1

mem(PC+0x108,FIELD_WORD,mountID)

function onLoop()
	if mountID == 1 then
		boot1:show(false)
	end
end
It shouldn't work. There's so much wrong with this code I'm gonna go through it one by one:
-layer doesn't exist. It's Layer.
-it should be boot1 = Layer(3), since boot1 is your variable
-mountID is an empty table. What. You never fill it
-you're showing a layer each frame. This will lag.
-what pyro said

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PixelPest » Sun Mar 13, 2016 3:48 pm

Okay. Thanks guys

Quantumenace
Chain Chomp
Chain Chomp
Posts: 308
Joined: Mon Dec 28, 2015 2:17 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Quantumenace » Sun Mar 13, 2016 6:25 pm

This is probably a long shot, but is there a way to disable an NPC's default AI? Most NPCs immediately override any speedX value you try to give them. Currently I use the "don't move" flag and set the x position manually, but is that the only option?

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PixelPest » Sun Mar 13, 2016 7:28 pm

What exactly are you trying to do?

Quantumenace
Chain Chomp
Chain Chomp
Posts: 308
Joined: Mon Dec 28, 2015 2:17 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Quantumenace » Sun Mar 13, 2016 7:59 pm

It's a ballistic projectile. I'm using Rippers as dummy units so the player can bounce off them and throw things to destroy them.

HenryRichard
Reznor
Reznor
Posts: 2843
Joined: Mon Dec 23, 2013 12:09 pm
Flair: Is this where I type my password?
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby HenryRichard » Sun Mar 13, 2016 10:20 pm

I'd code it using something like a rinka with playerblocktop=1.

Quantumenace
Chain Chomp
Chain Chomp
Posts: 308
Joined: Mon Dec 28, 2015 2:17 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Quantumenace » Sun Mar 13, 2016 11:25 pm

Part of the problem is that I'm already using Rinkas in the level. I'd try the Birdo egg but I have Birdo in there too. And I want the player to bounce off like they're jumping on a kamikaze koopa, not for it to be possible to stand on.

Most NPCs with breakable AIs (like fighter fly) can't be used because removing their "hurt player on stomp" flag makes them vulnerable to stomps.

I guess there isn't an easy way, then.

lotus006
Spike
Spike
Posts: 284
Joined: Thu Sep 24, 2015 12:59 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby lotus006 » Mon Mar 14, 2016 5:20 am

I have a question about layer name and detection of block :
when I have just ElevatorA1 in the condition I can move the ElevatorA1 but
when I put both condition on the layers ElevatorA1 and ElevatorA2 no one move :(
both are detected, any one know why ?

Thanks

Code: Select all

local ThatBlock = Block.getIntersecting(player.x - 80  ,  player.y - 20   , player.x + 80   , player.y + 80)

for k,v in pairs (ThatBlock) do

 LsTextPrintExt( "name: " ..   tostring(v.layerName) , v.x,  v.y + 17 )

if tostring(v.layerName) == "ElevatorA1"  and tostring(v.layerName) == "ElevatorA2"  then

if (player.upKeyPressing) and v:collidesWith(player) == 1   then
v.y = v.y - 1.6
end

if (player.downKeyPressing) and v:collidesWith(player) == 1  then
v.y = v.y + 1.6
player.y = player.y + 1.2
end
 
  LsTextPrintExt( "Y: " .. tostring(v.y) , v.x,  v.y - 25 )
  LsTextPrintExt( "X: " .. tostring(v.x) , v.x,  v.y - 34 )

end
Image

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Hoeloe » Mon Mar 14, 2016 5:43 am

lotus006 wrote: if tostring(v.layerName) == "ElevatorA1" and tostring(v.layerName) == "ElevatorA2" then
This is your problem. You've used a logical and here, where you should be using a logical or.

The logical "and" works like this:

A and B is true only when A is true AND B is true. If A is true and B is false, then A and B is false.

The logical "or" works like this:

A or B is true when A is true, B is true, or both are true. If A is true and B is false, then A or B is true.

Your problem is that you're telling it to react if the attached layer name is equal to both "ElevatorA1" AND "ElevatorA2". This is obviously impossible (for the same reason that, in algebra, "x" cannot equal both 1 and 3 at the same time), so the condition is always false and the block of code never runs.

lotus006
Spike
Spike
Posts: 284
Joined: Thu Sep 24, 2015 12:59 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby lotus006 » Mon Mar 14, 2016 5:56 am

Ah damn thanks for the info, and that was my only other way to make both on the same id block to be attached, because if others same block i want to make it move on same Pos X to make one elevator but not if others was on a other Pos Y differency. Any idea how I can make this ?

Mario_and_Luigi_55
Spike
Spike
Posts: 270
Joined: Sat Feb 27, 2016 12:01 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Mario_and_Luigi_55 » Fri Mar 18, 2016 4:21 am

Small question. Is LunaSvedVars0.txt and LunaSavedVars1.txt anything useful?

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PixelPest » Fri Mar 18, 2016 7:39 am

Mario_and_Luigi_55 wrote:Small question. Is LunaSvedVars0.txt and LunaSavedVars1.txt anything useful?
It just tells you what version of Lua you have

h2643
Reznor
Reznor
Posts: 2890
Joined: Sat Dec 21, 2013 7:23 am
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby h2643 » Fri Mar 18, 2016 11:16 am

PixelPest wrote:
Mario_and_Luigi_55 wrote:Small question. Is LunaSvedVars0.txt and LunaSavedVars1.txt anything useful?
It just tells you what version of Lua you have
No, it's a LunaDLL save file, which has no use now according to Kevsoft!
Last edited by h2643 on Fri Mar 18, 2016 1:32 pm, edited 2 times in total.

Kevsoft
Ripper II
Ripper II
Posts: 375
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Kevsoft » Fri Mar 18, 2016 1:21 pm

h2643 wrote:
PixelPest wrote:
Mario_and_Luigi_55 wrote:Small question. Is LunaSvedVars0.txt and LunaSavedVars1.txt anything useful?
It just tells you what version of Lua you have
No, it's a LunaLua save file.
It's mainly from the old LunaDLL and not actually used nowadays.

Imaynotbehere4long
Boomerang Bro
Boomerang Bro
Posts: 1389
Joined: Thu Jan 23, 2014 3:00 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Imaynotbehere4long » Sat Mar 19, 2016 4:59 pm

Why did you replace the NSMB theme, Mt. Gorge, Beach Bowl, and most of the SM64 and Paper Mario songs with SPC versions of those songs??? OGG files don't take up that much more space, and the SPC versions sound so much worse than their original counterparts! Please undo this change.

Also, while I'm at it, please replace the Airship Theme with the version from Super Smash Bros Brawl. Thank you.

HenryRichard
Reznor
Reznor
Posts: 2843
Joined: Mon Dec 23, 2013 12:09 pm
Flair: Is this where I type my password?
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby HenryRichard » Sat Mar 19, 2016 5:02 pm

As long as we're on that topic it would be nice if you could go back to the Tetris DS version of Metroid Charge, not the 8-bit version that's currently used.
Last edited by HenryRichard on Sat Mar 19, 2016 9:23 pm, edited 1 time in total.

Quantix
Chain Chomp
Chain Chomp
Posts: 333
Joined: Tue Jan 26, 2016 5:04 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Quantix » Sat Mar 19, 2016 6:39 pm

I have a question (which might've been asked already, but eh): What pushed you to make this framework? Like, why did you create it in the first place? (Not that I'm saying it's pointless, don't get me wrong.)

People are gonna kill me for asking this, aren't they


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari