Message Evaluation (Execute Lua code in SMBX Messages!)

Share and discuss custom LunaLua code and content packs for SMBX2.
User avatar
Core
Grinder
Grinder
Posts: 1069
Joined: Tue Apr 15, 2014 8:29 am
Flair: Trans <3 She/her

Message Evaluation (Execute Lua code in SMBX Messages!)

Postby Core » Sat Apr 18, 2020 8:05 am

Salut folks, i've decided to upload a simple library, which lets you execute lua code in smbx messages!
Example:

Code: Select all

--#lua_execute#--
if player.speedX == 0 then player.speedX = -9 end
(you need to write `--#lua_execute#--` in the message so it could be executed)
Gif (Example in action):
Spoiler: show
Image
Download - https://drive.google.com/file/d/1BUc4tw ... sp=sharing

Don't forget to credit me, overall you are allowed to use it and modify it. Also be sure to report bugs if there are ones!
Join NSMBX's official server! - https://discord.gg/RMYdYfX

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

Re: Message Evaluation (Execute Lua code in SMBX Messages!)

Postby Enjl » Sat Apr 18, 2020 8:23 am

Why would someone want to use this over a regular lua script?
Ideas are useless if you can't make them real.
Image

Eclipsed
Mouser
Mouser
Posts: 1881
Joined: Tue Mar 13, 2018 6:15 pm
Chat Username: Eclipsed

Re: Message Evaluation (Execute Lua code in SMBX Messages!)

Postby Eclipsed » Sat Apr 18, 2020 9:18 am

Enjl wrote:
Sat Apr 18, 2020 8:23 am
Why would someone want to use this over a regular lua script?
They might be too lazy to create an event attached to the message, and create a lua file to answer your question. There’s really no long term benefits however to this method in the thread since it’s really hard to see your text in an smbx message.

User avatar
Novarender
Bit
Bit
Posts: 132
Joined: Sat Aug 06, 2016 6:59 pm
Flair: Whoa
Current Project: MMX - Mario Maker X, patent pending
Chat Username: Novarender

Re: Message Evaluation (Execute Lua code in SMBX Messages!)

Postby Novarender » Sat Apr 18, 2020 9:29 am

Enjl wrote:
Sat Apr 18, 2020 8:23 am
Why would someone want to use this over a regular lua script?
I think it was just done for fun/screwing around.
I believe and I accept Jesus Christ as my Lord and Savior. If you do, put this in your signature.

Hagrid: "You're a wizard, Harry!"
Harry: "You're a hairy wizard!"

The FitnessGram Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues. The 20 meter pacer test will begin in 30 seconds. Line up at the start. The running speed starts slowly but gets faster each minute after you hear this signal bodeboop.

FYRENOVA IS A FAKE!

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

Re: Message Evaluation (Execute Lua code in SMBX Messages!)

Postby Enjl » Sat Apr 18, 2020 10:12 am

Eclipsed wrote:
Sat Apr 18, 2020 9:18 am
Enjl wrote:
Sat Apr 18, 2020 8:23 am
Why would someone want to use this over a regular lua script?
They might be too lazy to create an event attached to the message, and create a lua file to answer your question. There’s really no long term benefits however to this method in the thread since it’s really hard to see your text in an smbx message.
Perhaps... I'm mostly concerned about how hard to find it will be in case something breaks, or how terrible the formatting in the message box window is. You don't even need an event either, just fill in a dummy message:

Code: Select all

function onMessageBox(eventObj, message)
	if message == "dummyMessage" then
		eventObj.cancelled = true
		player.speedX = -9
	end
end
And making a lua file is as simple as clicking a button in the editor, so it's arguably faster and easier to do it properly.
Ideas are useless if you can't make them real.
Image

User avatar
Yoshi021
Gold Yoshi Egg
Gold Yoshi Egg
Posts: 636
Joined: Thu Jan 21, 2016 9:06 pm
Flair: :)
Chat Username: SetaYoshi

Re: Message Evaluation (Execute Lua code in SMBX Messages!)

Postby Yoshi021 » Sat Apr 18, 2020 7:35 pm

I like this. This is cool!
"Going to University is FUN!"
DOWNLOAD THE SMBX LEVEL PLAYER
CHECK OUT MY NPC PACK

Join the SMBX Episode Project Discord Server
Image

Join the SMBX 38A Discord!
Image

Join the CodeHaus Discord!
Image
Image

User avatar
MegaDood
Birdo
Birdo
Posts: 1494
Joined: Wed Nov 01, 2017 2:43 am
Current Project: Super Mario Bros. Twisted Realities
Chat Username: Mega

Re: Message Evaluation (Execute Lua code in SMBX Messages!)

Postby MegaDood » Sat Apr 18, 2020 10:22 pm

Well done Core, I think you did a really good job with it. Makes accessing lua stuff a lot easier with messages.
My Project:
Image
I don't really have a signature but here's what I support:


Image
Image
Image


Return to “LunaLua”

Who is online

Users browsing this forum: Dragon0307 and 6 guests