tModLoader An alternative to Call on cross mod script?

Nakano15

Terrarian
So... I launched today an update to my companion mod, where to load custom companions, It sends calls to all mods loaded with a specific argument, telling mods with custom companions that It's the time to get their custom companion list.

The problem is, a few mods are set to crash when they receive an unknown command, frustrating this right away. I'm pretty sure even If I talk to the mod creators to see if they change that, or add the keyword to the exception list (so nothing happens when It is called), newer mods will most likelly also have in their codes instructions to crash when an unknown command is received. So... I really need ideas of an alternative to that.

As for why I'm using Call(), It's because I'm trying to load the list of custom companions whenever the base mod tries to load the first companion, since the last time mods were loaded/reloaded. I did that because trying to add the custom companion loading info during It's mod loading, could cause It not to be correctly loaded by the base mod, causing It to recognize the companion as non existing, unless you don't mind reloading the mod list.

That's actually the only way I found at the moment of loading custom companions.
Someone has any ideas of an alternative I could use?
 
I believe MonoMod has some built in cross mod communication stuff. But how are these mods crashing the game anyway? I'd suspect they just throw an exception. So, can't you just catch it with a try/catch?
 
Yeah, they throw an exception when they receive a non existing command, but the idea of using try/catch is so stupidly simple that... Wait, let me try that out.
Ps:. Your Shop Expander mod is one of them that is causing crash, though.

Edit:. That actually worked! Heh, the problem is solved. Thanks for the help.
 
Last edited:
Back
Top Bottom