if you want to remove lives as a factor entirely, create a file called "luna.lua" inside your episode directory and copy the following code inside:
Code: Select all
function onStart()
mem(0x00B2C5AC, FIELD_FLOAT, 99)
end
as for the other script you've mentioned, that's a bit more complex as smbx doesn't keep track of a total collected coin count throughout the episode. you'd have to make your own place to keep track of it. i've put together a quick and rough way to implement this (as i don't know of an existing one either), but i'd advise against using it if you don't know how you'd expand on it (once again place it inside the episode's "luna.lua" file):
Code: Select all
local coinLossOnDeath = 20 -- change this number to set how many coins are lost on death
local prevCoins = mem(0x00B2C5A8, FIELD_WORD)
function onStart()
SaveData._totalCoins = SaveData._totalCoins or 0
end
function onTick()
local currCoins = mem(0x00B2C5A8, FIELD_WORD)
mem(0x00B2C5AC, FIELD_FLOAT, 98)
if(currCoins > prevCoins) then
SaveData._totalCoins = SaveData._totalCoins + (currCoins - prevCoins)
elseif(currCoins < prevCoins) then
SaveData._totalCoins = SaveData._totalCoins + (currCoins + 100 - prevCoins)
end
prevCoins = currCoins
end
function onPostPlayerKill(harmedPlayer)
SaveData._totalCoins = math.max(0, SaveData._totalCoins - coinLossOnDeath)
end