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
Lotus006
Nice citizen
Nice citizen
Lotus006
Nice citizen
Nice citizen
Reputation: 1
Posts: 15
Joined: 6 Oct 2015

Post #161by Lotus006 » 12 Nov 2015, 11:51

Thanks Kevsoft for the "Defines" stuff it will be very usefull :D

Sorry also for the lack of without post anything, and also I re-re-work again on re-doing the code of my Inv. Menu and cheats menu stuff. :D

I reduced to 400 lines from about aprox. 1300 lines :) , but for now I'm stuck about to making a table for the inventory but I can't follow anymore because it wont work like I want. If some one can help me just to find a better way to stock items in my inventory (I mean more in a table) it could be very easier :)

there is an example about where I am now :P

Also I just show the necessary stuff in the code ( it's possible I missed some lines but you get the point :) )

I want to have a table look like but I know it can't work like this, but if anyone have an idea :D


The Code I want to do

Code: Select all

 -- 1= Mushroom, 2= FireFlowers, 3= Leaf, 4= IceFlowers, 5= Tanookie, 6= SledgeHammer ...

ItemsInvRow1 =  { 1,2,3,4,5,6 }
ItemsInvRow2 =  { 1,3,1,4,1,4 }
 -- Can up to five Row Stock



The code I have now

Code: Select all

[...]

ItemsSelSpritesPosX = {0, 5, 10, 15, 20, 25.3}
ItemsSelSpritesPosY = {-3, 0, -4, 0, 0, -3}



local UnItems1 = UnSelMushroom
local UnItems2 = UnSelflower
local UnItems3 = UnSeltanookie
local UnItems4 = UnSelleafsmb3
local UnItems5 = UnSelIceflower
local UnItems6 = UnSelHammer



local SelItems1 = SelMushroom
local SelItems2 = Selflower
local SelItems3 = Seltanookie
local SelItems4 = Selleafsmb3
local SelItems5 = SelIceflower
local SelItems6 = SelHammer

 

local PowerUpsSelSprites = {
SelItems1 ;
SelItems2 ;
SelItems3 ;
SelItems4 ;
SelItems5 ;
SelItems6
}

 

local PowerUpsUnSelSprites = {
 UnItems1 ;
 UnItems2 ;
 UnItems3 ;
 UnItems4 ;
 UnItems5 ;
 UnItems6
}



local powerupsitemsstock = {
PLAYER_BIG ;
PLAYER_FIREFLOWER ;
PLAYER_ICE ;
PLAYER_LEAF ;
PLAYER_TANOOKIE ;
PLAYER_SMALL ;
PLAYER_HAMMER
}


 function DebugMenuTest_API.onInitAPI()
   registerEvent(DebugMenuTest_API, "onLoop", "onLoopOverride");
    registerEvent(DebugMenuTest_API, "onLoad", "onLoadOverride");
    registerEvent(DebugMenuTest_API, "onInputUpdate", "onInputUpdateOverride");
   

 
 end

 
function DebugMenuTest_API.onLoopOverride()

[...]

 local TimerA = math.floor(PosItemsX)

 for k,v in pairs (PowerUpsUnSelSprites) do
 
 
 for i=1, GetLinePUpsUnSelSprites   do
 
      
Graphics.unplaceSprites( PowerUpsUnSelSprites[k])
       Graphics.placeSprite(1,  PowerUpsUnSelSprites[k] , 190 + 15 * ItemsSelSpritesPosX[k] , 535 + 1 * ItemsSelSpritesPosY[k]);    
      
       Graphics.unplaceSprites(PowerUpsSelSprites[TimerA])
   Graphics.placeSprite(1, PowerUpsSelSprites[TimerA], 190 + 15 * ItemsSelSpritesPosX[TimerA] , 535 + 1 * ItemsSelSpritesPosY[TimerA]);
 end



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 #162by Kevsoft » 12 Nov 2015, 16:54

Code: Select all

local PowerUpsUnSelSprites = {
 UnItems1 ;
 UnItems2 ;
 UnItems3 ;
 UnItems4 ;
 UnItems5 ;
 UnItems6
}


I am pretty sure, that table elements are seperated by colons ",".
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

Lotus006
Nice citizen
Nice citizen
Lotus006
Nice citizen
Nice citizen
Reputation: 1
Posts: 15
Joined: 6 Oct 2015

Post #163by Lotus006 » 12 Nov 2015, 22:24

both are working I dont know why but about table is there a way to do like table replace instead of remove ?
when I remove some elements in my table PowerUpsUnSelSprites or the other one it's say that error :
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 #164by Kevsoft » 13 Nov 2015, 12:27

I think you have to do it like that:

Code: Select all

local PowerUpsUnSelSprites = {
 UnItems1 = SelMushroom,
 UnItems2 = Selflower,
 UnItems3 = Seltanookie,
 UnItems4 = Selleafsmb3,
 UnItems5 = SelIceflower,
 UnItems6 = SelHammer
}
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

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 #165by Kevsoft » 14 Nov 2015, 10:18

LunaLua v0.7.2.2 has been released with following changes:
Spoiler
* Extended NPC class
* Bugfix [LunaLua]: Fixed Camera.width and Camera.height
* Bugfix [LunaLua]: Fixed the bug, where the functions Blocks.get and Blocks.getInterseting don't includes the last block.
* Added onNPCKill event
* Block can now be spawned with Block.spawn(...)
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

Lotus006
Nice citizen
Nice citizen
Lotus006
Nice citizen
Nice citizen
Reputation: 1
Posts: 15
Joined: 6 Oct 2015

Post #166by Lotus006 » 15 Nov 2015, 10:40

Cool Thnx for the update again Kevsoft :D

I think to rethink again (yep again lol damn) the way to implant slot in my Inventory :(

@Kevsoft, Is there a way to get the mouse position like in the level editor ?
or if not can you in a future update to get this feature possible ?

thanks in advance :P

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 #167by Kevsoft » 15 Nov 2015, 23:18

Lotus006 wrote:I think to rethink again
Feeling the same. Because I have to redesign some core LunaLua parts which eats my time. But you have to keep doing it.

Lotus006 wrote:@Kevsoft, Is there a way to get the mouse position like in the level editor ?
I add that to the wishlist, but don't expect that feature to come too soon.
If you have any more suggestions you can add them to the wiki here: http://wohlsoft.ru/pgewiki/LunaLua_Wishlist (you can use your forum login, to login into the wiki)
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

Sambo M
Count
Count
Avatar
Sambo M
Count
Count
Age: 26
Reputation: 15
Posts: 264
Joined: 27 Jun 2014

Post #168by Sambo » 5 Dec 2015, 5:51

The newest version broke SMBX. It won't run at all:
smbx quit working.PNG
smbx quit working.PNG (8.63 KiB) Viewed 8391 times
Image
Current Project:
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 #169by Kevsoft » 5 Dec 2015, 10:01

Download the nightly build, but only copy SDL2_mixer_ext.dll
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

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 #170by Wohlstand » 5 Dec 2015, 15:40

Okay, I just fixed deploy: I appended updated SDL2_mixer_ext.dll and removed all generated ZIP's, so, people in next time are will not take same trouble ;-)
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 #171by Kevsoft » 30 Jan 2016, 11:25

LunaLua v0.7.3 is finally released. I apologize for the long waiting, but there where a lot of critical changes in this version.
Please make sure that your CC12 level is working with this version!

So here is the changelog:
Spoiler
* Custom images can now be drawn behind SMBX sprites.
* Hardcoded images can now be patched via hardcoded-*.png
* Added new compareLunaVersion for version checking
* Added new event onKeyboardPress which handles raw keyboard input
* Added new draw function (Graphics.draw [Named args])
* Added new OpenGL drawing system (Graphics.glDraw [Named args])
* Added new lua based pause function: Misc.pause, Misc.unpause, Misc.isPausedByLua
* Improvement [LunaLua]: Refactored mainV2.lua for better performance and smaller code
* Added new function for better controlling the loop: onTick, onTickEnd, onDraw, onDrawEnd
* Improvement [LunaLua]: onHUDDraw and onCameraUpdate now has the camera index as argument.
* Improvement [LunaLua]: onMessageBox can now be cancelled
* Added FIELD_BOOL which can be used for the mem-functions.
* Added NPC.get overload with only the npc-id as argument.
* Bugfix [LunaLua]: SMBX doesn't crash anymore, if you pass nil to some LunaLua functions.
* Improvement [LunaLua]: The max npc id is now 300
* Added NPC:harm
* Bugfix [LunaLua]: Tiles can now correctly be replaced with PNGs.
* Bugfix [LunaLua]: PlayerSetting.height was pointing to players width
* Extended Camera class
* Bugfix [LunaLua]: Cheat defines now don't reset.
* Added registerCustomEvent, so you can create custom events from your APIs.
* Added event onCameraUpdate and Camera.x, Camera.y is now writeable.
* Added a lot of new world map classes.
* Added Misc.doPSwitchRaw - You can now trigger the raw P-Switch effect.
* Added Misc.doPSwitch - You can now trigger the full P-Switch effect.
* Added Misc.doBombExplosion - You can now spawn bomb explosions.
* Bugfix [LunaLua]: Misc.resolveFile and Misc.resolveDirectory don't crash anymore and works faster now.
* Bugfix [LunaLua]: Some unreliability of Animation.spawn has been fixed.
* Bugfix [LunaLua]: Level sounds.ini now works correctly when using from the main game
* Bugfix [LunaLua]: Hitboxes and offsets are now reset before loading a new level or world
* Bugfix [LunaLua]: Misc.loadEpisode now works also without Autostart ini file.
* Added onStart - This event is the better "onLoad". This event will be executed, when SMBX is running the first frame.
* Fixed music.ini bug which wasn't supported track number suffix for NSF/HES/etc. multi-track musics
* NPCs can now be killed, even if they are hidden.
* Add width/height properties to LuaImageResource.
* Allow onNPCKill to be cancelled.
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

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

Post #172by FanofSMBX » 6 Feb 2016, 2:49

You know NPC defeat cancellation? Can this be changed so that there are new NPC codes that you can put in .txt? This would be convenient so I can pack these with my graphics.

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 #173by Wohlstand » 6 Feb 2016, 15:32

We are need to hook default NPC.txt parser and replace it with our (I already have PGE File Library which I can use to overwrite built-in NPC.txt and file parsers)
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 #174by Kevsoft » 1 Apr 2016, 16:23

Hey guys!

I have exciting news about the next version of LunaDLL. You can read about it here: http://wohlsoft.ru/
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ 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 #175by tb1024 » 1 Apr 2016, 16:37

Best april fools joke.
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

h2643 M
Forum admin
Forum admin
Avatar
h2643 M
Forum admin
Forum admin
Age: 23
Reputation: 112
Posts: 330
Joined: 15 Feb 2014
Location: Ukraine
YouTube

Post #176by h2643 » 1 Apr 2016, 16:45

oh man i am sooo hyped!!!!1
<Knux> h2643 the super computer

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

Post #177by lighthouse64 » 4 Apr 2016, 23:38

Wow can't wait for the release. (I'm so late though :P) -_-
Player of hedgewars!!! :)
And hi... it's me from smbx
Currently bug testing for Mac :apple: And Windows :windows:

Professor Moriarty
Citizen
Citizen
Professor Moriarty
Citizen
Citizen
Reputation: 0
Posts: 5
Joined: 2 Dec 2016

Post #178by Professor Moriarty » 3 Dec 2016, 15:11

am I doing something wrong, or has Autocode been removed?

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 #179by Kevsoft » 3 Dec 2016, 20:48

Autocode has been deprecated but it does still work.
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

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 #180by Wohlstand » 4 Dec 2016, 4:29

Kevsoft, I'll append:
Professor Moriarty wrote:am I doing something wrong, or has Autocode been removed?
Just kept for compatibility with exists stuff. This part is no more takes updates. However, a quick guide to migrate from Autocode to Lua but keep same logic. Lua is much more flexible and embeddable language with wide community and usage purposes. Autocode is even not a Turing-complete language which lacks a lot of many common features.
Image


Return to “LunaLua - Extension Framework”

Who is online (over the past 5 minutes)

Users browsing this forum: 2 guests