LunaLua Offical Thread

Description: Official subforum for LunaLua - an extension framework for SMBX Engine Version 1.3 (which a core of SMBX 2.0). Share your creations that require the use of LunaLUA. You may also share info/tutorials on how to use LunaLUA.
Moderator: Moderators

Shall I stream some LunaLua live development?

Yes
13
tb1024, h2643, hacheipe399, Wohlstand, cramps-man, Lotus006, wes, Saronin, Super Mario Player, 9th_core, LuigiCraft, SMBX FAN1.4, MomsResetti
100%
No
0
No votes
 
Total voters: 13
EXEcutor M
Close friend
Close friend
Avatar
EXEcutor M
Close friend
Close friend
Age: 15
Reputation: 10
Posts: 94
Joined: 18 Apr 2014
Location: Hill Act 1
Website Google+ Twitter YouTube

Post #101by EXEcutor » 31 Jan 2015, 22:46

Is There A Way To Make A bully Jump Like A Koopa Para-troopa And Chase You At The Same time Like In Super Mario World With Bowser's Clown Car? if there Is, I Need A Code for Something like That. Like For Example...

If A Bully Was On The Ground, It Would Jump Up At A Y Speed Of A Koopa Para-troopa, Then Fall The Same Way As A koopa Paratroopa At A Y Speed, Then It Would Do The Same Thing Over And over, But It Would Chase You At An X Speed. I Hope that Helps.
Hey guys! I'm not dead! I'm only a little rotten, but I'm just as stupid and idiotic as ever! :comando:
While you're looking at this wonderful and completely pointless thing with a signature attached to it, and since you decided to read it, why not check out my DeviantArt page?

My Discord tag: beanluv#2197

Image

Kevsoft M
Topic author, Angry developer
Angry developer
Avatar
Kevsoft M
Topic author, Angry developer
Angry developer
Age: 19
Reputation: 77
Posts: 376
Joined: 26 Apr 2014
Location: Austria

Post #102by Kevsoft » 1 Feb 2015, 11:51

Sambo wrote:
Kevsoft wrote:You should be able to access variables from lunadll.lua in lunaworld.lua and the other way round.
I tried to access functions from lunaworld.lua in lunadll.lua and got "attempt to call a nil value." Functions are a type of variable, right?

Strange... I will try later, in the meanwhile try this:

Code: Select all

_G["yourfunctionname"] = function() {
  ... --here your code
}

and call it with

Code: Select all

_G["yourfunctionname"]()

Maybe this works

Added after 11 minutes 24 seconds:
beanluv wrote:Is There A Way To Make A bully Jump Like A Koopa Para-troopa And Chase You At The Same time Like In Super Mario World With Bowser's Clown Car? if there Is, I Need A Code for Something like That.

tb1024 wrote:
phpBB [youtube]

Original link: https://www.youtube.com/watch?v=SnTpl3y_SVY&feature=youtu.be


Goomba with a Red Paragoomba-like Behavior

Hopefully this helps.
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
Image
Wohlstand in interview:
Spoiler
Image

▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

Kevsoft M
Topic author, Angry developer
Angry developer
Avatar
Kevsoft M
Topic author, Angry developer
Angry developer
Age: 19
Reputation: 77
Posts: 376
Joined: 26 Apr 2014
Location: Austria

Post #103by Kevsoft » 5 Feb 2015, 12:57

LunaLua 0.5.2.1 is out with just a mainV2.lua fix. No binary update!
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
Image
Wohlstand in interview:
Spoiler
Image

▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

Veudekato M
Viscount
Viscount
Avatar
Veudekato M
Viscount
Viscount
Reputation: 57
Posts: 369
Joined: 19 Feb 2014
Location: Russia

Post #104by Veudekato » 13 Feb 2015, 23:03

how to make this with wind.lua :in first section,speed of wind is slow,in 2nd more,in 3rd fast
My channel (PlatGEnWohl news and tutorials , smbx tests):
http://www.youtube.com/channel/UC6h-42umT14iR1wa3VkOs3Q

Kevsoft M
Topic author, Angry developer
Angry developer
Avatar
Kevsoft M
Topic author, Angry developer
Angry developer
Age: 19
Reputation: 77
Posts: 376
Joined: 26 Apr 2014
Location: Austria

Post #105by Kevsoft » 13 Feb 2015, 23:08

Veudekato wrote:how to make this with wind.lua :in first section,speed of wind is slow,in 2nd more,in 3rd fast
Replace onLoop with onLoopSection1 and modify the attributes
you can then copy the code for onLoopSectoin2, onLoopSection3.... ect

LunaLua version 0.5.3.1 is out!

Changes:
* Added function getLevelName()
* Added function getLevelFilename()
* Added class Level (for overworld code)

Documentation will be updated soon!
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
Image
Wohlstand in interview:
Spoiler
Image

▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

Kevsoft M
Topic author, Angry developer
Angry developer
Avatar
Kevsoft M
Topic author, Angry developer
Angry developer
Age: 19
Reputation: 77
Posts: 376
Joined: 26 Apr 2014
Location: Austria

Post #106by Kevsoft » 23 Feb 2015, 19:26

LunaLua v0.5.3.2 has been released

Changes:
Spoiler
* Added npc.isValid()
* Added exceptions for npcs and players if the index is invalid for better coding experience.
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
Image
Wohlstand in interview:
Spoiler
Image

▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

Kevsoft M
Topic author, Angry developer
Angry developer
Avatar
Kevsoft M
Topic author, Angry developer
Angry developer
Age: 19
Reputation: 77
Posts: 376
Joined: 26 Apr 2014
Location: Austria

Post #107by Kevsoft » 24 Feb 2015, 18:55

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
* 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.
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
Image
Wohlstand in interview:
Spoiler
Image

▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

Kevsoft M
Topic author, Angry developer
Angry developer
Avatar
Kevsoft M
Topic author, Angry developer
Angry developer
Age: 19
Reputation: 77
Posts: 376
Joined: 26 Apr 2014
Location: Austria

Post #108by Kevsoft » 2 Mar 2015, 23:18

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
* 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
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
Image
Wohlstand in interview:
Spoiler
Image

▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

lighthouse64 M
Duke
Duke
Avatar
lighthouse64 M
Duke
Duke
Age: 14
Reputation: 13
Posts: 131
Joined: 15 Feb 2015
Location: IDK!

Post #109by lighthouse64 » 6 Mar 2015, 8:54

Ok, this is probably the stupidest question, but which link is the lua 0.6 on the main post?
Player of hedgewars!!! :)
And hi... it's me from smbx
Currently bug testing for Mac :apple: And Windows :windows:

Kevsoft M
Topic author, Angry developer
Angry developer
Avatar
Kevsoft M
Topic author, Angry developer
Angry developer
Age: 19
Reputation: 77
Posts: 376
Joined: 26 Apr 2014
Location: Austria

Post #110by Kevsoft » 6 Mar 2015, 19:24

"Download SDL Version" is the main dll.
The other files are just support files.
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
Image
Wohlstand in interview:
Spoiler
Image

▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

lighthouse64 M
Duke
Duke
Avatar
lighthouse64 M
Duke
Duke
Age: 14
Reputation: 13
Posts: 131
Joined: 15 Feb 2015
Location: IDK!

Post #111by lighthouse64 » 6 Mar 2015, 21:54

Kevsoft wrote:"Download SDL Version" is the main dll.
The other files are just support files.
That's where Lunalua 0.6 is? THX :)
Player of hedgewars!!! :)
And hi... it's me from smbx
Currently bug testing for Mac :apple: And Windows :windows:

Kevsoft M
Topic author, Angry developer
Angry developer
Avatar
Kevsoft M
Topic author, Angry developer
Angry developer
Age: 19
Reputation: 77
Posts: 376
Joined: 26 Apr 2014
Location: Austria

Post #112by Kevsoft » 7 Mar 2015, 16:55

Updated to LunaLua v0.6.0.3 fixing a serious issue.

Events should now work again properly without problems!
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
Image
Wohlstand in interview:
Spoiler
Image

▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

Something Fawful
Citizen
Citizen
Avatar
Something Fawful
Citizen
Citizen
Reputation: 0
Posts: 9
Joined: 28 Jan 2015

Post #113by Something Fawful » 8 Mar 2015, 8:32

Okay... so first of all this thing is fantastic.

Second of all is there a place to report bugs if I find them? I was going to report one but you've already fixed it sooo....

Kevsoft M
Topic author, Angry developer
Angry developer
Avatar
Kevsoft M
Topic author, Angry developer
Angry developer
Age: 19
Reputation: 77
Posts: 376
Joined: 26 Apr 2014
Location: Austria

Post #114by Kevsoft » 8 Mar 2015, 9:51

Something Fawful wrote:Okay... so first of all this thing is fantastic.
Thank you!

Something Fawful wrote:Second of all is there a place to report bugs if I find them? I was going to report one but you've already fixed it sooo....
Feel free to post bugs in this thread or open a new thread.
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
Image
Wohlstand in interview:
Spoiler
Image

▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

Sambo M
Count
Count
Avatar
Sambo M
Count
Count
Age: 19
Reputation: 13
Posts: 264
Joined: 27 Jun 2014

Post #115by Sambo » 10 Mar 2015, 6:06

Kevsoft wrote: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
What is the "section" parameter for? I think I get what everything else does.
I don't see why the variables can only be set as strings, though. Couldn't you make it possible to use strings or numbers without the need for concatenation?
(LUA works that way normally anyway, right?)
---------------------------------------------------------------------
Yay! 100th post! :dance: :dance1: :dance2:
Image
Current Project:
Image

Kevsoft M
Topic author, Angry developer
Angry developer
Avatar
Kevsoft M
Topic author, Angry developer
Angry developer
Age: 19
Reputation: 77
Posts: 376
Joined: 26 Apr 2014
Location: Austria

Post #116by Kevsoft » 10 Mar 2015, 15:09

Section is the same as a new "file". If you don't specify the section name, you will get the default name.

The change for strings is just better to use. You can save the data way better in a string format.
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
Image
Wohlstand in interview:
Spoiler
Image

▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

Sambo M
Count
Count
Avatar
Sambo M
Count
Count
Age: 19
Reputation: 13
Posts: 264
Joined: 27 Jun 2014

Post #117by Sambo » 14 Mar 2015, 9:24

The onEvent function isn't working. I get " <name> or "..." expected near ' "exit left" ' (from the top line) when I use this code:

Code: Select all

function onEvent("exit left")
   if level_cleared == 0 then
      _G["saveData"]:set("DCoins", DCoins.. "")
      saveData:save()
      level_cleared = 1
   end
end
Image
Current Project:
Image

Kevsoft M
Topic author, Angry developer
Angry developer
Avatar
Kevsoft M
Topic author, Angry developer
Angry developer
Age: 19
Reputation: 77
Posts: 376
Joined: 26 Apr 2014
Location: Austria

Post #118by Kevsoft » 14 Mar 2015, 22:12

The same error, a lot of other people had.

instead of
Sambo wrote:

Code: Select all

function onEvent("exit left")
    if level_cleared == 0 then
        _G["saveData"]:set("DCoins", DCoins.. "")
        saveData:save()
        level_cleared = 1
    end
end
you do:

Code: Select all

function onEvent(eventName)
    if eventName == "eventName" then
        if level_cleared == 0 then
            _G["saveData"]:set("DCoins", DCoins.. "")
            saveData:save()
            level_cleared = 1
        end
    end
end

Events are just functions with parameter, you cannot put a raw string as a parameter.
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
Image
Wohlstand in interview:
Spoiler
Image

▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

Kevsoft M
Topic author, Angry developer
Angry developer
Avatar
Kevsoft M
Topic author, Angry developer
Angry developer
Age: 19
Reputation: 77
Posts: 376
Joined: 26 Apr 2014
Location: Austria

Post #119by Kevsoft » 19 Mar 2015, 19:40

LunaLua v0.6.1 is out with following changes:

Spoiler
* Resturctured Audio Module [Tutorial]
* New Defines Module
* Added function spawnEffect (replaces runAnimation)
* Added new fields towards the Animation Class
* Added some new function signature overloads for spawnNPC
* Optimzed the VBStr fields, they can now be assigned directly to a string.
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
Image
Wohlstand in interview:
Spoiler
Image

▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

Kevsoft M
Topic author, Angry developer
Angry developer
Avatar
Kevsoft M
Topic author, Angry developer
Angry developer
Age: 19
Reputation: 77
Posts: 376
Joined: 26 Apr 2014
Location: Austria

Post #120by Kevsoft » 20 Mar 2015, 18:50

A LunaLua Hotfix (v0.6.1.1) is out which fixes NPC.direction.
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
Image
Wohlstand in interview:
Spoiler
Image

▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬


Return to “LunaLua - Extension Framework”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest