Hiding the score you get from killing NPCs

Post here for help and support regarding LunaLua and SMBX2's libraries and features.
Reign
Ripper II
Ripper II
Posts: 323
Joined: Tue Jan 21, 2014 4:22 am

Hiding the score you get from killing NPCs

Postby Reign » Mon Aug 05, 2019 1:50 am

The title basically. When you kill an npc, you get a certain amount of points. If you kill multiple enemies, you also get life-ups. I want to disable both of them for visual reasons. When you kill an npc, the npc should just get killed and no points or 1/2-ups should be visible.

I'm not sure which hardcoded graphics the score uses, but I can't make font 2 or 3 invisible, because other things in the episode use these fonts. Is there an easy way to do this in lua?

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9491
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Hiding the score you get from killing NPCs

Postby Enjl » Mon Aug 05, 2019 3:26 am

Score doesn't use hardcoded graphics, it uses effect-79.
To disable an npc's inherent score, set the "score" npc config variable to 0.
To disable the combo counter, use this code:

Code: Select all

--this sets the score counter to 0 to prevent 1ups
--redigit stores this in NPC 0
local function dummyNpcMem(offset, value, set)
    return mem(readmem(0xB259E8, FIELD_DWORD) + 0xac00 + offset, value, set)
end

function onTick()
	player:mem(0x56, FIELD_WORD, 0)
	dummyNpcMem(0x24, FIELD_WORD, 0)
end

Reign
Ripper II
Ripper II
Posts: 323
Joined: Tue Jan 21, 2014 4:22 am

Re: Hiding the score you get from killing NPCs

Postby Reign » Mon Aug 05, 2019 4:43 am

Enjl wrote:
Mon Aug 05, 2019 3:26 am
Score doesn't use hardcoded graphics, it uses effect-79.
To disable an npc's inherent score, set the "score" npc config variable to 0.
To disable the combo counter, use this code:

Code: Select all

--this sets the score counter to 0 to prevent 1ups
--redigit stores this in NPC 0
local function dummyNpcMem(offset, value, set)
    return mem(readmem(0xB259E8, FIELD_DWORD) + 0xac00 + offset, value, set)
end

function onTick()
	player:mem(0x56, FIELD_WORD, 0)
	dummyNpcMem(0x24, FIELD_WORD, 0)
end
Thanks a lot!


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 1 guest