LunaLua Offical Thread - SMBX Usermod Framework

This is the place for discussion and support for LunaLua and related modifications and libraries.
Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?

Shall I steam some LunaLua live development?

Yes
200
92%
No
17
8%
 
Total votes: 217
lotus006
Mega Mole
Mega Mole
Posts: 284
Joined: Thu Sep 24, 2015 12:59 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby lotus006 » Sun Jan 17, 2016 9:55 am

PixelPest wrote:
lotus006 wrote:try this :

Code: Select all

MyNpcTest = 10
for k, v in pairs(NPC.get(MyNpcTest, -1)) do
 v.id = 210; --change all smb3 coins into rinkas
     end
thanks to you hehe I just learn this my self
I didnt know this one can change the things already in game
I wanna think only thing we spawn in game :P

But I tested this onLoop section for now
Thanks for trying to help but that code doesn't seem to work and it's a mess. There's really no reason to have
MyNpcTest = 10 when inside the brackets you can just write (10, -1). The form of the code itself is also a mess. It should be formatted as:

Code: Select all

function onTick()
	for k, v in pairs(NPC.get(10, -1)) do
		v.id = 210; --change all smb3 coins into rinkas
	end
end
I dont know why is not working on your side, on my is work well but I think the way you put the Id. 10 could work too :D
did you put it on onLoop section ?


and

I have the 0.7.3 , and I got this error index on the first code of PixelPest
table.getn(tableOfShiny).id = 210; --change all smb3 coins into rinkas
attempt to index a number value

User avatar
PixelPest
Link
Link
Posts: 7118
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PixelPest » Sun Jan 17, 2016 9:59 am

Lotus, could you please post exactly what you tested with the function and everything?

lotus006
Mega Mole
Mega Mole
Posts: 284
Joined: Thu Sep 24, 2015 12:59 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby lotus006 » Sun Jan 17, 2016 10:02 am

PixelPest wrote:Lotus, could you please post exactly what you tested with the function and everything?
try this in your lunaworld.lua it should work too, just for testing:

Code: Select all

function onLoop()
for k, v in pairs(NPC.get(10, -1)) do
	 v.id = 210; --change all smb3 coins into rinkas
end
end
     
Edit : it work also with (NPC.get(10, -1)) see above instead of MyNPCTest

User avatar
Kevsoft
Ripper II
Ripper II
Posts: 373
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Kevsoft » Sun Jan 17, 2016 12:50 pm

lotus006 wrote:thnx I will check this soon :)
but how work "onDraw" and "onThick" and "onStart"
I'm little confused about those one :S

but onLoop and onLoad its ok i understand better now those one since i tried to do my inventory mod since a month :P

thanks
Basically:

Code: Select all

function onDraw()
...
end
... is called before SMBX draws anything.

Code: Select all

function onTick()
...
end
The new "onLoop", just with another name

Code: Select all

function onStart()
...
end
Is the first frame of SMBX running. The advantage over onLoad, is that it is guranteed that everything is initialized.

User avatar
Axiom
Birdo
Birdo
Posts: 1489
Joined: Tue Dec 24, 2013 2:23 pm
Current Project: learning C through PSP game programming

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Axiom » Sun Jan 17, 2016 5:52 pm

so can i play the sims in smbx yet
Image

User avatar
PixelPest
Link
Link
Posts: 7118
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PixelPest » Mon Jan 18, 2016 9:10 pm

Here's a fun little API I made--my first real Lua project:
http://www.mediafire.com/download/ibbdv ... kafest.lua

It turns all coins in a level into Rinkas.
Example:
Spoiler: show
Image
Image
Image

jamai3636
Shy Guy
Shy Guy
Posts: 7
Joined: Sun Jan 17, 2016 12:47 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby jamai3636 » Wed Jan 20, 2016 3:49 pm

Having worked on software for a large retail chain I feel I could pick this up very easily - however - whether or not I will use for my next level depends on whether or not there is an event that triggers on death.

That means if there is a way to have something trigger when you die. It would also have to be death from a specific enemy/projectile from the enemy. I guess something like the onNPCKill event but for the player instead.

I looked around but didn't see anything of the sort, maybe I just missed it? Maybe it is also a little too niche to have been implemented. Hopefully not :<

Thanks~

lotus006
Mega Mole
Mega Mole
Posts: 284
Joined: Thu Sep 24, 2015 12:59 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby lotus006 » Wed Jan 20, 2016 7:27 pm

I found a way to see if we alive and it's look working well for now maybe need to verify with all way when the player die because i dont know if all stuff who hurt
is the same for all things :S


for debuging

Code: Select all

 Text.print(  "isAlive:"  .. player:mem(0x13E, FIELD_WORD) , 100, 100)
and the code to use

Code: Select all

player:mem(0x13E, FIELD_WORD) -- Player death animation timer

just put condition bigger than 1 and you will see when the player is dead
enjoy :D

User avatar
Axiom
Birdo
Birdo
Posts: 1489
Joined: Tue Dec 24, 2013 2:23 pm
Current Project: learning C through PSP game programming

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Axiom » Fri Jan 22, 2016 8:45 pm

lotus006 wrote:I found a way to see if we alive and it's look working well for now maybe need to verify with all way when the player die because i dont know if all stuff who hurt
is the same for all things :S


for debuging

Code: Select all

 Text.print(  "isAlive:"  .. player:mem(0x13E, FIELD_WORD) , 100, 100)
and the code to use

Code: Select all

player:mem(0x13E, FIELD_WORD) -- Player death animation timer

just put condition bigger than 1 and you will see when the player is dead
enjoy :D
yup, these fields are how i made my death counter.

https://github.com/Luigifan/lunaluascri ... er.lua#L29
Image

User avatar
HenryRichard
Ludwig von Koopa
Ludwig von Koopa
Posts: 2845
Joined: Mon Dec 23, 2013 12:09 pm
Flair: Is this where I type my password?
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby HenryRichard » Fri Jan 22, 2016 9:25 pm

You can also just use player.DeathTimer

I prefer to use these fields when I can instead of player:mem.
Image

I'm on Soundcloud | My graphics pack!

Jesus is my savior.

User avatar
Axiom
Birdo
Birdo
Posts: 1489
Joined: Tue Dec 24, 2013 2:23 pm
Current Project: learning C through PSP game programming

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Axiom » Sat Jan 23, 2016 6:45 pm

player:mem master race
Image

User avatar
HenryRichard
Ludwig von Koopa
Ludwig von Koopa
Posts: 2845
Joined: Mon Dec 23, 2013 12:09 pm
Flair: Is this where I type my password?
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby HenryRichard » Mon Jan 25, 2016 5:59 pm

So I made a little update to inputs.lua. I've contacted RockyTheChao about it and he said it's fine if I share it, so without further ado,

I present:

INPUTS2.LUA
yay

...It's not much of an update, but it makes it support multiplayer. I'm planning on eventually implementing a few more things, but there isn't really that much more you can add.
Image

I'm on Soundcloud | My graphics pack!

Jesus is my savior.

User avatar
Wohlstand
Boom Boom
Boom Boom
Posts: 1714
Joined: Tue Feb 11, 2014 4:44 pm
Current Project: Moondust (PGE Project)
Chat Username: Wohlstand#4881
Contact:

Big News!

Postby Wohlstand » Thu Jan 28, 2016 5:14 am

Hello!

Yesterday we are migrated PGE Project's and LunaLUA main site to a new server and we now finally have a separated domain name.

New location of PGE Project and LunaLUA downloads, PGE-Wiki ("home" of LunaLUA documentation), PGE Forums, etc. is here: http://wohlsoft.ru.
All links from engine.wohlnet.ru will be automatically redirected to a new place!
  • New server is going to be much faster for America, Australia and Asia (continents which are located far out off Moscow city)
  • More stability
  • Much more disk space for a file storing!
PGE Project, my Media and supported projects: show
Support me on the Patreon
Image

PGE Project
PGE Project SMBX Topic
PGE Project Official Site and forums
Download fresh experimental builds HERE!

I'm support:
Lowser's Conquest by Sednaiur

Image
P.S. I don't like huge signatures which would be annoying, therefore I put huge content into spoilers

User avatar
lighthouse64
Mouser
Mouser
Posts: 1818
Joined: Sat Apr 26, 2014 6:28 am
Current Project: Soundtrack stuff

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby lighthouse64 » Thu Jan 28, 2016 1:37 pm

Is there any way that I can make a conformation box like this http://www.w3schools.com/js/tryit.asp?f ... js_confirm
in lunalua
I love cheep cheep's Image :)
Creator of 100+ 8bit emojis
Smiley tongue fan ImageImage Image :P
I support:
Spoiler: show
Image
Image
My 1337 rank was quill Image
Squishy rex has been frozen! Image

Some quotes:
Spoiler: show
[19:59] <Lykie> jacob i swear to god
[19:59] <Lykie> I YELLED AT MY MOM
[19:59] <Jacob> Im sorry
[19:59] <lighthouse64> swearing is bad tho
[19:59] <Lykie> FOR MESSING UP THE PATTERN IN THE EGG CARTEN
[19:59] <Lykie> *CARTON
[20:00] <lighthouse64> lol ocd confirmed

User avatar
Wohlstand
Boom Boom
Boom Boom
Posts: 1714
Joined: Tue Feb 11, 2014 4:44 pm
Current Project: Moondust (PGE Project)
Chat Username: Wohlstand#4881
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Wohlstand » Thu Jan 28, 2016 3:16 pm

lighthouse64 wrote:Is there any way that I can make a conformation box like this http://www.w3schools.com/js/tryit.asp?f ... js_confirm
in lunalua
I cloud port PGE Boxes where are message box, question box, menu box, and text input box
PGE Project, my Media and supported projects: show
Support me on the Patreon
Image

PGE Project
PGE Project SMBX Topic
PGE Project Official Site and forums
Download fresh experimental builds HERE!

I'm support:
Lowser's Conquest by Sednaiur

Image
P.S. I don't like huge signatures which would be annoying, therefore I put huge content into spoilers

User avatar
Kevsoft
Ripper II
Ripper II
Posts: 373
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Kevsoft » Sat Jan 30, 2016 3:22 am

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: show
* 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.

User avatar
TDK
Kamikaze Koopa
Kamikaze Koopa
Posts: 1382
Joined: Wed Nov 11, 2015 12:26 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby TDK » Sat Jan 30, 2016 2:08 pm

Is there any way to prevent the player from interacting with a block?

User avatar
PixelPest
Link
Link
Posts: 7118
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PixelPest » Sat Jan 30, 2016 2:56 pm

TheDinoKing432 wrote:Is there any way to prevent the player from interacting with a block?
Wouldn't it be easier just to make it a BGO?

User avatar
TDK
Kamikaze Koopa
Kamikaze Koopa
Posts: 1382
Joined: Wed Nov 11, 2015 12:26 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby TDK » Sat Jan 30, 2016 3:05 pm

PixelPest wrote:
TheDinoKing432 wrote:Is there any way to prevent the player from interacting with a block?
Wouldn't it be easier just to make it a BGO?
Unfortunately, I'm reaching the background limit for the level I'm making.

User avatar
Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 7713
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Enjl » Sat Jan 30, 2016 3:34 pm

TheDinoKing432 wrote:
PixelPest wrote:
TheDinoKing432 wrote:Is there any way to prevent the player from interacting with a block?
Wouldn't it be easier just to make it a BGO?
Unfortunately, I'm reaching the background limit for the level I'm making.
You can use the ghost house backgrounds to substitute for monotone background object clusters.
ImageImageImageImage
ImageImageImageImageImageImage


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 4 guests