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: 9886
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Emral » Thu Jan 07, 2016 5:29 pm

Creasion wrote: I dumped all the contents in the directory but now the HUD health won't show and Temmies shop isnt working...why is this stuff so complicated...[/color]
Step by step instructions on how to install Lunalua:

If you want a separate directory:
-go to http://engine.wohlnet.ru/LunaLua/
-select full installation
-vanilla + launcher
-include complete standalone game
-create a new folder on your pc
-dump the contents of the zip into the folder
-drag your lunalua episodes into the worlds folder
-maybe update your lua
-profit

If you don't want a separate directory:
-go to http://engine.wohlnet.ru/LunaLua/
-select full installation
-vanilla + launcher
-dump the contents of the zip into your smbx folder
-maybe update your lua
-profit

Instructions on how to install the SMBX 2.0 beta are in the first spoiler of this topic:
http://www.smbxgame.com/forums/v ... 69&t=12546

PersonNamedUser
Reznor
Reznor
Posts: 2882
Joined: Fri Feb 27, 2015 8:07 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PersonNamedUser » Fri Jan 08, 2016 4:08 am

How do you set a bosses hit points? More specifically, i'm trying to set larry koopa's hit points to 5 instead of 3 but i can't figure out how to.
Could someone please help?

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Emral » Fri Jan 08, 2016 5:27 am

MosaicMario wrote:How do you set a bosses hit points? More specifically, i'm trying to set larry koopa's hit points to 5 instead of 3 but i can't figure out how to.
Could someone please help?
Larry Koopa has 9 HP to begin with. Jumping takes 3, sword stab and fireballs take 1. Have you been to the NPC Offsets page on the wiki? It's one of the most important pages and has the field you're looking for.

bossedit8
Banned
Posts: 6838
Joined: Fri Dec 20, 2013 12:35 pm
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby bossedit8 » Fri Jan 08, 2016 8:01 am

Enjl wrote:
MosaicMario wrote:How do you set a bosses hit points? More specifically, i'm trying to set larry koopa's hit points to 5 instead of 3 but i can't figure out how to.
Could someone please help?
...sword stab and fireballs take 1.
Actually Link's Sword can take 2 damage on Larry Koopa and Ludwig von Koopa.

PersonNamedUser
Reznor
Reznor
Posts: 2882
Joined: Fri Feb 27, 2015 8:07 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PersonNamedUser » Sat Jan 09, 2016 11:40 pm

How do you add in multiple checkpoints?
I'm trying to add a checkpoint with this code:

Code: Select all

function Onloop()
    tableOfCheckPoints = multipoints.addLuaCheckpoint(-159601, -160208, 3,-159601, 160208);
    for n=1, table.getn(tableOfCheckPoints) do
	    if (Checkpoint.collected(true) then
		    getCheckpoint(2)
			getCheckpointID(2)
			getCheckpointStatus(true, 2)
		end
	end	
end
Can anyone tell what code to put in to add in another checkpoint?

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 Jan 09, 2016 11:47 pm

I'm pretty sure it's onLoop(), not Onloop().

Also, it's absolutely nothing like what you have to do. You just put this somewhere in your code (not in a function or anything):

Code: Select all

multipoints = loadAPI("multipoints");

--First Checkpoint
multipoints.addLuaCheckpoint(-150000, -150000, 0);

--Second Checkpoint
multipoints.addLuaCheckpoint(-100000, -100000, 0);
EDIT: I'm working on an inventory that lets you save multiple items with theoretically unlimited amounts of extra data saved directly to the item. I want it to all be saved as a string. Currently it works with a space as a separator:

Code: Select all

local item = "itemId extra saved data"
	local i = 0;
	for w in string.gmatch(item, "%a+") do
		Text.print(w, 0, 0 + 16 * i);
		i = i + 1;
    end
The problem is I don't want to use the spaces as the separator, I want to use the '|' character. Try as I might, I cannot figure out how to make it work like that. Any ideas?

EDIT 2: Solved it. I replaced the "%a+" with "[^|]+".

litchh
Eerie
Eerie
Posts: 719
Joined: Sun Dec 29, 2013 6:10 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby litchh » Thu Jan 14, 2016 11:49 am

Created custom hud
Spoiler: show
Image
But something gets wrong & I get the following message while launching level with it:
lunadll.lua:9: 'end' expected (to close 'function' at line 6) near '<eof>'
Here is code:

Code: Select all

local coin = Graphics.loadImage("../hud/coin.png")
local xxx = Graphics.loadImage("../hud/xxx.png")
local lives = Graphics.loadImage("../hud/1up.png")
local heart = Graphics.loadImage("../hud/heart.png")
local HP0 = Graphics.loadImage("../hud/HP0.png")
local HP1 = Graphics.loadImage("../hud/HP1.png")
Graphics.activateHud(false)

function onHUDDraw()
	Graphics.drawImageWP(lives, 250, 26, 3)
	Graphics.drawImageWP(xxx, 274, 27, 3)
	Graphics.drawImageWP(xxx, 512, 27, 3)
	Graphics.drawImageWP(coin, 488, 26, 3)
	Text.printWP(mem(0x00B2C5AC, FIELD_FLOAT), 298, 26, 3)
	Text.printWP(mem(0x00B2C5A8, FIELD_WORD), 536, 26, 3)
	Text.printWP(mem(0x00B2C8E4, FIELD_WORD), 536, 46, 3)
	if(health == 0) then
	Graphics.drawImageWP(HP0, 361, 18, 3)
	Graphics.drawImageWP(HP0, 393, 18, 3)
	Graphics.drawImageWP(HP0, 425, 18, 3)
	elseif(health == 1) then
	Graphics.drawImageWP(HP1, 361, 18, 3)
	Graphics.drawImageWP(HP0, 393, 18, 3)
	Graphics.drawImageWP(HP0, 425, 18, 3)
	elseif(health == 2) then
	Graphics.drawImageWP(HP1, 361, 18, 3)
	Graphics.drawImageWP(HP1, 393, 18, 3)
	Graphics.drawImageWP(HP0, 425, 18, 3)
	elseif(health == 3) then
	Graphics.drawImageWP(HP1, 361, 18, 3)
	Graphics.drawImageWP(HP1, 393, 18, 3)
	Graphics.drawImageWP(HP1, 425, 18, 3)
	end
	if(mem(0x00B251E0, FIELD_WORD) >= 1) then
	Graphics.drawImageWP(heart, 250, 46, 3)
	Graphics.drawImageWP(xxx, 274, 47, 3)
	Text.printWP(mem(0x00B251E0, FIELD_WORD), 298, 46, 3)
	end
end

function onLoop()
health = player:mem(0x16, FIELD_WORD)
end
What i'm doing wrong?

UPD: nevermind, I fixed it.

TDK
Phanto
Phanto
Posts: 1440
Joined: Wed Nov 11, 2015 12:26 pm
Flair: Retired

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby TDK » Sat Jan 16, 2016 9:52 am

1. How do you use the SpriteOverride class? Everytime I use it I get "attempt to index field 'sprites' (a nil value)" error.
2. How I make upside-down venus fire trap, and is it possible to put normal and upside-down venus fire trap in the same level?
3. How do I make hammer bro throw more hammers?
4. How to make a section autoscroll in the middle of the level?

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 Jan 16, 2016 10:51 am

I was wondering if anyone has coded Mario-Maker-exclusive features yet, specifically using mushrooms on enemies to make them giant, Buzzy Beetle shell helmets, and Spiny helmets, or if it would even be possible to do so (and if so, how).

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 Jan 16, 2016 11:34 am

TheDinoKing432 wrote:1. How do you use the SpriteOverride class? Everytime I use it I get "attempt to index field 'sprites' (a nil value)" error.
2. How I make upside-down venus fire trap, and is it possible to put normal and upside-down venus fire trap in the same level?
3. How do I make hammer bro throw more hammers?
4. How to make a section autoscroll in the middle of the level?
1. Not implemented yet, we have to wait for the update. If you want you can try the dev-build (available on the LunaLua download page), but there are often errors in it.
2. I'm not entirely sure, but with a bit of trigonometry and NPC.spawn() you could probably turn an upside down piranha plant into one.
3. ai3
4. use this and add/subtract to the x and y. There's probably a slightly better way that I don't know about.
Imaynotbehere4long wrote:I was wondering if anyone has coded Mario-Maker-exclusive features yet, specifically using mushrooms on enemies to make them giant, Buzzy Beetle shell helmets, and Spiny helmets, or if it would even be possible to do so (and if so, how).
Funny, I'm working on an API to add helmets. Mushrooms making enemies giant would be pretty easy, I'd suggest looking at the example here and see if you can turn it into a thing that makes goombas bigger when they touch mushrooms.

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 » Sat Jan 16, 2016 5:08 pm

Can someone please help? What code do I need to make it so that the player cannot crouch?

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 Jan 16, 2016 5:16 pm

Code: Select all

function onInputUpdate()
	for playerIndex, thePlayer in pairs(Player.get()) do
		thePlayer.downKeyPressing = false;
	end
end

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 » Sat Jan 16, 2016 5:23 pm

HenryRichard wrote:

Code: Select all

function onInputUpdate()
	for playerIndex, thePlayer in pairs(Player.get()) do
		thePlayer.downKeyPressing = false;
	end
end
Thank you. That worked perfectly.

aero
Palom
Palom
Posts: 4787
Joined: Fri Mar 28, 2014 2:51 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby aero » Sat Jan 16, 2016 5:42 pm

Forgive me if this sounds like a dumb question, but is any modding of netplay possible?

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 » Sat Jan 16, 2016 6:28 pm

How can I constantly give Peach the Tanooki power-up without increasing her # of lives.
I have:

Code: Select all

function onTick()
	player.powerup = 5
end

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 Jan 16, 2016 6:38 pm

You could try doing something with player.Hearts. Also, it's onLoop() and not onTick().

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 » Sat Jan 16, 2016 6:49 pm

HenryRichard wrote:You could do something with player.Hearts. Also, it's onLoop() and not onTick().
I thought onTick() was the new thing?

So like:

Code: Select all

function onLoop()
       if player.powerup == 1 then
              player.powerup = 5
              player.hearts = 1
       end
       if player.powerup == 2, 3, 4, 6, 7 then
              player.powerup = 5
              player.hearts = 2
       end
end

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 Jan 16, 2016 6:55 pm

TIL onTick() exists

Unfortunately, I don't think it's going to be that simple. You may need to remake the health to get it to work.

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 » Sat Jan 16, 2016 6:55 pm

HenryRichard wrote:TIL onTick() exists

Unfortunately, I don't think it's going to be that simple. You may need to remake the health to get it to work.
What do you mean by "remake" the health?

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 Jan 16, 2016 6:58 pm

Like, make a new variable for health and update it based on the player's conditions so you can make the powerup whatever you want. I'm working on a HUD that has the health redone, so when I'm done with it I'll let you know and you can look at it.


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari