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

Description: Archive discussion
============================
Original 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.

Veudekato M
Topic author, Viscount
Viscount
Avatar
Veudekato M
Topic author, Viscount
Viscount
Reputation: 79
Posts: 369
Joined: 19 Feb 2014
Location: Russia

Post #1by Veudekato » 14 Jun 2014, 19:37

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!
Last edited by h2643 on 8 Nov 2015, 0:18, edited 15 times in total.
My channel (PlatGEnWohl news and tutorials , smbx tests):
http://www.youtube.com/channel/UC6h-42umT14iR1wa3VkOs3Q

Veudekato M
Topic author, Viscount
Viscount
Avatar
Veudekato M
Topic author, Viscount
Viscount
Reputation: 79
Posts: 369
Joined: 19 Feb 2014
Location: Russia

Post #2by Veudekato » 30 Aug 2014, 12:32

Updated
My channel (PlatGEnWohl news and tutorials , smbx tests):
http://www.youtube.com/channel/UC6h-42umT14iR1wa3VkOs3Q

Veudekato M
Topic author, Viscount
Viscount
Avatar
Veudekato M
Topic author, Viscount
Viscount
Reputation: 79
Posts: 369
Joined: 19 Feb 2014
Location: Russia

Post #3by Veudekato » 7 Oct 2014, 12:38

Added video
My channel (PlatGEnWohl news and tutorials , smbx tests):
http://www.youtube.com/channel/UC6h-42umT14iR1wa3VkOs3Q

lighthouse64 M
Duke
Duke
Avatar
lighthouse64 M
Duke
Duke
Age: 21
Reputation: 19
Posts: 132
Joined: 15 Feb 2015
Location: IDK!

Uh

Post #4by lighthouse64 » 8 Mar 2015, 8:15

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.
Player of hedgewars!!! :)
And hi... it's me from smbx
Currently bug testing for Mac :apple: And Windows :windows:

Kevsoft M
Angry developer
Angry developer
Avatar
Kevsoft M
Angry developer
Angry developer
Age: 25
Reputation: 93
Posts: 379
Joined: 26 Apr 2014
Location: Austria
Website

Post #5by Kevsoft » 8 Mar 2015, 9:53

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.
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

lighthouse64 M
Duke
Duke
Avatar
lighthouse64 M
Duke
Duke
Age: 21
Reputation: 19
Posts: 132
Joined: 15 Feb 2015
Location: IDK!

Post #6by lighthouse64 » 8 Mar 2015, 17:36

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?
Player of hedgewars!!! :)
And hi... it's me from smbx
Currently bug testing for Mac :apple: And Windows :windows:

Wohlstand M
Lead Developer
Lead Developer
Avatar
Wohlstand M
Lead Developer
Lead Developer
Age: 31
Reputation: 507
Posts: 1825
Joined: 15 Feb 2014
English Pronouns: he/him
Location: Moscow, Russia
Website Youtube channel URL Skype Tencent QQ

Post #7by Wohlstand » 8 Mar 2015, 18:09

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 ;-)
Image

lighthouse64 M
Duke
Duke
Avatar
lighthouse64 M
Duke
Duke
Age: 21
Reputation: 19
Posts: 132
Joined: 15 Feb 2015
Location: IDK!

Post #8by lighthouse64 » 8 Mar 2015, 20:46

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:
Player of hedgewars!!! :)
And hi... it's me from smbx
Currently bug testing for Mac :apple: And Windows :windows:

tb1024 M
Marquis
Marquis
tb1024 M
Marquis
Marquis
Age: 22
Reputation: 34
Posts: 170
Joined: 31 Jul 2014
Location: Brazil, America, World

Post #9by tb1024 » 9 Mar 2015, 14:24

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
Do you want fries with that?
Image
Mal posso esperar para a versão final da engine de Wolhstand!
English Translation
I can't wait for Wohlstand's Engine final version :D

Veudekato M
Topic author, Viscount
Viscount
Avatar
Veudekato M
Topic author, Viscount
Viscount
Reputation: 79
Posts: 369
Joined: 19 Feb 2014
Location: Russia

Post #10by Veudekato » 10 Mar 2015, 19:17

Why you put link to lunalua? This topic ONLY about lunadll
My channel (PlatGEnWohl news and tutorials , smbx tests):
http://www.youtube.com/channel/UC6h-42umT14iR1wa3VkOs3Q

Wohlstand M
Lead Developer
Lead Developer
Avatar
Wohlstand M
Lead Developer
Lead Developer
Age: 31
Reputation: 507
Posts: 1825
Joined: 15 Feb 2014
English Pronouns: he/him
Location: Moscow, Russia
Website Youtube channel URL Skype Tencent QQ

Post #11by Wohlstand » 10 Mar 2015, 19:19

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
Image

lighthouse64 M
Duke
Duke
Avatar
lighthouse64 M
Duke
Duke
Age: 21
Reputation: 19
Posts: 132
Joined: 15 Feb 2015
Location: IDK!

Post #12by lighthouse64 » 10 Mar 2015, 21:55

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?!
Player of hedgewars!!! :)
And hi... it's me from smbx
Currently bug testing for Mac :apple: And Windows :windows:

Wohlstand M
Lead Developer
Lead Developer
Avatar
Wohlstand M
Lead Developer
Lead Developer
Age: 31
Reputation: 507
Posts: 1825
Joined: 15 Feb 2014
English Pronouns: he/him
Location: Moscow, Russia
Website Youtube channel URL Skype Tencent QQ

Post #13by Wohlstand » 10 Mar 2015, 23:39

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.
Image

lighthouse64 M
Duke
Duke
Avatar
lighthouse64 M
Duke
Duke
Age: 21
Reputation: 19
Posts: 132
Joined: 15 Feb 2015
Location: IDK!

Post #14by lighthouse64 » 11 Mar 2015, 7:39

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.)
Player of hedgewars!!! :)
And hi... it's me from smbx
Currently bug testing for Mac :apple: And Windows :windows:


Return to “LunaLua - Extension Framework”

Who is online (over the past 5 minutes)

Users browsing this forum: 3 guests