worldPlayerDisable.lua

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

Moderator: Userbase Moderators

How much does this single‐frame render of the disabled character bother you?

Unacceptable
4
19%
Very annoying, but I can deal with it if there isn't any way to remove it
3
14%
Somewhat annoying
3
14%
Mildly annoying
7
33%
Don't care
4
19%
 
Total votes: 21
DigitalDetective47
Hoopster
Hoopster
Posts: 49
Joined: Fri Mar 27, 2020 10:12 pm
Pronouns: they/them
Contact:

worldPlayerDisable.lua

Postby DigitalDetective47 » Fri Apr 17, 2020 12:09 pm

worldPlayerDisable.lua is a script(?) that (mostly) fixes a bug in SMBX2 BETA 4 Patch 1 where the player can select a character that is not allowed within the episode in episodes where more than one character is allowed. Do NOT use this script for episodes with only one character allowed, because it will most likely break in 2‐player mode. To use it simply enter these lines of code into your map.lua file:

Code: Select all

worldPlayerDisable=API.load("worldPlayerDisable")
worldPlayerDisable.allowedPlayers={playerList}
worldPlayerDisable.generateMask()
Replace playerList with a list of all players that should be allowed in the episode. If you need to have this character list change at some point during your episode, simply duplicate the second & third lines. If you are using this at a point in the future where SMBX2 has more than 16 characters, you need to also include this line somewhere:

Code: Select all

worldPlayerDisable.playerTotal=characterCount
Replace characterCount with the current number of characters in SMBX2.
Download here: https://drive.google.com/file/d/1ueALiK ... sp=sharing
The reason that I say that it mostly fixes this bug is because the character that would be shown without the script (the disabled one) is still displayed for one frame.
Spoiler: show
Image

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9865
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: worldPlayerDisable.lua

Postby Emral » Fri Apr 17, 2020 12:15 pm

Fixing the one-frame thing is incredibly trivial: Just use onTickEnd.

DigitalDetective47
Hoopster
Hoopster
Posts: 49
Joined: Fri Mar 27, 2020 10:12 pm
Pronouns: they/them
Contact:

Re: worldPlayerDisable.lua

Postby DigitalDetective47 » Fri Apr 17, 2020 12:20 pm

Enjl wrote:
Fri Apr 17, 2020 12:15 pm
Fixing the one-frame thing is incredibly trivial: Just use onTickEnd.
Actually no, because the game doesn't run ticks while paused.

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9865
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: worldPlayerDisable.lua

Postby Emral » Fri Apr 17, 2020 12:24 pm

Ninji2701 wrote:
Fri Apr 17, 2020 12:20 pm
Enjl wrote:
Fri Apr 17, 2020 12:15 pm
Fixing the one-frame thing is incredibly trivial: Just use onTickEnd.
Actually no, because the game doesn't run ticks while paused.
Then, onDraw

DigitalDetective47
Hoopster
Hoopster
Posts: 49
Joined: Fri Mar 27, 2020 10:12 pm
Pronouns: they/them
Contact:

Re: worldPlayerDisable.lua

Postby DigitalDetective47 » Fri Apr 17, 2020 12:26 pm

Enjl wrote:
Fri Apr 17, 2020 12:24 pm
Ninji2701 wrote:
Fri Apr 17, 2020 12:20 pm
Enjl wrote:
Fri Apr 17, 2020 12:15 pm
Fixing the one-frame thing is incredibly trivial: Just use onTickEnd.
Actually no, because the game doesn't run ticks while paused.
Then, onDraw
Causes issues where attempting moving right past characters will simply raise the preview of your current character instead of switching to the next valid character.

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9865
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: worldPlayerDisable.lua

Postby Emral » Fri Apr 17, 2020 12:29 pm

Ninji2701 wrote:
Fri Apr 17, 2020 12:26 pm
Then there are issues elsewhere in your code. Fixing the 1 frame thing is very easy by running relevant parts of your code after smbx's main call and before drawing, and if it wouldn't be fixed in smbx2 in a matter of days, I would spend a couple minutes to show so.

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: worldPlayerDisable.lua

Postby Hoeloe » Sat Apr 18, 2020 7:11 am

This library is completely pointless. A Lua system for doing this exists natively:

Code: Select all

local pm = require("playerManager")
pm.overworldCharacters = {list of characters}

Mal8rk
Snifit
Snifit
Posts: 216
Joined: Mon Oct 25, 2021 11:04 pm
Flair: English Speaking Spanish Speaker
Pronouns: He/Him
Contact:

Re: worldPlayerDisable.lua

Postby Mal8rk » Tue Mar 08, 2022 2:28 pm

The download link doesen't work

Marioman2007
2025 Egg Hunter
2025 Egg Hunter
Posts: 530
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: worldPlayerDisable.lua

Postby Marioman2007 » Wed Mar 09, 2022 2:21 am

POPME wrote:
Tue Mar 08, 2022 2:28 pm
The download link doesen't work
Hoeloe wrote:
Sat Apr 18, 2020 7:11 am
This library is completely pointless. A Lua system for doing this exists natively:

Code: Select all

local pm = require("playerManager")
pm.overworldCharacters = {list of characters}


Return to “LunaLua”

Who is online

Users browsing this forum: AdvancedTrash, Ahrefs [Bot], UltraEpicLeader100 and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari