Hi,
Is there a way I can add a EH to all AI , as I need a % chance they drop certain Items on the floor when killed.
Thanks
Hi,
Is there a way I can add a EH to all AI , as I need a % chance they drop certain Items on the floor when killed.
Thanks
Hmmmm ok, but don't they already have a Killed EH i could tap into , or would i need to add another then ?
Would this work ?
Description.ext
class Extended_Init_EventHandlers { class Man { init = "_this call (compile preprocessFileLineNumbers 'my_randomEH.sqf')"; }; };
my_randomEH.sqf
private "_this"; _this = _this select 0; if ((side _this == EAST) and (!isPlayer _this)) then { _this addEventHandler [ "killed", { _this execVM "scripts\AIdeath.sqf"; }]; };
AIdeath.sqf
*** run a random % change they drop a item when killed...
Funny enough, I just implemented EXACTLY that yesterday in ALiVE!
By chance (adjustable on module) AI drops INTEL (some topsecret, research, etc. files) when killed.
use this:
class Extended_Killed_Eventhandlers { class CAManBase { class WhatEverClassYouNameIt { killed = "_this call yourFunction"; }; }; };
whereas with _this you get [_killed,_killer] so your function needs to take into account _this select 0 and _this select 1
Ahhhhh Perfect !!!!!
Thanks !!!
@highhead Funny enough, I just implemented EXACTLY that yesterday in ALiVE!
By chance (adjustable on module) AI drops INTEL (some topsecret, research, etc. files) when killed.
Hell yes!!!!!
@highhead Funny enough, I just implemented EXACTLY that yesterday in ALiVE!
By chance (adjustable on module) AI drops INTEL (some topsecret, research, etc. files) when killed.
I just may be in love with you right now :P