Page 42 of 47
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sun Mar 13, 2016 3:20 pm
by Emral
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)
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sun Mar 13, 2016 3:22 pm
by PixelPest
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
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sun Mar 13, 2016 3:46 pm
by snoruntpyro
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
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sun Mar 13, 2016 3:47 pm
by Emral
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
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sun Mar 13, 2016 3:48 pm
by PixelPest
Okay. Thanks guys
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sun Mar 13, 2016 6:25 pm
by Quantumenace
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?
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sun Mar 13, 2016 7:28 pm
by PixelPest
What exactly are you trying to do?
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sun Mar 13, 2016 7:59 pm
by Quantumenace
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.
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sun Mar 13, 2016 10:20 pm
by HenryRichard
I'd code it using something like a rinka with playerblocktop=1.
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sun Mar 13, 2016 11:25 pm
by Quantumenace
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.
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Mon Mar 14, 2016 5:20 am
by lotus006
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

Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Mon Mar 14, 2016 5:43 am
by Hoeloe
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.
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Mon Mar 14, 2016 5:56 am
by lotus006
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 ?
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Fri Mar 18, 2016 4:21 am
by Mario_and_Luigi_55
Small question. Is LunaSvedVars0.txt and LunaSavedVars1.txt anything useful?
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Fri Mar 18, 2016 7:39 am
by PixelPest
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
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Fri Mar 18, 2016 11:16 am
by h2643
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!
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Fri Mar 18, 2016 1:21 pm
by Kevsoft
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.
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Mar 19, 2016 4:59 pm
by Imaynotbehere4long
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.
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Mar 19, 2016 5:02 pm
by HenryRichard
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.
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Mar 19, 2016 6:39 pm
by Quantix
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