LunaLua Offical Thread

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.

Shall I stream some LunaLua live development?

Yes
15
tb1024, h2643, hacheipe399, Wohlstand, cramps-man, Lotus006, wes, Saronin, Super Mario Player, 9th_core, MomsResetti, S.Koopa0, 5438ASPGE71
100%
No
2
Toshiie, 6824
13%
 
Total voters: 15
Kevsoft M
Topic author, Angry developer
Angry developer
Avatar
Kevsoft M
Topic author, Angry developer
Angry developer
Age: 25
Reputation: 93
Posts: 379
Joined: 26 Apr 2014
Location: Austria
Website

Post #1by Kevsoft » 13 Sep 2014, 12:55

I recently had the idea if I should stream some LunaLua live development. Just say if you would be interested or not.



Heya all, I'm here to present Lunadll with Lua (Alpha-Version)!
I used most of the last week to work on this, and I think it's turning out pretty well. The problem with Autocode (the lunadll-language) is the lack of flexibility that it has (such as the way it lacks custom functions, variables.etc).

So first of all: What is lua?
Lua is an actual script language, which supports custom functions, variables and much more. The script type is something like JavaScript + Visual Basic

Download
LunaDLL for lua reference & example page (outdated since v0.2.7)
PLEASE NOTE: I am currently rewriting the documentary HERE: http://wohlsoft.ru/wiki/index.php?title=Category:LunaLua_API
LunaLua Tutorial
You might want to google other lua tutorials too.

How to install:
1. You'll need a "hexed" smbx client (A2XT or Raw)
2. If you have finished setting up everything, then download this (if you haven't already), replace Lunadll.dll with the new dll and copy the Lua dlls.
3. There is an example folder in the zip file containing two examples. To use them, copy the lua file in the custom folder of your level and rename it to "lunadll.lua" (similiar to lunadll.txt)
3.1. Example "wind.lua" - moves the character +1 of the x-coordinates to simulate wind (pretty fun :P)
3.2. Example "harmtest.lua" - every 1000 frames, the player gets a "fake-hit"

Which lua-libs can I access?

Code: Select all

string.*
math.*
table.*
debug.*
os.* --Limited (only time/date works), because of security reasons
Last edited by Kevsoft on 16 Sep 2014, 19:38, edited 6 times in total.
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

elitalianoverde M
Honourable citizen
Honourable citizen
Avatar
elitalianoverde M
Honourable citizen
Honourable citizen
Reputation: 8
Posts: 35
Joined: 17 May 2014
Location: Spain

Post #2by elitalianoverde » 13 Sep 2014, 15:44

Oh! NICE! I actually know a lot about lua! This will be great!
Image

If my English seems lazy or sloppy at times, that's because me vale bien y bonito soy Español :V

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

Post #3by Kevsoft » 13 Sep 2014, 15:51

With luck, I might get this version into talkhouse :D!
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

elitalianoverde M
Honourable citizen
Honourable citizen
Avatar
elitalianoverde M
Honourable citizen
Honourable citizen
Reputation: 8
Posts: 35
Joined: 17 May 2014
Location: Spain

Post #4by elitalianoverde » 13 Sep 2014, 15:59

So you somehow managed to get all this stuff into lua then?
http://www.gamearchaeology.com/LunaDLL.html

these two are like examples i think
http://www.gamearchaeology.com/lunaref.txt
http://www.gamearchaeology.com/TUTORIAL.txt
Image

If my English seems lazy or sloppy at times, that's because me vale bien y bonito soy Español :V

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 #5by Wohlstand » 13 Sep 2014, 16:09

elitalianoverde, also I'm collecting these info to my "Collected" archive http://wohlsoft.ru/docs/Collected/LunaDLL/
Image

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

Post #6by Kevsoft » 13 Sep 2014, 16:17

There is not everything in it yet, also it is completly diffrent.

Instead of:

Code: Select all

#0
FilterToSmall,0,0,0,0,0,0
#END

you use:

Code: Select all

function onLoopSection0()
   player.powerup = SMALL
end


and if you wanna do it only once:

Code: Select all

doOnce = true
function onLoad()
   doOnce = true
end
function onLoopSection0()
   if(doOnce)then --Does on the first run of this loop!
      player.powerup = SMALL
      doOnce = false
   end
end


You see, it is more script-style...
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

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

Post #7by Veudekato » 13 Sep 2014, 16:43

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

Alucard
Our friend
Our friend
Avatar
Alucard
Our friend
Our friend
Reputation: 8
Posts: 64
Joined: 5 May 2014

Post #8by Alucard » 13 Sep 2014, 20:11

For DareDevil comet level, a script is much simplier:
"daredevil.lua"

Code: Select all


[int]MOUNT_NONE = 0
[int]NPC_NONE = 0

function onLoad()
 player.powerup = SMALL
 player.mount = MOUNT_NONE
 player.reservePowerup = NPC_NONE
end

Another suggestion: onLoad() should run before first frame is drawn on screen.

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

Post #9by Kevsoft » 13 Sep 2014, 20:14

I will do something like that, btw, remove the [int], this is not a part of the script, it is just a indicator what is required
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

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

Post #10by tb1024 » 13 Sep 2014, 21:21

One I day I had a dream where LunaDLL used Lua.
Did I preview the future?
Anyway, gonna try it. LunaDLL really sucked because it was a assembler-like language, but now it is a true programming language.
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

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 » 13 Sep 2014, 21:27

Code: Select all

.model tiny
.code
org 100h
main  proc
      mov    ah,9
      mov    dx,offset to_tb1024
      int    21h
      retn
to_tb1024 db 'Yea, is not easy$'
main  endp
end   main


:biggrin:
Image

Alucard
Our friend
Our friend
Avatar
Alucard
Our friend
Our friend
Reputation: 8
Posts: 64
Joined: 5 May 2014

Post #12by Alucard » 13 Sep 2014, 21:46

Kevsoft wrote:I will do something like that, btw, remove the [int], this is not a part of the script, it is just a indicator what is required
I have previously getting used to C & C++. :facepalm:

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

Post #13by Kevsoft » 13 Sep 2014, 22:05

Lua is like Javascript :P Variables can be redefined and don't need a type-signature!
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

FanofSMBX
Contributor
Contributor
FanofSMBX
Contributor
Contributor
Reputation: 19
Posts: 61
Joined: 24 Jun 2014

Post #14by FanofSMBX » 14 Sep 2014, 0:42

Can this do anything more than regular lunadll can?

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 #15by Wohlstand » 14 Sep 2014, 0:43

FanofSMBX wrote:Can this do anything more than regular lunadll can?
Yes, because Lua is addon over regular LunaDLL, and was built together with regular LunaDLL's sources, and you can use AND regular LunaDLL commands, AND lua scripts
Image

Luigifan2010 M
Developer
Developer
Avatar
Luigifan2010 M
Developer
Developer
Reputation: 6
Posts: 31
Joined: 29 Mar 2014

Post #16by Luigifan2010 » 14 Sep 2014, 20:07

Name is LuaDLL please ;-)

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 #17by Wohlstand » 14 Sep 2014, 20:10

Luigifan2010 wrote:Name is LuaDLL please ;-)
Better: LunaLUA :) which working over LunaAssembly - main LunaDLL's script language
Image

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

Post #18by tb1024 » 14 Sep 2014, 23:02

I prefer LuaDLL. It fits both as a parody of LunaDLL and to show the programming language.
Wohlstand wrote:
Luigifan2010 wrote:Name is LuaDLL please ;-)
Better: LunaLUA :) which working over LunaAssembly - main LunaDLL's script language
LunaDLL's language has no name. I call it LunaDLL's Assembler-Like Language just to have something to call it.


Darkchao made a LunaTXT generator, but it is so crappy I laughed about it.
It still requires LunaDLL knowledge, still require a memory offset knowledge... Thing that Kevsoft will surely simplify.


Kev, is this a LunaDLL modded from source?
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

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

Post #19by Kevsoft » 14 Sep 2014, 23:55

tb1024 wrote:Kev, is this a LunaDLL modded from source?
Yes it is modded from source. Probably tomorrow I will release the next version, which I will post on talkhaus too.
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

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

Post #20by tb1024 » 15 Sep 2014, 4:27

My suggestions:
  • Instead of using hex addresses in memory, we can provide a type which will provide these addresses as variables. Example: Instead of using the 0x+118 address to change the NPC direction, we could use a [npc-name].direction variable. We can still leave the hex addresses for both backwards compatibility and when a value is not available as variable .
  • Provide some built-in functions (like Layer_Hide()).
  • Write a reference.
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


Return to “LunaLua - Extension Framework”

Who is online (over the past 5 minutes)

Users browsing this forum: 5 guests