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
Kevsoft
Flurry
Flurry
Posts: 375
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby Kevsoft » Tue Feb 24, 2015 8:55 am

try

Code: Select all

function onLoad()
  player:mem(0xF0, FIELD_WORD, 1)
end
1 = Mario, 2 = Luigi, 3 = Princess, 4 = Toad, 5 = Link

Exiled Bowser
Monty Mole
Monty Mole
Posts: 135
Joined: Thu Feb 19, 2015 6:06 pm
Contact:

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby Exiled Bowser » Tue Feb 24, 2015 10:48 am

That is in a lunadll.txt? For that level in the level folder? Or what? Once I know how to do it, I can remember it.

Kevsoft
Flurry
Flurry
Posts: 375
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby Kevsoft » Tue Feb 24, 2015 10:53 am

lunadll.lua in the custom folder (where you put also custom graphics).
Okay guys, the SUPER AMAZING SUPER-PATCH 0.5.4 IS OUT (just fixing my stupid memory-leak >.>)

... while fixing the memory-leak I also did:
Spoiler: show
* Added a constructor for VBStr with a string pointer (not a memory address, use mem with FIELD_STRING for memory address)!
** Added FIELD_STRING for the mem-functions! Usage:

Code: Select all

function onLoop()
	printText(mem(0x00B2D764, FIELD_STRING).str, 20, 300) --Prints out the level name
end
..or if you want to save up the pointer:

Code: Select all

function onLoop()
	local theLevelNameStrPointer = mem(0x00B2D764, FIELD_STRING)
end
* Added all other lua-libraries including cinematX.lua, raocoin.lua, triggers.lua, musix.lua, multipoints.lua.

MaxiMario289
Guest

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby MaxiMario289 » Wed Feb 25, 2015 4:12 pm

So, yeah, I tried to install LunaLUA many times (around six) but I can't get it to work =(
LunaDLL version 7 worked when I tried to install it. The old LunaLUA version which didn't use the SDL Mixer worked for me too (I'm using it atm). But the new versions aren't working for me.

When I open SMBX I get this:
Spoiler: show
Image
I have to press "OK" for every sound file. Then, when I play, I have no sound and LunaLUA isn't working.

I took a screenshot of my SMBX LunaLUA file:
Spoiler: show
Image
I'm still trying to find a way to get LunaLUA to work. I'd really love if someone could help me though :)
Thanks!

(oh and I use Windows 8 if that's the problem)

Kevsoft
Flurry
Flurry
Posts: 375
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby Kevsoft » Wed Feb 25, 2015 4:27 pm

The fix is simple: Just download "SMBX Audio Files" (from the first post) and put all the ogg files in the sounds folder.

MaxiMario289
Guest

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby MaxiMario289 » Wed Feb 25, 2015 4:35 pm

Yeah I've done this. It still doesn't work, I got the same message =/
Thanks for trying to help me anyway ^^

Kevsoft
Flurry
Flurry
Posts: 375
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby Kevsoft » Thu Feb 26, 2015 1:22 am

Could you screenshot the messagebox again?

MaxiMario289
Guest

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby MaxiMario289 » Thu Feb 26, 2015 5:33 am

Yeah.
Spoiler: show
Image
It's literally the same than the old one =p

Kevsoft
Flurry
Flurry
Posts: 375
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby Kevsoft » Thu Feb 26, 2015 11:38 am

Oh I just see that you need to put/create it in the folder "sound_ogg"

MaxiMario289
Guest

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby MaxiMario289 » Thu Feb 26, 2015 4:23 pm

You mean that I have to put all .ogg files in the sound_ogg folder ?

Still doesn't work =(

Kevsoft
Flurry
Flurry
Posts: 375
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby Kevsoft » Fri Feb 27, 2015 12:59 am

So "SMBX/sound_ogg/....ogg-files"?

Wohlstand
Van De Graf
Van De Graf
Posts: 2008
Joined: Tue Feb 11, 2014 4:44 pm
Flair: [ˈvoːlˌʃtant], 狐エンジニア
Pronouns: he/him
Contact:

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby Wohlstand » Fri Feb 27, 2015 7:43 am

Also little note:
Full path SHOULD be with ASCII only characters (for example, D:\Igry\SMBX\LunaLUA 0.5.3\ but not D:\Игры\SMBX\LunaLUA 0.5.3).

Murphmario
2025 Egg Hunter
2025 Egg Hunter
Posts: 2389
Joined: Fri Dec 20, 2013 7:07 pm
Pronouns: he/him

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby Murphmario » Sat Feb 28, 2015 11:30 am

I have an issue of tracks playing faster than they should. Could you please fix that?

Kevsoft
Flurry
Flurry
Posts: 375
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby Kevsoft » Sat Feb 28, 2015 11:56 am

Be sure your music file is 44100 Hz.

Murphmario
2025 Egg Hunter
2025 Egg Hunter
Posts: 2389
Joined: Fri Dec 20, 2013 7:07 pm
Pronouns: he/him

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby Murphmario » Sat Feb 28, 2015 12:20 pm

Kevsoft wrote:Be sure your music file is 44100 Hz.
And how do I do that? And if they aren't, how do I change them?

Kevsoft
Flurry
Flurry
Posts: 375
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby Kevsoft » Sat Feb 28, 2015 12:23 pm

Use programs like Audacity. Wohlstand is currently developing a tool, that you can do that with the PGE Editor.

Kevsoft
Flurry
Flurry
Posts: 375
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby Kevsoft » Mon Mar 02, 2015 3:19 pm

Oh man: Huge update!

Before all the changes to lunalua: This dll is compiled with VS 2013 (+Windows XP Support). If you use an old OS you probably need the Visual C++ Redistributable Packages for Visual Studio 2013.
(I will link on the main Page).

Anyway with the LunaLua v0.6 release, there are following changes:
Spoiler: show
* Added a bunch of lua libraries
* Added a new event called "onTriggerEvent(eventObj, eventName)", which triggers if a SMBX Event is called.
* Added a new class called "Event" [used in onTriggerEvent(eventObj,...)] which provides fields like "eventObj.cancled = true".
Raw Event-Class Overview Code:

Code: Select all

  class_<Event>("Event")
			.property("eventName", &Event::eventName)
			.property("cancleable", &Event::isCancleable)
			.property("cancled", &Event::cancled, &Event::setCancled)
  
* Added a new class called "Data". This can be constructed and should be used as a new version of "userData" with lots of improvements.
Raw Data-Class Overview Code:

Code: Select all

  class_<LuaProxy::Data>("Data")
				.enum_("DataTypes")
				[
					value("DATA_LEVEL", LuaProxy::Data::DATA_LEVEL),
					value("DATA_WORLD", LuaProxy::Data::DATA_WORLD),
					value("DATA_GLOBAL", LuaProxy::Data::DATA_GLOBAL)
				]
			.def(constructor<LuaProxy::Data::DataType>())
			.def(constructor<LuaProxy::Data::DataType, std::string>())
			.def(constructor<LuaProxy::Data::DataType, bool>())
			.def(constructor<LuaProxy::Data::DataType, std::string, bool>())
			.def("set", &LuaProxy::Data::set)
			.def("get", static_cast<std::string(LuaProxy::Data::*)(std::string)>(&LuaProxy::Data::get))
			.def("get", static_cast<luabind::object(LuaProxy::Data::*)(lua_State*)>(&LuaProxy::Data::get))
			.def("save", static_cast<void(LuaProxy::Data::*)()>(&LuaProxy::Data::save))
			.def("save", static_cast<void(LuaProxy::Data::*)(std::string)>(&LuaProxy::Data::save))
			.property("dataType", &LuaProxy::Data::dataType, &LuaProxy::Data::setDataType)
			.property("sectionName", &LuaProxy::Data::sectionName, &LuaProxy::Data::setSectionName)
			.property("useSaveSlot", &LuaProxy::Data::useSaveSlot, &LuaProxy::Data::setUseSaveSlot)
  
Because I am already pretty tired I will write the doc later. But I provided the "Raw ... Overview Code", some of you might understand it.
Here is a example code for the new Data-Class:

Code: Select all

local myDataFile = nil;
function onLoad()
	--Use Data.DATA_LEVEL for saving in the custom level folder
	--Use Data.DATA_WORLD for saving in the episode folder 
	--Use Data.DATA_GLOBAL for saving in the smbx/worlds folder
	--The last parameter is true or false, if the data should be save-slot-local.
	myDataFile = Data(Data.DATA_LEVEL, "mySection", false)
	
end

function onLoop()
	local stars = myDataFile:get("myStarCounter")
	if(stars == "")then
		stars = 0
	else
		stars = tonumber(stars)
	end
	stars = stars + 1
	myDataFile:set("myStarCounter", tostring(stars))
	myDataFile:save()
	printText("Counter: "..stars, 30, 100)
end

Onule
Spiny
Spiny
Posts: 27
Joined: Tue Mar 18, 2014 11:54 pm

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby Onule » Mon Mar 02, 2015 9:40 pm

Two questions: Is it possible to make an NPC (spawned from a generator) just despawn when it reaches a certain area?
And is there a way to make npc generators start offscreen?

FanofSMBX
Mouser
Mouser
Posts: 3878
Joined: Sun Dec 22, 2013 12:01 pm

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby FanofSMBX » Sat Mar 07, 2015 3:28 pm

Is there a code to make SMB1 red Koopas (no wings) jump like red Paragoombas?

Kevsoft
Flurry
Flurry
Posts: 375
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua - Lunadll with lua [Now with Overworld]

Postby Kevsoft » Sun Mar 08, 2015 4:20 pm

FanofSMBX wrote:Is there a code to make SMB1 red Koopas (no wings) jump like red Paragoombas?
http://engine.wohlnet.ru/forum/viewtopic.php?f=26&t=338
One of them has a code with non-paragoombas. You can alter the code for that.


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari