so, is it working? cause I can't get it
Code:object CanNpcAttack(BaseNpc npc, BaseEntity target) { PrintWarning("CanNpcAttack"); return null; }
Solved CanNpcAttack broken?
Discussion in 'Rust Development' started by wazzzup, Dec 28, 2017.
-
I guess you use CustomAI.
CustomAI doesn't call this hook. -
I don't know if that works, but this does.
Code:object OnNpcTarget(BaseNpc npc, BaseEntity entity) { return 0f; }
-
-
Oh? How are you testing?
That's what I'm using in BotSpawn (with additional checks) to make animals ignore Scientists/Murderers. -
well, caught that old plugin isn't working, so simply put all that hooks in the plugin and ran into agro radius of animals - they attacking me, but hooks didn't response to console with PrintWarning
-
Are you checking console as you go? Does this test plugin compile?
Attach it or PM to me, if you want. -
Code:
private object OnNpcTarget(BaseNpc npc, BaseEntity entity) { PrintWarning("OnNpcTarget"); return null; } private object OnNpcPlayerTarget(NPCPlayerApex npc, BaseEntity entity) { PrintWarning("OnNpcPlayerTarget"); return null; } private object CanNpcAttack(BaseNpc npc, BaseEntity target) { PrintWarning("CanNpcAttack"); return null; }
-
I know OnNpcPlayerTarget is working fine - I've been working with it this week.
OnNpcTarget doesn't seem to be working for me, though, as you say.
Animal_Safe option in BotSpawn is dead on my server.
I'll try to find out why.
It could be that two plugins have the same hook with a different action - Not in a position to check it out just now but maybe you could oxide.unload * then load your test plugin on its own? -
tried that, hook is not fired
-
Hmm. Maybe something's changed then.
I'll fire up the server and check further tomorrow. -
^^ The code around this hook has changed.
I've notified Wulf in the original request thread.
Thanks @wazzzup -
ok, thanks, happy holidays ))
I was too lazy, just checked are the hooks in place and their param types