Page 31 of 47
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Thu Jan 07, 2016 5:29 pm
by Emral
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
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Fri Jan 08, 2016 4:08 am
by PersonNamedUser
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?
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Fri Jan 08, 2016 5:27 am
by Emral
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.
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Fri Jan 08, 2016 8:01 am
by bossedit8
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.
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Jan 09, 2016 11:40 pm
by PersonNamedUser
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?
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Jan 09, 2016 11:47 pm
by HenryRichard
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 "[^|]+".
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Thu Jan 14, 2016 11:49 am
by litchh
Created custom hud
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.
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Jan 16, 2016 9:52 am
by TDK
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?
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Jan 16, 2016 10:51 am
by Imaynotbehere4long
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).
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Jan 16, 2016 11:34 am
by HenryRichard
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.
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Jan 16, 2016 5:08 pm
by PixelPest
Can someone please help? What code do I need to make it so that the player cannot crouch?
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Jan 16, 2016 5:16 pm
by HenryRichard
Code: Select all
function onInputUpdate()
for playerIndex, thePlayer in pairs(Player.get()) do
thePlayer.downKeyPressing = false;
end
end
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Jan 16, 2016 5:23 pm
by PixelPest
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.
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Jan 16, 2016 5:42 pm
by aero
Forgive me if this sounds like a dumb question, but is any modding of netplay possible?
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Jan 16, 2016 6:28 pm
by PixelPest
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
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Jan 16, 2016 6:38 pm
by HenryRichard
You could try doing something with player.Hearts. Also, it's onLoop() and not onTick().
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Jan 16, 2016 6:49 pm
by PixelPest
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
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Jan 16, 2016 6:55 pm
by HenryRichard
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.
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Jan 16, 2016 6:55 pm
by PixelPest
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?
Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Sat Jan 16, 2016 6:58 pm
by HenryRichard
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.