charnames.lua - Make the game recognize you

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

Moderator: Userbase Moderators

Akromaly
Bronze Yoshi Egg
Bronze Yoshi Egg
Posts: 428
Joined: Sun Mar 12, 2017 8:07 am
Flair: anemoia
Contact:

charnames.lua - Make the game recognize you

Postby Akromaly » Wed Mar 02, 2022 2:39 pm

I put up a small library which gives the possibility to adapt text boxes to the character you're currently playing, even using correct genders. It supports both text boxes triggered by NPCs and vanilla events, and also works in 2 player mode.

To do this, just format your text like this example:

Code: Select all

Kids, say hello to <player>! <They> <are> so cool, look at <their> style wow I love <them>.
gif: show
Image

To use it, put the charnames.lua file in your level/episode folder and write this line in the luna.lua file:

Code: Select all

local charnames = require("charnames")
If you're using costumes or not-basegame characters, you can directly change the arrays in which the character names and pronouns are located.
The library also comes with a variable which can be set to true to show the current character and their pronouns on screen. It can be useful for debug and testing.

Code: Select all

charnames.printMyCharacter = true
Download

Note - The library currently doesn't support littleDialogue and other libraries for custom text boxes. At the moment, it only works properly with vanilla text boxes.

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

Re: charnames.lua - Make the game recognize you

Postby Mal8rk » Wed Mar 02, 2022 7:09 pm

Finally, the game can recognize players!

Now I don't have to make the characters genderless in my future episodes!

Smilysora
Goomba
Goomba
Posts: 3
Joined: Sat Apr 05, 2025 2:41 pm
Flair: The smiliest sora of all
Pronouns: he/him
Contact:

Re: charnames.lua - Make the game recognize you

Postby Smilysora » Sun Apr 06, 2025 11:08 am

Hey what happened to the download?

ilovehamburgerz
2025 Egg Hunter
2025 Egg Hunter
Posts: 470
Joined: Thu Jul 25, 2024 5:34 am
Flair: i have 0 dollars
Pronouns: he/him

Re: charnames.lua - Make the game recognize you

Postby ilovehamburgerz » Sun Apr 06, 2025 1:18 pm

Smilysora wrote:
Sun Apr 06, 2025 11:08 am
Hey what happened to the download?
its not working, probably because he dosent use Google Drive or Dropbox.

it dosent mean a bad thing, but we should use Drive/Dropbox, as they can host stuff longer.

Smilysora
Goomba
Goomba
Posts: 3
Joined: Sat Apr 05, 2025 2:41 pm
Flair: The smiliest sora of all
Pronouns: he/him
Contact:

Re: charnames.lua - Make the game recognize you

Postby Smilysora » Sun Apr 06, 2025 3:38 pm

Retro wrote:
Sun Apr 06, 2025 1:18 pm
Smilysora wrote:
Sun Apr 06, 2025 11:08 am
Hey what happened to the download?
its not working, probably because he dosent use Google Drive or Dropbox.

it dosent mean a bad thing, but we should use Drive/Dropbox, as they can host stuff longer.
oh ok.


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari