ysaroka / InediaInfectedAI

Wiki-repository for InediaInfectedAI mod, game DayZ Standalone.
6 stars 1 forks source link

Add the ability to include custom irritant items in config #13

Closed ysaroka closed 11 months ago

ysaroka commented 1 year ago

Add the ability to include custom irritant items in config. An essential condition will be the presence of the CEM (EnergyManager) in the irritant item class.

igorir3 commented 1 year ago

And also that, when reacting, they simply approached the object, and did not break it

ysaroka commented 1 year ago

I think that the possibility of adding a custom irritant won't be implemented in general. There are methods, EntityAI.OnWorkStart() and EntityAI.OnWorkStop(), to which I can subscribe for enabling or disabling the irritant. However, the problem is that these methods are completely overridden in modded items. For instance, in the "SimpleMatch" mod, meaning I can't add them universally in ItemBase.OnWork*() because they will still be overridden in child classes. Consequently, I don't see a way out of the situation, except to search for a method to initiate my own loop for items that trigger irritation. The last time I attempted this, it resulted in a significant drop in server FPS because I utilized the Timer class.

ysaroka commented 11 months ago

Implemented, will be added in the next update.