Page 1 of 1

How to Download, Install and Use LunaLua (F.A.Q.)

Posted: 14 Jun 2014, 19:37
by Veudekato
Q: What is LunaLua?
A: LunaLua is an SMBX Extension Module.

Q: Where can I download it?
A: viewtopic.php?f=26&t=329 (direct link: http://wohlsoft.ru/LunaLua/)

Q: How to install LunaLua to my SMBX?
A: Go to the link I posted above, it contains every necessary components (which are: SMBX 1.3.0.2 and basically, LunaLua).

Video tutorial:
http://www.youtube.com/watch?v=tIe6ZRgUCAo&feature=youtu.be

Q: AVAST says that LunaLua is a virus.
A: It's a false alarm, ignore it. It is recomended to put an exception for LunaLua in your antivirus too.

Q: How to use LunaLua in my level?
A:
  • make LUA file called 'lunadll.lua' (or lunadll.txt for autocode (LunaDLL)) and put it in the same folder directory where you'd usually have custom graphics (if your level is called 'mylevel', create a new folder and call it 'mylevel' - both should be in the same folder!)
  • Type your LUA code in lunadll.lua

Q: Any examples of LUA codes?
A:
LUA code examples
Makes every blue Shy-Guy running super fast:

Code: Select all

function onLoop()
  allNPCs = findnpcs(20,player.section)
  for k,v in pairs(allNPCs) do
    if(v.direction == DIR_RIGHT)then
      v.speedX = 5
    else
      v.speedX = -5

    end
  end
end


Makes every blue Shy-Guy jump every 100 frames.

Code: Select all

i = 0

function onLoad()
  i = 0
end

function onLoop()
  i = i + 1
  if(i % 100 == 0)then
    allNPCs = findnpcs(20,player.section)
    for k,v in pairs(allNPCs) do
      v.speedY = -8
    end
  end
end



Let the player jump up when it reaches a specific y-value.

Code: Select all

function onLoop()
  if(player.y > -200320)then
    player.speedY = -10
  end
end



Some debug info.

Code: Select all

i = 0

function onLoad()
  i = 0
end

function onLoop()
  printText("RUNNING "..tostring(i).." FRAMES", 30, 30)
  printText("PLAYER COOR "..tostring(player.x).." "..tostring(player.y), 30, 60)
end


A new powerup every 200 frames (powerup roulett)

Code: Select all

i = 0

function onLoad()
  i = 0
end

function onLoop()
  i = i + 1
  if(i % 200 == 0)then
    player.powerup = math.random(1,7)
  end
end


A jump-counter with the new variable bank!

Code: Select all

function onLoop()
  if(UserData.getValue("jump-counter"))then
    printText("Jumps: "..tostring(UserData.values()["jump-counter"]), 30, 160) -- values()[value-Name] can be used too, to get the a value
  end
end

function onJump(plIndex)
  if(UserData.getValue("jump-counter"))then
    UserData.setValue("jump-counter", UserData.getValue("jump-counter")+1)
  else
    UserData.setValue("jump-counter", 1)
  end
  UserData.save()
end


It's only some basics.

LunaLua documentation:
http://wohlsoft.ru/pgewiki/Category:LunaLua_API

Q: How can I know if my LunaLua works?
A: Once you launch your SMBX via the "Start Game" button, at the top left corner of the screen, you should see "LunaLua v.#.#.#.#" (where #s are version numbers). If you see that, congratulations, your LunaLua works!

Q: Is there any storage for all the LunaLUA APIs (helper libraries)?
A: Yes, most (if not all) LunaLUA APIs are kept here:
http://wohlsoft.ru/pgewiki/Category:LunaLua_helper_libraries

If I didn't answered your questions, then feel free to ask them here!

Posted: 30 Aug 2014, 12:32
by Veudekato
Updated

Posted: 7 Oct 2014, 12:38
by Veudekato
Added video

Uh

Posted: 8 Mar 2015, 8:15
by lighthouse64
About this.

Q:AVAST says: here is a virus
A:its false alarm.ignore him.

You may want to change the answer because it takes a lot more than ignoring. :p You'll probably need to turn off your antivirus when downloading lunadll, then try to add it to some kind of whitelist. And just to be clear, it's the smbx exe file that is called a virus, not the lunaDLL file.
I'll write a new one.

Q:Why does my antivirus say it is a virus?
A:It's a considered a virus because it's hacked by lunadll and your computer thinks it'll be a threat when it's actually safe. To download it without lunaDLL being deleted, first turn off your antivirus, and then try to add it to an exceptions list/ whitelist, etc.

Posted: 8 Mar 2015, 9:53
by Kevsoft
Veudekato wrote:Q:Where i can download it?
A: http://wohlsoft.ru/docs/Collected/LunaDLL/
Could you update the link please. It is way outdated.

Posted: 8 Mar 2015, 17:36
by lighthouse64
Kevsoft wrote:
Veudekato wrote:Q:Where i can download it?
A: http://wohlsoft.ru/docs/Collected/LunaDLL/
Could you update the link please. It is way outdated.
Wait, Can't mods edit posts?

Posted: 8 Mar 2015, 18:09
by Wohlstand
lighthouse64 wrote:
Kevsoft wrote:
Veudekato wrote:Q:Where i can download it?
A: http://wohlsoft.ru/docs/Collected/LunaDLL/
Could you update the link please. It is way outdated.
Wait, Can't mods edit posts?
I will edit it ;-)

Posted: 8 Mar 2015, 20:46
by lighthouse64
Wohlstand wrote:
lighthouse64 wrote:
Kevsoft wrote:
Veudekato wrote:Q:Where i can download it?
A: http://wohlsoft.ru/docs/Collected/LunaDLL/
Could you update the link please. It is way outdated.
Wait, Can't mods edit posts?
I will edit it ;-)
THX :) now this will make things easier :good:

Spoiler
I wish he put my thing in :p :mrgreen:

Posted: 9 Mar 2015, 14:24
by tb1024
Specifically for Avast, you can avoid the warning and removal of Lunadll's SMBX.exe by disabling "Scan programs on execution" and "Scan libraries (DLLs) on execution". I'm using a portuguese avast and Windows installation so the translation isn't so accurate.
Image

Posted: 10 Mar 2015, 19:17
by Veudekato
Why you put link to lunalua? This topic ONLY about lunadll

Posted: 10 Mar 2015, 19:19
by Wohlstand
Veudekato wrote:Why you put link to lunalua? This topic ONLY about lunadll
LunaLUA - is a direct successor based on the LunaDLL and fully compatible with them. Old LunaDLL's now are legacy

Posted: 10 Mar 2015, 21:55
by lighthouse64
Wohlstand wrote:
Veudekato wrote:Why you put link to lunalua? This topic ONLY about lunadll
LunaLUA - is a direct successor based on the LunaDLL and fully compatible with them. Old LunaDLL's now are legacy
Wait, Lunadll.txt is outdated?!

Posted: 10 Mar 2015, 23:39
by Wohlstand
lighthouse64 wrote:
Wohlstand wrote:
Veudekato wrote:Why you put link to lunalua? This topic ONLY about lunadll
LunaLUA - is a direct successor based on the LunaDLL and fully compatible with them. Old LunaDLL's now are legacy
Wait, Lunadll.txt is outdated?!
After LunaLUA implemented, lunadll.txt subsystem no more updates, but leaved to save compatibility. All new features and things are available for lunadll.lua subsystem.
Unlike declarative Autocode, LUA providing ability to write algoritmic events. Lua variables, functions, conditions, etc. I.e. full featured script programm language.

Posted: 11 Mar 2015, 7:39
by lighthouse64
Wohlstand wrote:
lighthouse64 wrote:
Wohlstand wrote:
Veudekato wrote:Why you put link to lunalua? This topic ONLY about lunadll
LunaLUA - is a direct successor based on the LunaDLL and fully compatible with them. Old LunaDLL's now are legacy
Wait, Lunadll.txt is outdated?!
After LunaLUA implemented, lunadll.txt subsystem no more updates, but leaved to save compatibility. All new features and things are available for lunadll.lua subsystem.
Unlike declarative Autocode, LUA providing ability to write algoritmic events. Lua variables, functions, conditions, etc. I.e. full featured script programm language.
Ok, I see. And this is actually a pretty common language for games. (roblox uses it.)