deathAnimations.lua - make Mario's day worse!

Share and discuss custom LunaLua code and content packs for SMBX2.

Moderator: Userbase Moderators

Master of Disaster
Swooper
Swooper
Posts: 67
Joined: Sun Nov 28, 2021 9:29 am
Flair: Average Koopa Fan
Pronouns: he/him

deathAnimations.lua - make Mario's day worse!

Postby Master of Disaster » Mon Jul 15, 2024 1:50 pm

Hello there, I've been torturing Mario for a while and now it's time to release this library so you can join in on the fun
Introducing

deathAnimations.lua v1.0

Instead of dying the ordinary way with the ordinary (and boring) death effect, let the player react to their demise in unique ways!
This library overrides the normal death animation and lets you register your own instead.
You'll need some lua knowledge to register your own death animations!

To register a death animation, you'll need three functions:
- checkFunc(p): return true when the player has died to the desired source. You might need do some trickery with this
- tickFunc(p,data): onTick() equivalent. Use it to set values in the data table, which you can use to draw the death animation in
- drawFunc(p,data): onDraw() equivalent. Draw the death animation here, using values from the data table
(Note: data.deathTimer is reserved and counts up every frame, starting with 1. Don't forget to end an animation with deathAnimations.endAnimation(p))

Here are some examples (gone wrong):
Spoiler: show

You're gonna have a blast with this one, trust me
Image

Luigi made a shocking realization today
Image

[insert food joke]
Image

not even multiplayer is safe
Image
By the way, this library is multiplayer compatible! If you use respawnRooms.lua, you'll have to disable quick respawn though to get these animations.

Don't be as cruel as I am and credit me if you use this library.

interested? Then here's the download!
deathAnimations.lua v1.0

Pixelated_Perfection
Bot
Bot
Posts: 57
Joined: Fri Feb 25, 2022 1:23 pm
Pronouns: She/They

Re: deathAnimations.lua - make Mario's day worse!

Postby Pixelated_Perfection » Mon Jul 15, 2024 5:34 pm

oh this looks amazing

ChromaNyan
Blooper
Blooper
Posts: 155
Joined: Sat Feb 17, 2018 5:32 pm

Re: deathAnimations.lua - make Mario's day worse!

Postby ChromaNyan » Mon Jul 15, 2024 7:32 pm

does this work with the basegame character graphics, or just the SMW costumes?

Pixelated_Perfection
Bot
Bot
Posts: 57
Joined: Fri Feb 25, 2022 1:23 pm
Pronouns: She/They

Re: deathAnimations.lua - make Mario's day worse!

Postby Pixelated_Perfection » Tue Jul 16, 2024 11:34 am

ChromaNyan wrote:
Mon Jul 15, 2024 7:32 pm
does this work with the basegame character graphics, or just the SMW costumes?
it comes packaged for SMW graphics, but all it'd take to fix it for the default ones is a bit of image editing

Master of Disaster
Swooper
Swooper
Posts: 67
Joined: Sun Nov 28, 2021 9:29 am
Flair: Average Koopa Fan
Pronouns: he/him

Re: deathAnimations.lua - make Mario's day worse!

Postby Master of Disaster » Wed Jul 17, 2024 9:51 am

Pixelated_Perfection wrote:
Tue Jul 16, 2024 11:34 am

it comes packaged for SMW graphics, but all it'd take to fix it for the default ones is a bit of image editing
Yeah I originally wanted to also add a default costume image but then I realized that I am lazy and didn't. Hence there's also no dedicated death animation for Link in those cases, it's very much possible, I just couldn't be bothered lol

mariofan101+
Shy Guy
Shy Guy
Posts: 8
Joined: Sun Jan 09, 2022 1:55 pm
Pronouns: he/him

Re: deathAnimations.lua - make Mario's day worse!

Postby mariofan101+ » Wed Aug 07, 2024 9:06 pm

this script is crash bandicoot on mario

Pixelated_Perfection
Bot
Bot
Posts: 57
Joined: Fri Feb 25, 2022 1:23 pm
Pronouns: She/They

Re: deathAnimations.lua - make Mario's day worse!

Postby Pixelated_Perfection » Thu Aug 08, 2024 9:37 am

mariofan101+ wrote:
Wed Aug 07, 2024 9:06 pm
this script is crash bandicoot on mario
Image

PizzaNoob
Bot
Bot
Posts: 59
Joined: Wed May 29, 2024 8:36 pm
Flair: I like to make comics!
Pronouns: he/him

Re: deathAnimations.lua - make Mario's day worse!

Postby PizzaNoob » Tue Apr 15, 2025 3:32 pm

Is it possible to check if the player is colliding with a box made by easyLiquids.lua (by Akromaly). I'm having a hard time trying to check for the script's lava collider.

Alucard648
Flurry
Flurry
Posts: 181
Joined: Sun Aug 16, 2015 3:45 am

Re: deathAnimations.lua - make Mario's day worse!

Postby Alucard648 » Tue Apr 15, 2025 7:27 pm

This library is quite interesting. But I have to say, forbidden knowledge takes longer time to comprehend.

Master of Disaster
Swooper
Swooper
Posts: 67
Joined: Sun Nov 28, 2021 9:29 am
Flair: Average Koopa Fan
Pronouns: he/him

Re: deathAnimations.lua - make Mario's day worse!

Postby Master of Disaster » Mon Apr 28, 2025 7:03 am

PizzaNoob wrote:
Tue Apr 15, 2025 3:32 pm
Is it possible to check if the player is colliding with a box made by easyLiquids.lua (by Akromaly). I'm having a hard time trying to check for the script's lava collider.

You can add this in your burnCheck function that should be in your global luna.lua file (right before return false):

Code: Select all

	-- previous check in burnCheck
	
	-- check whether there's easyliquid lava in this section
	if easyliquids and easyliquids.levelLiquids[p.section] and easyliquids.levelLiquids[p.section].liquidtype == easyliquids.TYPE_LAVA then
		-- check if the player would be touching it
		if p.y + p.height >= easyliquids.getLiquidY(p.section) then
			return true
		end
	end
	
	-- return false
For that to work you have to register easyLiquids in your luna.lua file. If that's not already the case, you can add this at the beginning of the file:

Code: Select all

local easyliquids	-- loads the library, but only if it's found (gives no error when the library is not found)
pcall(function() easyliquids = easyliquids or require("easyliquids") end)
(You can see that it's registered already if you can find "local easyliquids = require("easyliquids")" in that file)


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 3 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari