Page 1 of 1

deathAnimations.lua - make Mario's day worse!

Posted: Mon Jul 15, 2024 1:50 pm
by Master of Disaster
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

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

Posted: Mon Jul 15, 2024 5:34 pm
by Pixelated_Perfection
oh this looks amazing

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

Posted: Mon Jul 15, 2024 7:32 pm
by ChromaNyan
does this work with the basegame character graphics, or just the SMW costumes?

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

Posted: Tue Jul 16, 2024 11:34 am
by Pixelated_Perfection
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

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

Posted: Wed Jul 17, 2024 9:51 am
by Master of Disaster
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

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

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

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

Posted: Thu Aug 08, 2024 9:37 am
by Pixelated_Perfection
mariofan101+ wrote:
Wed Aug 07, 2024 9:06 pm
this script is crash bandicoot on mario
Image

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

Posted: Tue Apr 15, 2025 3:32 pm
by PizzaNoob
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.

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

Posted: Tue Apr 15, 2025 7:27 pm
by Alucard648
This library is quite interesting. But I have to say, forbidden knowledge takes longer time to comprehend.

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

Posted: Mon Apr 28, 2025 7:03 am
by Master of Disaster
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)