Drop NPC Offset Fix

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

Moderator: Userbase Moderators

LooKiCH
Blooper
Blooper
Posts: 159
Joined: Tue Jun 13, 2017 11:28 am
Pronouns: he/him
Contact:

Drop NPC Offset Fix

Postby LooKiCH » Tue Jul 26, 2022 7:15 am

Drop NPC Offset Fix Script for fix bug with itembox when changing camera offset via lua + if itembox offset is different (if, for example, you create your own custom HUD)

credits: show
Original script by Core for Slavic Mario Collab
Reworked by LooKiCH (optimization for 2 players + easy itembox offset settings)
screenshots: show
ImageImageImageImage
settings: show
To get started, you will need to paste the following into luna.lua, or in the library with the HUD design:

Code: Select all

local dropnpc = require("dropnpc")
And then you can configure as you want, this is how the setting should be:

Code: Select all

dropnpc.reservebox.<camera state>.<index of player>.<setting> =
Instead of <camera state> may be 3 settings:
splitcam - if camera is splitted
nosplitcam - if camera is not splitted
singleplayer - if you are in 1 player mode

Instead of <index of player> may be 2 settings:
p1 - for 1st player
p2 - for 2nd player (is not using if <camera state> is "singleplayer")

Instead of <setting> may be 6 settings:
x - X offset of itembox
y - Y offset of itembox
alignX - X align by camera
alignY - Y align by camera
alignIconX - X align by icon of itembox
alignIconY - Y align by icon of itembox

"align" setting has 5 values:
dropnpc.ALIGN.LEFT (0)
dropnpc.ALIGN.TOP (0)
dropnpc.ALIGN.MID (0.5)
dropnpc.ALIGN.RIGHT (1)
dropnpc.ALIGN.BOTTOM (1)

you can specify numbers instead of one of the listed values

Example:

Code: Select all

dropnpc.reservebox.singleplayer.p1.y = 26
(this code is using for Bowsers Time Attack episode)

Download


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

Re: Drop NPC Offset Fix

Postby Marioman2007 » Tue Jul 26, 2022 10:18 am

Nice! really useful script!


Return to “LunaLua”

Who is online

Users browsing this forum: King Mario and 3 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari