FAQ - MemeMayhem/ModExamples GitHub Wiki
The tutorial is the best starting point to learn how to make mods for Meme Mayhem. It only covers the very basics though and you may still have many questions about how to turn your idea into a functioning mod. Here we have collected some commonly asked questions from the community. If you can't find your answer here, feel free to ask with github issues.
What if my mod is not doing anything?
Follow the wiki to install an example mod and verify the example mod is working as expected. If the example mod is also not working, it may be a compatibility issue between the mod and the game. Report it to the developers.
If the example mod works, press "Ctrl + F8" in the game to open the mod UI and check if your mod is correctly loaded. If there is an error message displayed for your mod, fix the error and restart the game to try again.
If your mod is correctly listed in the mod UI but still doesn't do anything in the game, check the "Player.log" file located at %USERPROFILE%\AppData\LocalLow\Cr3 Studio\Meme Mayhem
and see if there are any errors related to your mod.
What if the game gets stuck at the loading screen,my mod character is locked or something is totally broken?
If there are errors in the mod scripts, the mod character cannot be loaded correctly and you may see it being locked:
Script errors can also cause other issues, like game being stuck at the loading screen, battle freeze, severe FPS drop, etc.
These errors will be logged to the "Player.log" file located at %USERPROFILE%\AppData\LocalLow\Cr3 Studio\Meme Mayhem
. Find the file and locate errors with a Lua stack trace. The stack trace may look like this:
LuaExceptionWithStackTrace: [string "UGC-Mods-Custom Relic/Trigger.lua.txt"]:31: This mod has failed to load.
stack traceback:
[C]: in function 'error'
[string "UGC-Mods-Custom Relic/Trigger.lua.txt"]:31: in main chunk
The above stack trace points to an error in a mod named "Custom Relic". Its Trigger.lua.txt
file throws an error on line 31.
If you are not able to fix the issue yourself, you can create a github issue and attach the Player.log
file and your entire mod folder in a zip for us to take a look.
How to reload the mod without restarting the game?
When working on your mod, you can press Ctrl + F5
in the game to reload mods after making changes to the mod script. Restarting the game also works but is slower. Note that this will only reload mods that are already loaded by the game. If you have added a new mod, it won't detect the new mod until you restart the game.
How to set the character's initial attributes/perks?
The tutorial has demonstrated how to set the character's initial emojis and relics. Setting other attributes/perks is very similar. For example:
attributes = {
start_gold = 1234,
},
perks = {
"energy_on_ultimate",
"heal_on_ultimate",
"energy_on_start",
},
The above gives the character an initial gold of 1234 and 3 perks to start with.
For more character data examples, check out the game's character data published here: https://github.com/MemeMayhem/ModExamples/tree/main/References/CharacterData
How to modify the character's attributes with perks/relics?
You can use the modify_attributes
field on perks/relics to modify character attributes. For example:
modify_attributes = {
attack = 100,
},
The above gives the character +100 attack when the perk/relic is applied.
For more perk/relic data examples, check out the game's perk/relic data here: PerkData and RelicData.
How to modify the character's attributes during battle?
Character's attributes can be modified temporarily (resets after battle) or permanently (persists after battle) when you modify them in battle. The mod APIs are different. For example:
combat_unit:RegisterOnCombatStartCallback(name, function (level, target)
-- Modify the max health for the current battle.
combat_unit:ModifyAttribute("health_maximum", 1000, false)
end)
combat_unit:RegisterOnCombatEndCallback(name, function (level, target)
-- Modify the max health that persists.
combat_unit.run_instance:ModifySavedPerkDataAttributes("health_maximum", 100)
end)
The above code for perks/relics gives the character +1000 temporary max health when battle starts, and +100 permanent max health when battle ends.
How to implement a perk/relic like flex_quest/Hit the Gym?
You need to use a custom attribute as the counter and modify/track the counter in event callback functions. An example can be found in https://github.com/MemeMayhem/ModExamples/tree/main/Medium-PerkQuest.