![](https://forums.bohemia.net/uploads/set_resources_8/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
![](https://secure.gravatar.com/avatar/8b1013f96f372987165e74fcba3bdb09?d=https://forums.bohemia.net/uploads/set_resources_8/84c1e40ea0e759e3f1505eb1788ddf3c_default_photo.png)
krabban333
-
Content Count
3 -
Joined
-
Last visited
-
Medals
Posts posted by krabban333
-
-
Thanks, was an interesting read!
Long story short;I'm working on a surrender
scriptmod where if a surrendered unit is fired upon they will start fleeing.
I managed to solve my issue by using the EH HitPart for the projectile. The finished code looks like this:
// Check if a player fires at a surrendered or cowering unit fnc_addPlayerFiredHandler = { { _player = _x; if (isNil {_player getVariable "logicAdded"}) then { // On player fire event _player addEventHandler ["Fired", { params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; // Throttle fire event if (!(_unit getVariable ["onCooldown", false])) then { [_unit, 0.6] call fnc_addGeneralCooldown; // On projectile hit event _projectile addEventHandler ["HitPart", { params ["_projectile", "_target", "_shooter", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"]; [_shooter, _position] spawn fnc_handleBulletImpact; }]; }; }]; _player setVariable ["logicAdded", true]; }; } forEach PLAYERS; };
-
Hi,
I'm trying to add an event handler for projectiles fired by the player, but I'm getting the error Error Foreign error: Unknown enum value: "EpeContact"Any ideas on why this happens? Dumping the _projectile variable returns an object, so I'm kinda lost.
Thanks in advance!
Here's my code:_player addEventHandler ["Fired", { params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; _projectile addEventHandler ["EpeContact", { params ["_object1", "_object2", "_selection1", "_selection2", "_force", "_reactVect", "_worldPos"]; }]; }];
Extended Morale System
in ARMA 3 - ADDONS & MODS: COMPLETE
Posted
Heyo,
Long time scripter, first time modder here.
Check out my attempt at improving the morale system of ARMA 3, hopefully making the AI feel a little less like terminator robots. Mind the jank.
Features
Requirements
CBA_A3
ACE3
LAMBS Danger (Might work without this one, but may result in weird behaviours)
Steam workshop link
Extended Morale System
Github