falldamage.lua - Mario goes "ouch"

Share and discuss custom LunaLua code and content packs for SMBX2.
User avatar
AndrewPixel
Bronze Yoshi Egg
Bronze Yoshi Egg
Posts: 410
Joined: Sun Mar 12, 2017 8:07 am
Contact:

falldamage.lua - Mario goes "ouch"

Postby AndrewPixel » Fri Sep 04, 2020 9:19 am

I present you guys my very first lua library, which harms the player when they fall from too high, like in Super Mario 64. Did SMBX need this? Maybe not? Who knows, it's up to you to use it in some interesting ways. Here's some cool stuff about it though:

- Water does protect you from damage
- Being invincible also protects you, as you may expect
- You can customize how much you can fall in the code file



To use it, create a luna.lua file in your level/world folder with this code

Code: Select all

local falldamage = require("falldamage")
Download
Last edited by AndrewPixel on Fri Sep 04, 2020 9:28 am, edited 1 time in total.
ImageImage

9thCore
Cheep-Cheep
Cheep-Cheep
Posts: 17
Joined: Tue Mar 10, 2015 1:46 pm
Flair: am stupeed guy making stupeed things

Re: falldamage.lua - Mario goes "ouch"

Postby 9thCore » Fri Sep 04, 2020 9:26 am

Pretty nice idea for a library, can't wait for what people will do with this!

Also, quick note, you should put this in your post instead of the old code

Code: Select all

local falldamage = require("falldamage")
The reason being that API.load is outdated and require does the same thing afaik
hello me stupeed person doing stupeed things

User avatar
AndrewPixel
Bronze Yoshi Egg
Bronze Yoshi Egg
Posts: 410
Joined: Sun Mar 12, 2017 8:07 am
Contact:

Re: falldamage.lua - Mario goes "ouch"

Postby AndrewPixel » Fri Sep 04, 2020 9:28 am

9thCore wrote:
Fri Sep 04, 2020 9:26 am
Pretty nice idea for a library, can't wait for what people will do with this!

Also, quick note, you should put this in your post instead of the old code

Code: Select all

local falldamage = require("falldamage")
The reason being that API.load is outdated and require does the same thing afaik
I'll immediately edit it, I always wondered what was the difference between the two. Thanks a lot!
ImageImage

User avatar
WolfHero
Shy Guy
Shy Guy
Posts: 5
Joined: Thu May 07, 2020 11:41 pm

Re: falldamage.lua - Mario goes "ouch"

Postby WolfHero » Fri Sep 04, 2020 10:42 am

This could definitely be messed with to create a ground tremor attack when falling from enough height, too... Or maybe even a Zelda-like puzzle, something like the great deku tree's spider web puzzle. Get enough height, and you destroy things under you after you've been falling for a certain amount of time, stuff like standard breakables.

Lots of possibilities here. I don't know how to do these things, but I assume they're possible. And that's neat.

The fall damage effect itself, though, I don't see myself using... But that's just me. There's plenty of folk around here that could (and probably will) make use out of this for something interesting. I'm interested to see what that'd be.
Neat projects: show
Image

User avatar
Cedur
Toad
Toad
Posts: 6692
Joined: Tue Jun 28, 2016 10:14 am

Re: falldamage.lua - Mario goes "ouch"

Postby Cedur » Wed Sep 09, 2020 6:09 pm

why not also make Mario scream when he falls from a really large height ...
Image
More Supports: show

Image
Image

Still using the legacy editor? Get SMBX2 and PGE, it will improve your experience significantly. Here's why. And remember, Yoshis are tools to be used and discarded.

ShadowStarX (06/14/18) wrote: South Korea is easy deal

User avatar
AndrewPixel
Bronze Yoshi Egg
Bronze Yoshi Egg
Posts: 410
Joined: Sun Mar 12, 2017 8:07 am
Contact:

Re: falldamage.lua - Mario goes "ouch"

Postby AndrewPixel » Thu Sep 10, 2020 9:00 am

Cedur wrote:
Wed Sep 09, 2020 6:09 pm
why not also make Mario scream when he falls from a really large height ...
A thing I really like to do when making custom lua stuff is trying not to use non-basegame stuff, especially for sound effects, since I always happen to find something in the vanilla sounds that fits what I might need. But despite that this could be a nice touch, if people don't have a problem with that I could add that in a future version
ImageImage

User avatar
Taycamgame
Gold Yoshi Egg
Gold Yoshi Egg
Posts: 1436
Joined: Mon Jun 19, 2017 11:35 am
Flair: Stargard
Contact:

Re: falldamage.lua - Mario goes "ouch"

Postby Taycamgame » Thu Sep 10, 2020 12:10 pm

Cedur wrote:
Wed Sep 09, 2020 6:09 pm
why not also make Mario scream when he falls from a really large height ...
Would sound pretty cool. Ha.

Also I don't know how i feel about this being used in levels / episodes. Unless the creator shows that it is being used, it's likely going to end with a bunch of surprise deaths.
Official Level Reviewer (My Gold Yoshi Egg rank replaced the level reviewer icon, but i am still a level reviewer).
Image
Image
Image
Image
Check out the World Map Service that i host:
viewtopic.php?p=316733#p316733
Check out the projects i support:
Spoiler: show
ImageImage
Image
Image
Quotes: show
xDestroy wrote:
Wellington Games wrote:Taycamgame, I know how to take screenshots in the SMBX.
https://nsmbx.proboards.com/
------
Tower Mario Bros.

User avatar
Rhosty
Ludwig von Koopa
Ludwig von Koopa
Posts: 2576
Joined: Sun Dec 11, 2016 8:02 pm
Flair: nyā (にゃー)

Re: falldamage.lua - Mario goes "ouch"

Postby Rhosty » Thu Sep 10, 2020 12:19 pm

Taycamgame wrote:
Thu Sep 10, 2020 12:10 pm
Cedur wrote:
Wed Sep 09, 2020 6:09 pm
why not also make Mario scream when he falls from a really large height ...
Would sound pretty cool. Ha.

Also I don't know how i feel about this being used in levels / episodes. Unless the creator shows that it is being used, it's likely going to end with a bunch of surprise deaths.
They can just put a reminder in their posts that there's fall damage
Image omg zoom is absolute trash, why does my school still use it

User avatar
Taycamgame
Gold Yoshi Egg
Gold Yoshi Egg
Posts: 1436
Joined: Mon Jun 19, 2017 11:35 am
Flair: Stargard
Contact:

Re: falldamage.lua - Mario goes "ouch"

Postby Taycamgame » Thu Sep 10, 2020 12:25 pm

Rhosty wrote:
Thu Sep 10, 2020 12:19 pm
Taycamgame wrote:
Thu Sep 10, 2020 12:10 pm
Cedur wrote:
Wed Sep 09, 2020 6:09 pm
why not also make Mario scream when he falls from a really large height ...
Would sound pretty cool. Ha.

Also I don't know how i feel about this being used in levels / episodes. Unless the creator shows that it is being used, it's likely going to end with a bunch of surprise deaths.
They can just put a reminder in their posts that there's fall damage
Even still, I know for a fact that I would tend to forget about it and just jump off a cliff thinking i'll be fine, and end up dying to it.
I mean, it's realistic, sure. It's pretty cool too, but is it necessary?
Official Level Reviewer (My Gold Yoshi Egg rank replaced the level reviewer icon, but i am still a level reviewer).
Image
Image
Image
Image
Check out the World Map Service that i host:
viewtopic.php?p=316733#p316733
Check out the projects i support:
Spoiler: show
ImageImage
Image
Image
Quotes: show
xDestroy wrote:
Wellington Games wrote:Taycamgame, I know how to take screenshots in the SMBX.
https://nsmbx.proboards.com/
------
Tower Mario Bros.

9thCore
Cheep-Cheep
Cheep-Cheep
Posts: 17
Joined: Tue Mar 10, 2015 1:46 pm
Flair: am stupeed guy making stupeed things

Re: falldamage.lua - Mario goes "ouch"

Postby 9thCore » Thu Sep 10, 2020 3:08 pm

Taycamgame wrote:
Thu Sep 10, 2020 12:25 pm
Rhosty wrote:
Thu Sep 10, 2020 12:19 pm
Taycamgame wrote:
Thu Sep 10, 2020 12:10 pm


Would sound pretty cool. Ha.

Also I don't know how i feel about this being used in levels / episodes. Unless the creator shows that it is being used, it's likely going to end with a bunch of surprise deaths.
They can just put a reminder in their posts that there's fall damage
Even still, I know for a fact that I would tend to forget about it and just jump off a cliff thinking i'll be fine, and end up dying to it.
I mean, it's realistic, sure. It's pretty cool too, but is it necessary?
Will be necessary when somebody recreates Minecraft in x2
hello me stupeed person doing stupeed things

User avatar
Wiimeiser
Hoopster
Hoopster
Posts: 150
Joined: Mon Jun 24, 2019 4:36 am
Flair: What?

Re: falldamage.lua - Mario goes "ouch"

Postby Wiimeiser » Thu Sep 10, 2020 8:25 pm

For a clean tutorial, force a point early on where Mario falls far enough to scream, but lands in water. Maybe.

User avatar
Rhosty
Ludwig von Koopa
Ludwig von Koopa
Posts: 2576
Joined: Sun Dec 11, 2016 8:02 pm
Flair: nyā (にゃー)

Re: falldamage.lua - Mario goes "ouch"

Postby Rhosty » Fri Sep 11, 2020 11:35 am

Taycamgame wrote:
Thu Sep 10, 2020 12:25 pm
Rhosty wrote:
Thu Sep 10, 2020 12:19 pm
Taycamgame wrote:
Thu Sep 10, 2020 12:10 pm


Would sound pretty cool. Ha.

Also I don't know how i feel about this being used in levels / episodes. Unless the creator shows that it is being used, it's likely going to end with a bunch of surprise deaths.
They can just put a reminder in their posts that there's fall damage
Even still, I know for a fact that I would tend to forget about it and just jump off a cliff thinking i'll be fine, and end up dying to it.
I mean, it's realistic, sure. It's pretty cool too, but is it necessary?
its neseeracry because I sid it is people be getting confuedsed what the hil
Image omg zoom is absolute trash, why does my school still use it

User avatar
FireyPaperMario
Toad
Toad
Posts: 6105
Joined: Sat Sep 27, 2014 1:39 pm
Flair: 90's kid born in late 1993 ^_^
Contact:

Re: falldamage.lua - Mario goes "ouch"

Postby FireyPaperMario » Fri Sep 11, 2020 2:19 pm

I was hoping someone in the SMBX community would make a lua code for "Falling Damage". This'll come in handy for making some tricky One-Screen Arcade Level* style stuff I might make in the future. I'm so gonna download this. ^^"


*You know, like Donkey Kong, Donkey Kong Jr., etc. :P
Custom mega drive playable sprites
Mario RPG goals (62% completed)
My Pixiv
Best Quotes: show
Danny wrote: No creativeness.

Never released an episode anyway.

Never plan to right now, but maybe in the future.
Idunn wrote: That’s how evolution works, nothing disturbing about it.
I'm autistic & have ADHD


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 6 guests