Patriarachnid Posted March 20, 2015 Share Posted March 20, 2015 I'm trying to make a character that, in certain situations, gets no benefit from / is completely unable to use healing items such as healing salves and honey poultices. Problem is, I don't know how to do that, and I can't find anything, in the base game or other mods, that does something similar. Any ideas? I'd prefer to avoid editing the honey poultice and healing salve files if I can. Link to comment Share on other sites More sharing options...
Blueberrys Posted March 21, 2015 Share Posted March 21, 2015 @Patriarachnid Change the heal action's function.ACTIONS = GLOBAL.ACTIONSlocal orig_heal_fn = ACTIONS.HEAL.fnlocal function disable_heal() ACTIONS.HEAL.fn = function(act) endendlocal function enable_heal() ACTIONS.HEAL.fn = orig_heal_fnend Link to comment Share on other sites More sharing options...
Patriarachnid Posted March 21, 2015 Author Share Posted March 21, 2015 Ok. So, what do I do with this? Where do I put it? In the modmain? The character prefab? What do I do so that in certain circumstances the healing is disabled for the character but other times it isn't? Link to comment Share on other sites More sharing options...
Blueberrys Posted March 21, 2015 Share Posted March 21, 2015 @Patriarachnid You can put that in the modmain, but if it's supposed to be character specific, you can put it in your character file too with a few modifications.For use in the character's file, just remove this part:ACTIONS = GLOBAL.ACTIONSWhen do you want to activate/deactivate it? Just call the disable_heal or enable_heal functions. Edit: Have a look in actions.lua, the part with the Heal action's function. You can see that it's what calls functions in the Healer component, so changing it to an empty function will deactivate it. Link to comment Share on other sites More sharing options...
Patriarachnid Posted March 21, 2015 Author Share Posted March 21, 2015 Ok, it works. Thanks much. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.