This is how you put a Game Over message with LunaDLL

General discussion about Super Mario Bros. X.

Moderator: Userbase Moderators

Shidomaru
Spike
Spike
Posts: 256
Joined: Sat Oct 11, 2014 9:24 pm
Pronouns: he/him

This is how you put a Game Over message with LunaDLL

Postby Shidomaru » Fri Sep 04, 2015 2:23 pm

I have finally discovered how you make the game write "GAME OVER" on the center of the screen when you lose your last life!

Code: Select all

#0 //Section number where it applies. 0 means always
OnGlobalMem,0x00B2C5AC,0,0,1001,0,f //Checks if the player's number of lives equals 0 and calls event 1001

#1001
OnPlayerMem,0x16,0,0,1002,0,w //Checks if the player's number of hearts equals 0 as well (not tested with Mario or Luigi) and calls event 1002

#1002
ShowText,0,300,260,3,1,GAME OVER //Shows the text for 1 frame, you'll see why

Now, this code has THREE weaknesses that I know of:

First and most important issue with this code is it will lag the game for the short time the player's last death animation lasts. This is because the code is ALWAYS checking the variables, and when both variables are 0 it prints the text EVERY SINGLE FRAME over and over, thus why the ShowText only lasts 1 frame, as it lags much worse if it lasts any longer.

Secondly, I was unable to get a lunaglobal.txt file to work, so you will have to do the tedious task of writing this code in the lunadll.txt of EVERY level! Thankfully for me, my projects are much shorter than those of the average SMBX community member.

Lastly, as mentioned in the comments of the code itself, it works with hearts, so I doubt it will work with Mario and Luigi, who are the most used characters. My project uses Toad, so at least I can guarantee it works with him.

That's all. Use this code and enjoy your lagging Game Over screens. And if any of you finds a way to improve on this code (i.e: getting it to NOT lag), be sure to post it so we all know!

Marina
Cecil
Cecil
Posts: 2380
Joined: Sun May 25, 2014 7:01 am
Flair: everything's still romantic, right?
Pronouns: she/her/they/them

Re: This is how you put a Game Over message with LunaDLL

Postby Marina » Fri Sep 04, 2015 2:29 pm

wait people still use lunadll

RudeGuy
Bowser
Bowser
Posts: 4994
Joined: Fri Dec 27, 2013 7:36 am
Flair: local guy

Re: This is how you put a Game Over message with LunaDLL

Postby RudeGuy » Fri Sep 04, 2015 2:31 pm

Shidomaru wrote:Now, this code has THREE weaknesses that I know of
Solution: learn lua and start writing lunadll things using that language

Shidomaru
Spike
Spike
Posts: 256
Joined: Sat Oct 11, 2014 9:24 pm
Pronouns: he/him

Re: This is how you put a Game Over message with LunaDLL

Postby Shidomaru » Fri Sep 04, 2015 2:36 pm

Marina wrote:wait people still use lunadll
No :( Those aiming for vanilla episodes (everybody in this forum except for a few counted with the fingers of one hand) don't use it at all. The one guy who asked how to make a Game Over screen with LunaDLL apparently does. Thanks for ungratefully making fun of me after I struggled to find out this shit. :cry:
RudeGuy07 wrote:Solution: learn lua and start writing lunadll things using that language
NO! :x Having to learn a new programming language (Flash) is what killed my dream of programming videogames and the reason why I'm forced to use SMBX in the first place!

RudeGuy
Bowser
Bowser
Posts: 4994
Joined: Fri Dec 27, 2013 7:36 am
Flair: local guy

Re: This is how you put a Game Over message with LunaDLL

Postby RudeGuy » Fri Sep 04, 2015 2:38 pm

Shidomaru wrote:NO! :x Having to learn a new programming language (Flash) is what killed my dream of programming videogames and the reason why I'm forced to use SMBX in the first place!
I don't know flash but I'm pretty sure Lua is easier than it (correct me if I'm wrong). Besides, Lua offers a lot more than lunadll, and it's also not that hard to understand.

Marina
Cecil
Cecil
Posts: 2380
Joined: Sun May 25, 2014 7:01 am
Flair: everything's still romantic, right?
Pronouns: she/her/they/them

Re: This is how you put a Game Over message with LunaDLL

Postby Marina » Fri Sep 04, 2015 2:39 pm

Shidomaru wrote:
Marina wrote:wait people still use lunadll
No :( Those aiming for vanilla episodes (everybody in this forum except for a few counted with the fingers of one hand) don't use it at all. The one guy who asked how to make a Game Over screen with LunaDLL apparently does. Thanks for ungratefully making fun of me after I struggled to find out this shit. :cry:
Nono it's cool that you made this. It's just that everyone switched to LunaLua and few people use LunaDLL anymore..

XerX
Phanto
Phanto
Posts: 1487
Joined: Fri Dec 20, 2013 3:33 pm

Re: This is how you put a Game Over message with LunaDLL

Postby XerX » Fri Sep 04, 2015 2:42 pm

Shidomaru wrote:
Marina wrote:wait people still use lunadll
No :( Those aiming for vanilla episodes (everybody in this forum except for a few counted with the fingers of one hand) don't use it at all. The one guy who asked how to make a Game Over screen with LunaDLL apparently does. Thanks for ungratefully making fun of me after I struggled to find out this shit. :cry:
RudeGuy07 wrote:Solution: learn lua and start writing lunadll things using that language
NO! :x Having to learn a new programming language (Flash) is what killed my dream of programming videogames and the reason why I'm forced to use SMBX in the first place!
Jumping right into Action Script is kinda risky without any prior knowledge. Learning to code is like literally learning a new language. You need to take baby steps.

Now regarding the script, it's pretty cool. Not too many people use the old script anymore. Also those who use LunaLua can still make vanilla episodes you know. ; )

Shidomaru
Spike
Spike
Posts: 256
Joined: Sat Oct 11, 2014 9:24 pm
Pronouns: he/him

Re: This is how you put a Game Over message with LunaDLL

Postby Shidomaru » Fri Sep 04, 2015 2:47 pm

RudeGuy07 wrote:I don't know flash but I'm pretty sure Lua is easier than it (correct me if I'm wrong). Besides, Lua offers a lot more than lunadll, and it's also not that hard to understand.
I can't even program in Game Maker! :x Much less will I be able to use a program that has been used in professional videogame programming!
Marina wrote:Nono it's cool that you made this. It's just that everyone switched to LunaLua and few people use LunaDLL anymore..
It's NOT cool if it doesn't work in LunaLua! :x
XerX wrote:Jumping right into Action Script is kinda risky without any prior knowledge. Learning to code is like literally learning a new language. You need to take baby steps.

Now regarding the script, it's pretty cool. Not too many people use the old script anymore. Also those who use LunaLua can still make vanilla episodes you know. ; )
I didn't jump into ActionScript without prior knowledge: I had programmed in DIV2 Games Studio, a DOS tool that died with the arrival of Windows XP.

And as I told Marina, it's not cool if people can't use it because they're all using something entirely different now.

bossedit8
Banned
Posts: 6838
Joined: Fri Dec 20, 2013 12:35 pm
Contact:

Re: This is how you put a Game Over message with LunaDLL

Postby bossedit8 » Fri Sep 04, 2015 2:50 pm

I do think LunaLua will work with LunaDLL since Lua is more complexful rather than DLL.

XerX
Phanto
Phanto
Posts: 1487
Joined: Fri Dec 20, 2013 3:33 pm

Re: This is how you put a Game Over message with LunaDLL

Postby XerX » Fri Sep 04, 2015 2:55 pm

Ok that's nothing to get mad about really. There was a reason people moved to LunaLua, and that's because it's easier to use than the old script.

I did a search of DIV Games Studio and saw the script for it. It's not very different from Lua. Lua just has some different functions that you could easily learn from a quick google search, as well as using the Wiki for LunaLua : http://engine.wohlnet.ru/pgewiki/Category:LunaLua_API

And just because you learned one language doesn't mean you can immediately jump into another thinking you'll know enough. You need to look up that languages syntax and global functions. A lot of them are the same but some are different. Game Maker uses a lot of simple syntax that, again, you could learn if you did a google search or used their HowTo manual.

Mable
Luigi
Luigi
Posts: 5806
Joined: Sat Dec 21, 2013 4:23 am
Contact:

Re: This is how you put a Game Over message with LunaDLL

Postby Mable » Fri Sep 04, 2015 2:58 pm

Dude no offense but you flip out by small things like this and it will make others see you as someone who easily rages out.

Shidomaru
Spike
Spike
Posts: 256
Joined: Sat Oct 11, 2014 9:24 pm
Pronouns: he/him

Re: This is how you put a Game Over message with LunaDLL

Postby Shidomaru » Fri Sep 04, 2015 3:24 pm

Tinkerbell wrote:Dude no offense but you flip out by small things like this and it will make others see you as someone who easily rages out.
That is because I AM someone who easily rages out, even in real life.

RudeGuy
Bowser
Bowser
Posts: 4994
Joined: Fri Dec 27, 2013 7:36 am
Flair: local guy

Re: This is how you put a Game Over message with LunaDLL

Postby RudeGuy » Fri Sep 04, 2015 3:27 pm

Shidomaru wrote:I can't even program in Game Maker! :x Much less will I be able to use a program that has been used in professional videogame programming!
Okay, so? Why exactly can't you learn LunaLua? It's not that hard after all.

FireyPaperMario
Toad
Toad
Posts: 6206
Joined: Sat Sep 27, 2014 1:39 pm
Flair: 90's kid born in late 1993 ^_^"
Pronouns: He/Him
Contact:

Re: This is how you put a Game Over message with LunaDLL

Postby FireyPaperMario » Fri Sep 04, 2015 3:34 pm

That's very helpful! Thanks! ^.^')

Shidomaru
Spike
Spike
Posts: 256
Joined: Sat Oct 11, 2014 9:24 pm
Pronouns: he/him

Re: This is how you put a Game Over message with LunaDLL

Postby Shidomaru » Fri Sep 04, 2015 3:36 pm

RudeGuy07 wrote:Okay, so? Why exactly can't you learn LunaLua? It's not that hard after all.
Fine, I'll look into it.
NintendoOtaku93 wrote:That's very helpful! Thanks! ^.^')
You're welcome :)

Imaynotbehere4long
Boomerang Bro
Boomerang Bro
Posts: 1389
Joined: Thu Jan 23, 2014 3:00 pm

Re: This is how you put a Game Over message with LunaDLL

Postby Imaynotbehere4long » Fri Sep 04, 2015 6:33 pm

Shidomaru wrote:
Marina wrote:Nono it's cool that you made this. It's just that everyone switched to LunaLua and few people use LunaDLL anymore..
It's NOT cool if it doesn't work in LunaLua! :x
Don't worry; LunaLua is backwards-compatible with LunaDLL scripts, so your code will work in LunaLua.

Shidomaru
Spike
Spike
Posts: 256
Joined: Sat Oct 11, 2014 9:24 pm
Pronouns: he/him

Re: This is how you put a Game Over message with LunaDLL

Postby Shidomaru » Sat Sep 05, 2015 8:34 am

Imaynotbehere4long wrote:Don't worry; LunaLua is backwards-compatible with LunaDLL scripts, so your code will work in LunaLua.
Well, that's a partial relief... Still, from what I could find out recently, LunaDLL seems to be VERY limited in comparison to LunaLua. Sooner or later I'm going to have to learn to use Lua.


Return to “General”

Who is online

Users browsing this forum: No registered users and 4 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari