Page 40 of 47

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Fri Feb 26, 2016 6:13 pm
by Enjl
timetrialisactive is nil. Use the data class to use variables in multiple lunadll.lua files http://wohlsoft.ru/pgewiki/Data_%28class%29

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Sat Feb 27, 2016 1:26 am
by lotus006
I'm not sure if we can but is there a way to remove a line created by the data:save() ? from a txt file ?
if yes how ?

Thanks

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Sat Feb 27, 2016 6:46 pm
by Destiny
After a small period of time running LunaLua/SMBX 2.0, it just stops working with a message telling the memory couldn't be "read". I tried to get help with that before but Kevsoft just disappeared and forgot about it.

I use an older OS (Windows XP Service Pack 3) due to my PC being too weak for Win7/8/10.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Sat Feb 27, 2016 6:52 pm
by PixelPest
lotus006 wrote:I'm not sure if we can but is there a way to remove a line created by the data:save() ? from a txt file ?
if yes how ?

Thanks
You could just change the value to something that would never trigger anything in a function, so that it acts like it's gone. For example, if you are using 0 and 1 to represent false and true, you could change the value to 2 so that it doesn't satisfy any conditions.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Sun Feb 28, 2016 12:18 am
by lotus006
PixelPest wrote:
lotus006 wrote:I'm not sure if we can but is there a way to remove a line created by the data:save() ? from a txt file ?
if yes how ?

Thanks
You could just change the value to something that would never trigger anything in a function, so that it acts like it's gone. For example, if you are using 0 and 1 to represent false and true, you could change the value to 2 so that it doesn't satisfy any conditions.
Yep thanks I found a similar solution it's tricky but it's work and need more work :S

also instead of put a value else that we dont want we can put the variable empty at the end of the loop if we are in loop.

Code: Select all

data:set("MyVariable01", tostring(""))
For Kevsoft, I dont know if is it possible but can you add to the Data(Class) something like this who can delete a value in the txt we dont want
ie: data:remove("MyVariable01")

Thanks

Edit: It's my or the command player:kill() is bugged in the last lunalua ? I got keep the player dying million time without ending :(
weird. , I tried to get it on onInitAPI and onLoop but both is doing this :(

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Sun Feb 28, 2016 8:25 am
by TheSaturnyoshi
That's because you're repeatedly killing the player, you can only do it once, try replacing it with this:
if playerKilled==0 then player:kill(); playerKilled=1; end

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Sun Feb 28, 2016 1:42 pm
by PixelPest
Can't seem to get this encrypted jumpcounter to work:

Code: Select all

function onJumpEnd()
	x = tonumber(Borderlands:get("jumpcounter"))
	Borderlands:set("jumpcounter", x + 1)
	Borderlands:save()
end
For the achievement "Up" as defined by Borderlands:set("up", 1), nothing happens although I don't get an error either:

Code: Select all

function onLoop()
--achievements
	if Borderlands:get("jumpcounter") == 1 then
		if Borderlands:get("up") == 0 then
			Borderlands:set("up", 1)
			Borderlands:save()
			playSFX(20)--boss-beat
		end
	end
end
EDIT: Fixed

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Sun Feb 28, 2016 2:21 pm
by lotus006
as I know so far, you need to put tostring("1") or else is not saving the number instead, probably I'm wrong, correct me if is not wright :S

Code: Select all

 Borderlands:set("up", tostring"1") -- or tonumber("1")

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Sun Feb 28, 2016 2:37 pm
by Enjl
lotus006 wrote:as I know so far, you need to put tostring("1") or else is not saving the number instead, probably I'm wrong, correct me if is not wright :S

Code: Select all

 Borderlands:set("up", tostring"1") -- or tonumber("1")
He's using encrypt. With encrypt you can use numbers.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Sun Feb 28, 2016 9:20 pm
by Mivixion
Is there a way to make everything in game (including the player) fall at a consistent rate? The gravity in this game makes common kaizo tricks like shelljumps so hard to build.
Also interested in making jumping off of a P-switch freer as currently it is a pixel-perfect to jump off of.
Im also wondering if there's a way to get bombs to be spinjumpable in a way that you can bomb surf by spinjump chaining.
I'm just trying to think of ways to make kaizo levels more familiar.
Thanks in advance.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Tue Mar 01, 2016 6:18 am
by lotus006
I remade an idea from Prado the LunaLua Super Mario n64 hud Air Meter Gauge , click on the link to see it ! :D
http://www.supermariobrosx.org/forums/v ... 22#p201922

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Tue Mar 01, 2016 10:00 pm
by Nat The Porcupine
How do I use the 'Player:getCurrentPlayerSetting()' function and the PlayerSettings class to store the player's hitbox height, hitbox width, & hitbox duck height in their own variables? The documentation on this specific subject seems poor at best...

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Wed Mar 02, 2016 6:28 am
by PixelPest
http://wohlsoft.ru/pgewiki/Player_(class)

Try using player.width and player.height to do this. Read the documentation I posted above.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Wed Mar 02, 2016 6:30 am
by Kevsoft
PlayerSetting holds all informations about hitbox height, width, duck heiht and offsets of a character with a specific powerup state (i.e. Big Mario, Fireflower Link, ...). getCurrentPlayerSetting returns a "PlayerSetting"-Object which is bound to the current powerup state and character.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Thu Mar 03, 2016 12:59 pm
by RudeGuy
I'm trying to use the paralx API with this code:

Code: Select all

local paralX = loadAPI("paralX")
local bg1Img = Graphics.loadImage("bg1.png")

function onStart ()
	bg1 = paralX.create ({image=bg1Img, x=-150, y=-150, repeatY=false, parallaxX=0.45, parallaxY=0.35, alpha=1})
end
But the parallax layer never appears. What am I doing wrong?

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Thu Mar 03, 2016 5:18 pm
by Hoeloe
RudeGuy07 wrote:I'm trying to use the paralx API with this code:

Code: Select all

local paralX = loadAPI("paralX")
local bg1Img = Graphics.loadImage("bg1.png")

function onStart ()
	bg1 = paralX.create ({image=bg1Img, x=-150, y=-150, repeatY=false, parallaxX=0.45, parallaxY=0.35, alpha=1})
end
But the parallax layer never appears. What am I doing wrong?
It's probably waaaay off screen. You're telling it not to repeat on the Y axis, and positioning it at -150 on the Y axis. Remember that the top left corner of section 1 is at -200000,-200000.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Thu Mar 03, 2016 10:51 pm
by HenryRichard
Is there a way to read .ini files? It would be pretty rad if there was.

(not the player.ini files, like one I made myself)

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Fri Mar 04, 2016 12:30 am
by lotus006
I need to find some P2 value in memory address offsets but I have for the P1 like player:mem(0xF0, FIELD_WORD, 4)
but in example in cheat engine how do I view this memory section 0xF0 ?

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Fri Mar 04, 2016 1:25 am
by Kevsoft
HenryRichard wrote:Is there a way to read .ini files? It would be pretty rad if there was.

(not the player.ini files, like one I made myself)
You can look into the io-library from the standard lua libraries.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Sun Mar 06, 2016 4:51 am
by Circle Guy
How do you create a lunadll.lua file? (The one for your episode)