one thing i immediately notice is that you're overriding (what i assume to be) the library table that stores monochrome's modified anotherpowerup with the default anotherpowerup. on the post for said script, it says "Using an unmodified anotherpowerup.lua file will lead to incorrect and glitchy behavior." so it's best that you move these into two separate variables (not to mention this will likely render the previously registered powerups useless even if this miraculously doesn't overwrite everything inside onInitAPI()? though i haven't tested it myself)
back on topic, the approach here depends on the exact desired effect. if you don't want the libraries to load
at all, declare them without assigning to them at the top of the file, and wrap everything else inside a conditional statement:
Code: Select all
local ap_smm2, ap
if(player.character ~= CHARACTER_WARIO) then
ap = require("anotherpowerup")
ap_smm2 = require("anotherpowerupSMM2")
ap.registerItemTier(968, true)
ap.registerItemTier(969, true)
ap.registerPowerup("ap_thunderflower")
ap_smm2.registerItemTier(800, true)
ap_smm2.registerPowerup("ap_acorn")
ap_smm2.registerItemTier(801, true)
ap_smm2.registerPowerup("ap_penguinsuit")
end
the caveat here is that if you are accessing these libraries anywhere else in the code, you have to wrap it with a nil check, for example:
Code: Select all
if(ap) then
-- access ap fields here
end
if you want don't want to have to do this every time (and it makes no difference to what you're actually trying to do), then you can load the libraries anyway and just move the registering inside the if:
Code: Select all
local ap = require("anotherpowerup")
local ap_smm2 = require("anotherpowerupSMM2")
if(player.character ~= CHARACTER_WARIO) then
ap.registerItemTier(968, true)
ap.registerItemTier(969, true)
ap.registerPowerup("ap_thunderflower")
ap_smm2.registerItemTier(800, true)
ap_smm2.registerPowerup("ap_acorn")
ap_smm2.registerItemTier(801, true)
ap_smm2.registerPowerup("ap_penguinsuit")
end
hope this helps