bouncyPits.lua v1.4.0 & bouncyLava.lua v1.5.0 - yin and yang

Share and discuss custom LunaLua code and content packs for SMBX2.
KBM-Quine
Monty Mole
Monty Mole
Posts: 128
Joined: Wed Jan 15, 2014 11:10 am
Flair: Crazy with a K

bouncyPits.lua v1.4.0 & bouncyLava.lua v1.5.0 - yin and yang

Postby KBM-Quine » Sun Sep 24, 2023 1:18 pm

two Delightful Adventure:Enhanced libraries, finally released to public. versions are based on internal revisions from DAE. read through each spoiler for examples, basic use, & documentation. the two share alot of DNA but have one or two specific things to them.

bouncyPits v1.4.0: show
"I can be your angle..."
as the name implies, makes bottomless pits bouncy. once you enter a pit, you'll be flung back out. read further spoilers for details.

Image

basic use: show
- place the library in the base of your episode or level folder. you can place it elsewhere if you know what your doing, but this guide assumes your unfamiliar with this process.
- make a luna.lua file in the base of your episode or level folder. this is most easily done by making a new text document and renaming it to luna.lua (assuming you have show file extensions on. here's a guide on that for each windows version if you do not.)
- place this code in your luna.lua file and save:

Code: Select all

local bouncyPits = require("bouncyPits")
and that should make it work as intended. there are settings you can customize as well. read the documentation spoiler for more information. see the example level and it's luna.lua for usage examples.

documentation: show
- library settings -
bouncyPits.enabled - bool; whether or not the library should function. things like bottom and onPlayerPitDeath will still run regardless. read on for those. default: true
bouncyPits.zoneBlockID - number; the block ID used for zone checks. a "zone" block is provided with the download. see it's hovertext for suggested placement. default: 755

- default or per-section settings -
enabledOverride - bool; whether or not the section should override the enabled variable. this is good for enforcing specific sections to have bouncy pits even if enabled is false i.e. for bosses. not used at the library level. default: false
bouncyPits.onlyZones - bool; if true, bounces will only happen with an intersecting zone block. default: false
bouncyPits.bottom - number; a Y coordinate that bouncyPits considers a pit. if supplied, it will kill the player regardless of the enabled variable. good for camera shenanigans. default: nil

- default, per-section, or per-zone settings -
bouncyPits.strength - number; Y speed the player is chucked out of a pit at. default: 13.5
bouncyPits.respectsMercy - bool; if true, pits will not harm or kill while blink frames are active. default: true
bouncyPits.canHarm - bool; if true, bounces will harm mounted or non-small players. default: true
bouncyPits.canKill - bool; if true, small, unmounted players will die to pits. default: true

- library functions -
bouncyPits.configureSection(sectionID, props, value) - sets up the bouncyPit settings of the given sectionID. sectionID is the section which it will set the properties for. it is required. will error if sectionID is nil, not a number, not a whole number, or with in the section id range. props can either be an idividual setting or a table of settings. if done as an individual setting, it is given as a string i.e. "strength". if it's a table, it's set up like: bouncyPits.configureSection(0, {strength = 20, canHarm = false}) and so on. if prop is not a table, value is the prop's value. like so: bouncyPits.configureSection(0, "strength", 20)
bouncyPits.getConfig(sectionID, setting, zones) - returns the first instance of the given setting in order of: zone > section > library. sectionID is the section which it will try to get the properties for, defaults to player.section if not supplied. setting is a string. these would be any of the above settings. i.e. bouncyPits.getConfig(0, "strength"). if not supplied, it returns the settings table of the section. zones is a list of collisions from Colliders.getColliding, which is how it gets per-zone settings. possibly not useful for end users but still an option.

- global functions -
onPlayerPitBounce(bouncedPlayer) - runs when a player has been bounced out a pit. good for custom harm processing or effects. gives the bounced player as an argument. cannot be cancelled. see the example levels' luna.lua for usage.
onPlayerPitDeath(killedPlayer) - runs when a player has been killed by a pit. good for post-death effects. gives the killed player as an argument. will run regardless of enabled. cannot be cancelled. see the example levels' luna.lua for usage.

bouncyLava v1.5.0: show
"or yuor devil."
Image
(yes, this is how long it took)
makes lava more SM64-esqe. this works best with non-moving layers. we wanted to support feeding in other things (blocks, colliders, ect) but this was already hard enough. to quote rixi:
rixitic wrote:this was hell to get working, lava collision in smbx is awful and moving lava even more so
as such this will likely see no support going forward. feel free to build on it if you wish

Image
Image
Image

basic use: show
- place the library in the base of your episode or level folder. you can place it elsewhere if you know what your doing, but this guide assumes your unfamiliar with this process.
- make a luna.lua file in the base of your episode or level folder. this is most easily done by making a new text document and renaming it to luna.lua (assuming you have show file extensions on. here's a guide on that for each windows version if you do not.)
- place this code in your luna.lua file and save:

Code: Select all

local bouncyLava = require("bouncyLava")
and that should make it work as intended. there are settings you can customize as well. read the documentation spoiler for more information. see the example level and it's luna.lua for usage examples.

documentation: show
- library settings -
bouncyLava.enabled - bool; whether or not the library should function. things like onPlayerLavaDeath will still run regardless. read on for those. default: true
bouncyLava.zoneBlockID - number; the block ID used for zone checks. a "zone" block is provided with the download. see it's hovertext for suggested placement. default: 755
bouncyLava.launchTime - number; the amount of time a control lock timer is set to upon bouncing. this allows horizontal bounces to go farther, but has the draw back of no run inputs. default: 55

- default or per-section settings -
enabledOverride - bool; whether or not the section should override the enabled variable. this is good for enforcing specific sections to have bouncy lava even if enabled is false i.e. for bosses. not used at the library level. default: false
bouncyLava.onlyZones - bool; if true, bounces will only happen with an intersecting zone block. default: false

- default, per-section, or per-zone settings -
bouncyLava.strength - number; speed the player is chucked out of lava at. default: 13.5
bouncyLava.slopeStrengthModifier - number; amount slopes' X speed is multiplied by. allows for less harsh horizontal punishment. default: 0.6
bouncyLava.respectsMercy - bool; if true, lava will not harm or kill while blink frames are active. default: true
bouncyLava.canHarm - bool; if true, bounces will harm mounted or non-small players. default: true
bouncyLava.canKill - bool; if true, small, unmounted players will die to lava. default: true

- library functions -
bouncyLava.configureSection(sectionID, props, value) - sets up the bouncyLava settings of the given sectionID. sectionID is the section which it will set the properties for. it is required. will error if sectionID is nil, not a number, not a whole number, or within the section id range. props can either be an idividual setting or a table of settings. if done as an individual setting, it is given as a string i.e. "strength". if it's a table, it's set up like: bouncyPits.configureSection(0, {strength = 20, canHarm = false}) and so on. if prop is not a table, value is the prop's value. like so: bouncyPits.configureSection(0, "strength", 20)
bouncyLava.getConfig(sectionID, setting, zones) - returns the first instance of the given setting in order of: zone > section > library. sectionID is the section which it will try to get the properties for, defaults to player.section if not supplied. setting is a string. these would be any of the above settings. i.e. bouncyLava.getConfig(0, "strength"). if not supplied, it returns the settings table of the section. zones is a list of collisions from Colliders.getColliding, which is how it gets per-zone settings. possibly not useful for end users but still an option.

- global functions -
onPlayerLavaBounce(bouncedPlayer) - runs when a player has been bounced out of lava. good for custom harm processing or effects. gives the bounced player as an argument. cannot be cancelled. see the example levels' luna.lua for usage.
onPlayerLavaDeath(killedPlayer) - runs when a player has been killed by lava. good for post-death effects. gives the killed player as an argument. will run regardless of enabled. cannot be cancelled. see the example levels' luna.lua for usage.

changelog: show
9/24/23 - initial release
-Credits-
KBM-Quine & rixitic - code, zone graphics
Valentine - SLAM Devkit, which the graphics were inspired by


thank you for your time, have a nice day.
Image

HAK0TA538
Bob-Omb
Bob-Omb
Posts: 22
Joined: Wed Oct 18, 2023 11:57 pm
Flair: Lua is cool
Pronouns: He/Him

Re: bouncyPits.lua v1.4.0 & bouncyLava.lua v1.5.0 - yin and yang

Postby HAK0TA538 » Thu Oct 19, 2023 3:25 pm

The debug menu is showing up for me for some reason, it shows pit bounces and stuff, how to remove that?


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari