Page 3 of 47

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

Posted: Tue Feb 24, 2015 8:55 am
by Kevsoft
try

Code: Select all

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

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

Posted: Tue Feb 24, 2015 10:48 am
by Exiled Bowser
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.

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

Posted: Tue Feb 24, 2015 10:53 am
by Kevsoft
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.

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

Posted: Wed Feb 25, 2015 4:12 pm
by MaxiMario289
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)

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

Posted: Wed Feb 25, 2015 4:27 pm
by Kevsoft
The fix is simple: Just download "SMBX Audio Files" (from the first post) and put all the ogg files in the sounds folder.

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

Posted: Wed Feb 25, 2015 4:35 pm
by MaxiMario289
Yeah I've done this. It still doesn't work, I got the same message =/
Thanks for trying to help me anyway ^^

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

Posted: Thu Feb 26, 2015 1:22 am
by Kevsoft
Could you screenshot the messagebox again?

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

Posted: Thu Feb 26, 2015 5:33 am
by MaxiMario289
Yeah.
Spoiler: show
Image
It's literally the same than the old one =p

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

Posted: Thu Feb 26, 2015 11:38 am
by Kevsoft
Oh I just see that you need to put/create it in the folder "sound_ogg"

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

Posted: Thu Feb 26, 2015 4:23 pm
by MaxiMario289
You mean that I have to put all .ogg files in the sound_ogg folder ?

Still doesn't work =(

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

Posted: Fri Feb 27, 2015 12:59 am
by Kevsoft
So "SMBX/sound_ogg/....ogg-files"?

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

Posted: Fri Feb 27, 2015 7:43 am
by Wohlstand
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).

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

Posted: Sat Feb 28, 2015 11:30 am
by Murphmario
I have an issue of tracks playing faster than they should. Could you please fix that?

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

Posted: Sat Feb 28, 2015 11:56 am
by Kevsoft
Be sure your music file is 44100 Hz.

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

Posted: Sat Feb 28, 2015 12:20 pm
by Murphmario
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?

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

Posted: Sat Feb 28, 2015 12:23 pm
by Kevsoft
Use programs like Audacity. Wohlstand is currently developing a tool, that you can do that with the PGE Editor.

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

Posted: Mon Mar 02, 2015 3:19 pm
by Kevsoft
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

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

Posted: Mon Mar 02, 2015 9:40 pm
by Onule
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?

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

Posted: Sat Mar 07, 2015 3:28 pm
by FanofSMBX
Is there a code to make SMB1 red Koopas (no wings) jump like red Paragoombas?

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

Posted: Sun Mar 08, 2015 4:20 pm
by Kevsoft
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.