LunaLua Offical Thread - SMBX Usermod Framework

This is the place for discussion and support for LunaLua and related modifications and libraries.
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
User avatar
TheGoatsefaceKilla
Cheep-Cheep
Cheep-Cheep
Posts: 12
Joined: Sun Nov 01, 2015 10:32 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby TheGoatsefaceKilla » Sun Nov 01, 2015 11:04 pm

I spent about half a day fiddling with the latest build and figured out a way to recreate the SMB flagpole level end ... mostly

This link contains the commented LUA code, as well as a demo level. Here's some more documentation:
  • The only values you should change are the constants up top. POLE_POSITION is the most important value, it's the XY coordinates of the flag at the top of the flagpole. POLE_SECTION is also important, the other values only need to be changed if you use a different fanfare or have different spacing between the flag and your exit.
  • The fanfare must include a slide noise at the front of the track for this script to work. The included fanfare works just fine for this, use it in your own works if you want.
  • To prevent flag jumpers from breaking the script, I added invisible walls above the pole. You can forgo these if you're confident the player can't clear your flagpole.
  • The pole needs a foreground block layer ("Flag") and a background layer ("NoFlag"). Make the bottom 2-3 pole blocks in the "Flag" layer, add 2-3 background poles in the "NoFlag" layer, then disable the "NoFlag" layer.
  • The warp out is a door warp that points to another level or the world map. This image should help: Image
And there you go! Feedback is appreciated, and have fun building!

User avatar
Kevsoft
Ripper II
Ripper II
Posts: 374
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Kevsoft » Mon Nov 02, 2015 2:06 am

Darkonius Mavakar wrote:So like, i redowloaded lua 3 times, but it just won't work for some reason, it freezes the moment the editor or "start game" thing opens, so like, anyone know what's going on...?
(i've tryed to describe the problem as well as i could)
Okay this is weird,

you can however help me by doing following steps:
1.) Download this utility: https://technet.microsoft.com/en-us/sys ... 96900.aspx and copy the executable (procdump.exe) into the smbx folder.
2.) Go to the smbx folder and start smbx.
3.) Go to the smbx folder and then write "cmd" in the windows explorer address bar
4.) If the command prompt is open then write following command:

Code: Select all

procdump -h -ma smbx.exe
TheGoatsefaceKilla wrote:...recreate the SMB flagpole...
Very nice! I just tested it and it works brilliant. My main suggestion would be to bundle it into an API, so it is easier to use for others.

User avatar
Darkonius Mavakar
Boom Boom
Boom Boom
Posts: 1668
Joined: Fri Dec 27, 2013 2:45 pm
Flair: Dreams of a forgotten reality
Current Project: Dormiveglia
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Darkonius Mavakar » Mon Nov 02, 2015 3:55 pm

Uhm, it says it doesn't recognise "procdump" uuh...

User avatar
Wohlstand
Boom Boom
Boom Boom
Posts: 1751
Joined: Tue Feb 11, 2014 4:44 pm
Flair: 狐エンジニア
Current Project: Moondust (PGE Project)
Chat Username: Wohlstand#4881
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Wohlstand » Mon Nov 02, 2015 4:59 pm

Darkonius Mavakar wrote:Uhm, it says it doesn't recognise "procdump" uuh...
Are you was put that tool into SMBX directory with LunaLUA?
PGE Project, my Media and supported projects: show
Support me on the Patreon
Image

PGE Project
PGE Project SMBX Topic
PGE Project Official Site and forums
Download fresh experimental builds HERE!

I'm support:
Lowser's Conquest by Sednaiur

Image
P.S. I don't like huge signatures which would be annoying, therefore I put huge content into spoilers

User avatar
TheGoatsefaceKilla
Cheep-Cheep
Cheep-Cheep
Posts: 12
Joined: Sun Nov 01, 2015 10:32 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby TheGoatsefaceKilla » Tue Nov 03, 2015 1:07 am

Kevsoft wrote:Very nice! I just tested it and it works brilliant. My main suggestion would be to bundle it into an API, so it is easier to use for others.
Oh my, uhhhh, I don't think the wiki tutorial is working. Or I'm doing it wrong, more likely :D . I'll just leave this paste here, if anyone wants to figure out what I'm doing wrong I'll be incredibly grateful!
The API paste

And I'll throw in what I've put in my lunalua.dll, to help illustrate what I'm trying to do:

Code: Select all

FlagpoleExit = loadAPI("flagpole_exit")

local pp = {-199488, -200384} --top of flagpole
local ps = 1
local fs = "SMB1Flag.ogg"
local sl = 90
local fl = 420
local es = 0.32

function onLoad()
	FlagpoleExit.init(pp,ps,fs,sl,fl,es)
end
Thanks!

User avatar
Mosaic
Ludwig von Koopa
Ludwig von Koopa
Posts: 2843
Joined: Fri Feb 27, 2015 8:07 pm
Flair: All has a reason behind it, even if it's tough.
Current Project: The Mosaic Group's Journey, Toad's SMB Adventure, Mosaic Adventures and Other Secret Projects?
Chat Username: Mosaic
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Mosaic » Tue Nov 03, 2015 1:24 am

TheGoatsefaceKilla wrote: local pp = {-199488, -200384} --top of flagpole
local ps = 1
local fs = "SMB1Flag.ogg"
local sl = 90
local fl = 420
local es = 0.32

function onLoad()
FlagpoleExit.init(pp,ps,fs,sl,fl,es)
end[/code]

Thanks!
This should be a luascript in the next lunalua update.

I believe in Jesus Christ as my Lord and Savior. If you do, put this in your signature.
And Here's The Proof
My Rainbow Of Levels
Mosaic's Museum(My Discord)

Image

Image

Danny wrote:Here's some constructive criticism: What the hell.
Witchking wrote:Approved!

Discord Quotes: show
Image


User avatar
TheGoatsefaceKilla
Cheep-Cheep
Cheep-Cheep
Posts: 12
Joined: Sun Nov 01, 2015 10:32 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby TheGoatsefaceKilla » Tue Nov 03, 2015 9:07 am

SuperMario12345 wrote:This should be a luascript in the next lunalua update.
I wouldn't go that far. Even if it actually worked, there's still a bunch of stuff (animated flag slide, sliding sprite for all possible characters, fireworks etc.) that would need to be added to make it comprehensive enough for official release. Thanks for the support though!

User avatar
Kevsoft
Ripper II
Ripper II
Posts: 374
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Kevsoft » Tue Nov 03, 2015 1:23 pm

I just checked the code. It is nearly perfect. The only issue is that events has to be in the API's namespace.

so instead of:

Code: Select all

function run()
you do

Code: Select all

function flagpole_exit.run()
because only stuff which is in flagpole_exit is usable for the user (who uses your API) and the event manager (--> registerEvent)

(the same you have to do with the locks-function)

EDIT: Here is the fixed version: http://pastebin.com/1Lcwe2Sy
Also I would like to remind that single functions which are not used by the end-user should be marked as "local". This prevents naming-conflicts with other apis.

User avatar
Darkonius Mavakar
Boom Boom
Boom Boom
Posts: 1668
Joined: Fri Dec 27, 2013 2:45 pm
Flair: Dreams of a forgotten reality
Current Project: Dormiveglia
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Darkonius Mavakar » Tue Nov 03, 2015 1:49 pm

alright i finally managed to do the cmd thing, here's what came out:


https://www.dropbox.com/s/waz9q4ll7y0xn ... 6.png?dl=0


...does this help figuring out what's wrong with my lualoader?

User avatar
Kevsoft
Ripper II
Ripper II
Posts: 374
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Kevsoft » Tue Nov 03, 2015 3:03 pm

Well did the SMBX application freeze (like a white overlay over the game window) or does the game window doesn't even pop up?

User avatar
Kevsoft
Ripper II
Ripper II
Posts: 374
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Kevsoft » Tue Nov 03, 2015 3:35 pm

LunaLua v0.7.2.1 has just been released. This is an important update because it fixes an exploit which manages to run assembler code on your computer throught lunadll.txt due to an exploit in the Autocode module.

Additional changes are:
Spoiler: show
* Extended NPC class
* Added cheat values. Some cheat can now be toggled by value. (Defines.* namespace)
* Added Audio.MusicArtistTag(), Audio.MusicAlbumTag() and Audio.MusicCopyrightTag() functions
* Added console class. You can now use the windows console for debugging. (See LunaLua command arguments at the wiki)
* Hotfix Bugfix [LunaLua]: Fixed ROP exploit at the Autocode module.

User avatar
Darkonius Mavakar
Boom Boom
Boom Boom
Posts: 1668
Joined: Fri Dec 27, 2013 2:45 pm
Flair: Dreams of a forgotten reality
Current Project: Dormiveglia
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Darkonius Mavakar » Tue Nov 03, 2015 4:05 pm

Kevsoft wrote:Well did the SMBX application freeze (like a white overlay over the game window) or does the game window doesn't even pop up?
it freezes

User avatar
Kevsoft
Ripper II
Ripper II
Posts: 374
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Kevsoft » Tue Nov 03, 2015 4:11 pm

And before smbx was freezing you started the console application, right?

User avatar
TheGoatsefaceKilla
Cheep-Cheep
Cheep-Cheep
Posts: 12
Joined: Sun Nov 01, 2015 10:32 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby TheGoatsefaceKilla » Tue Nov 03, 2015 9:09 pm

Flagpole Exit API 1.0 Released!

Special Thanks to Kevsoft for looking over my code, you are way too good at this!
Enjoy!
Last edited by TheGoatsefaceKilla on Fri Jan 15, 2016 8:58 pm, edited 1 time in total.

User avatar
Kevsoft
Ripper II
Ripper II
Posts: 374
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Kevsoft » Wed Nov 04, 2015 3:55 am

A Hotfix which fixes the Autocode Module has just been uploaded!

Cornholio309
Cheep-Cheep
Cheep-Cheep
Posts: 11
Joined: Fri Nov 06, 2015 4:26 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Cornholio309 » Fri Nov 06, 2015 4:40 pm

Just registered on the forums to ask this: How exactly can I be sure that LunaLua's lua functions are indeed working? I've tried tinkering with them for a couple of minutes now and can't get them to work.

I get a nice notification in intro.lvl telling me what version of LunaLua I have, I can change between the letterbox mode and "stretch mode" that this page describes, but using the lunadll.lua file doesn't appear to work. I've tried copying and pasting the example on the first page, no dice. I've tried using the "double jump" lua file example made by another user, and that doesn't appear to work either.

For the record, this is what the folder of my test level looks like:

Image

Despite this, both lua examples don't appear to work.

Is there something I'm missing that's preventing this from working? I downloaded the latest revision, with the hex edited SMBX 1.3.0.2, and I kept the full base game included. My operating system is Windows 10 as well.

User avatar
HenryRichard
Ludwig von Koopa
Ludwig von Koopa
Posts: 2845
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 » Fri Nov 06, 2015 4:48 pm

You need to make a folder called testworld.lvl and put the lunadll.lua in there. If you want to have lunadll.lua files that apply to all levels in the folder, you call it lunaworld.lua.
Image

I'm on Soundcloud | My graphics pack!

Jesus is my savior.

Cornholio309
Cheep-Cheep
Cheep-Cheep
Posts: 11
Joined: Fri Nov 06, 2015 4:26 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Cornholio309 » Fri Nov 06, 2015 4:59 pm

Strangely the lunadll.lua file still doesn't appear to be working, but lunaworld.lua works just fine. Any ideas why?

Otherwise, I really appreciate the quick and kind reply! Still slightly curious about this in case I ever run into an issue where I want to use lunadll.lua rather than applying everything to every level in the folder.

Image

User avatar
HenryRichard
Ludwig von Koopa
Ludwig von Koopa
Posts: 2845
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 » Fri Nov 06, 2015 5:01 pm

HenryRichard wrote:You need to make a folder called testworld.lvl and put the lunadll.lua in there.
...except without the .lvl.
Image

I'm on Soundcloud | My graphics pack!

Jesus is my savior.

Cornholio309
Cheep-Cheep
Cheep-Cheep
Posts: 11
Joined: Fri Nov 06, 2015 4:26 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Cornholio309 » Fri Nov 06, 2015 5:08 pm

HenryRichard wrote:...except without the .lvl.
I tried that earlier. Oddly enough, nothing seems to happen. I'm using the double jump lua example. If I shove that into a lua file named lunaworld.dll, it works fine. If I use just lunadll.lua, nothing seems to happen.

Image


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest