To mod authors using mod_hooks: Please use the ::mods_queue feature (new as of mod_hooks version 15) in future versions of your mods. This lets mods declare dependencies and incompatibilities with other mods so that mod_hooks can dynamically reorder the mods to satisfy their dependencies, and I hope it will become standard. Even if you don't have any relationships to declare, using ::mods_queue ensures that your mod can participate in the dynamic ordering. See the description tab for more details. Also, this feature is new, so please let me know if you run into any problems. Converting a mod is simple. If your mod normally does: ::mods_registerMod("foo", 1); ... your hooks here ...
Change it to: ::mods_registerMod("foo", 1); ::mods_queue(null, null, function() { ... your hooks here ... });
Also, since version 16, the restrictions on mod names and versions are enforced. See the documentation for ::mods_registerMod for details.
As of version 19, mod authors must exercise special care if they compile their own .cnut files (which is usually not necessary). See the documentation for ::mods_hookClass for details.
As of version 20, it is now possible (usually) to hook exact classes rather than hooking a base class and trying to find a particular child. See ::mods_hookExactClass for details.
As of version 21, 'new' hooks work more reliably (i.e. in more situations), but class-based hooks are still better if applicable.
Does anyone know of any good youtube tutorials for using this? I'm not at all experienced in programming and looking at this makes a physical woosh sound because it just goes over my head.
im pretty sure it dosnt work, right now the only way i can get fantasy bros to work i if i install legend mod, i guess its script hook is more up to date. but it crashes the game
Hello Adam, I'm now learning how to use mod script hooks, can you give me an example of ::mods_addField()? i'd want to add variables in "m" for a skill for example:
isAstray and isHit is 2 new variables i want to add. How to add it by hooks using ::mods_addField()?
Hey guys maybe someone can help me? I'm trying to change values in 'm' of named weapon i already own. ::mods_hookNewObject("items/weapons/named/named_axe", function(wpn) { wpn.m.CritChanceBonus = this.Math.floor((wpn.m.ArmorDamageMult - 1.3) * 50); }); though it takes 'm' of basic named_axe with basic 'm' values. Or it applies CritChanceBonus based on ArmorDamageMult before deserealizing? How to make it take m.ArmorDamageMult of instance of named_axe with deserealized values?
Hi. I'd like to use this mod and Davkul rising but when I install the mod hooks as per the tutorial, the game fails to launch. When I remove the mod hook from my data folder it works. Is there any solution to this? Thanks
210 comments
::mods_registerMod("foo", 1);
... your hooks here ...
Change it to:
::mods_registerMod("foo", 1);
::mods_queue(null, null, function()
{
... your hooks here ...
});
Also, since version 16, the restrictions on mod names and versions are enforced. See the documentation for ::mods_registerMod for details.
As of version 19, mod authors must exercise special care if they compile their own .cnut files (which is usually not necessary). See the documentation for ::mods_hookClass for details.
As of version 20, it is now possible (usually) to hook exact classes rather than hooking a base class and trying to find a particular child. See ::mods_hookExactClass for details.
As of version 21, 'new' hooks work more reliably (i.e. in more situations), but class-based hooks are still better if applicable.
::mods_addField("skills/skill", "skill", "CanTargetAlly", false);
how to do it properly?
And I'm confused about this mod been compatible or not with the current game version... and since nobody posted here recently, I don't know.
So, is the current modhooks compatible with the new free DLC?
If not, is there any chance we might get an updated version?
for example:
isAstray and isHit is 2 new variables i want to add. How to add it by hooks using ::mods_addField()?
I'm trying to change values in 'm' of named weapon i already own.
::mods_hookNewObject("items/weapons/named/named_axe", function(wpn) {
though it takes 'm' of basic named_axe with basic 'm' values. Or it applies CritChanceBonus based on ArmorDamageMult before deserealizing? How to make it take m.ArmorDamageMult of instance of named_axe with deserealized values?wpn.m.CritChanceBonus = this.Math.floor((wpn.m.ArmorDamageMult - 1.3) * 50);
});
I'd like to use this mod and Davkul rising but when I install the mod hooks as per the tutorial, the game fails to launch.
When I remove the mod hook from my data folder it works.
Is there any solution to this? Thanks