OnKilled Fixes + Update readme with SP3 link

This commit is contained in:
eraser1 2015-09-08 23:00:26 -05:00
parent da72ab9c23
commit 819f295eba
3 changed files with 76 additions and 49 deletions

View File

@ -87,8 +87,9 @@ DMS_DEBUG = false;
DMS_banditSide = EAST; // The side (team) that AI Bandits will spawn on
DMS_clear_AI_body = false; // Clear AI body as soon as they die
DMS_clear_AI_body_chance = 50; // Percentage chance that AI bodies will be cleared when they die
DMS_remove_roadkill = false; // Remove gear from AI bodies that are roadkilled
DMS_remove_roadkill_chance = 0; // Percentage chance that roadkilled AI bodies will be deleted
DMS_credit_roadkill = false; // Credit players with respect/poptabs if they kill an AI by running it over
DMS_remove_roadkill = true; // Remove gear from AI bodies that are roadkilled
DMS_remove_roadkill_chance = 50; // Percentage chance that roadkilled AI bodies will be deleted
DMS_RemoveNVG = false; // Remove NVGs from AI bodies
DMS_ai_offload_to_client = true; // Offload spawned AI groups to random clients. Helps with server performance.

View File

@ -30,58 +30,22 @@ _type = _this select 2;
_launcher = secondaryWeapon _unit;
_playerObj = objNull;
if (isPlayer _player) then
// Remove gear according to configs
if (DMS_clear_AI_body && {(random 100) <= DMS_clear_AI_body_chance}) then
{
_playerObj = _player;
if (DMS_ai_share_info) then
{
{
if (((position _x) distance (position _unit)) <= DMS_ai_share_info_distance ) then {
_x reveal [_player, 4.0];
};
} forEach allUnits;
};
if (DMS_clear_AI_body && {(random 100) <= DMS_clear_AI_body_chance}) then
{
removeAllWeapons _unit;
removeAllAssignedItems _unit;
removeAllItemsWithMagazines _unit;
removeHeadgear _unit;
removeUniform _unit;
removeVest _unit;
removeBackpack _unit;
};
}
else
{
// Remove this due to reports of issues
/*
_playerObj = gunner _player;
if (isNull _playerObj) then
{
_playerObj = driver _player;
};
*/
if ((DMS_clear_AI_body && {(random 100) <= DMS_clear_AI_body_chance}) || {DMS_remove_roadkill && {(random 100) <= DMS_remove_roadkill_chance}}) then
{
removeAllWeapons _unit;
removeAllAssignedItems _unit;
removeAllItemsWithMagazines _unit;
removeHeadgear _unit;
removeUniform _unit;
removeVest _unit;
removeBackpack _unit;
};
removeAllWeapons _unit;
removeAllAssignedItems _unit;
removeAllItemsWithMagazines _unit;
removeHeadgear _unit;
removeUniform _unit;
removeVest _unit;
removeBackpack _unit;
};
if(DMS_ai_remove_launchers && {_launcher != ""}) then
{
_rockets = _launcher call DMS_fnc_selectMagazine;
_unit removeWeapon _launcher;
_unit removeWeaponGlobal _launcher;
{
if(_x == _rockets) then {
@ -95,6 +59,8 @@ if(DMS_RemoveNVG) then
_unit unlinkItem "NVGoggles";
};
// Give the AI a new leader if the killed unit was the leader
// credit: https://github.com/SMVampire/VEMF/
if (((count (units group _unit)) > 1) && {(leader group _unit) == _unit}) then
{
@ -105,7 +71,58 @@ if (((count (units group _unit)) > 1) && {(leader group _unit) == _unit}) then
if ((!isNull _playerObj) && {((getPlayerUID _playerObj) != "") && {((vehicle _playerObj) == _playerObj)}}) then
if (isPlayer _player) then
{
_veh = vehicle _player;
_playerObj = _player;
// Reveal the killer to the AI units
if (DMS_ai_share_info) then
{
{
if (((position _x) distance (position _unit)) <= DMS_ai_share_info_distance ) then
{
_x reveal [_player, 4.0];
};
} forEach allUnits;
};
// Fix for players killing AI from mounted vehicle guns
if (!(_player isKindOf "Exile_Unit_Player") && {!isNull (gunner _player)}) then
{
_playerObj = gunner _player;
};
if (!(_veh isEqualTo _player) && {(driver _veh) isEqualTo _player}) then
{
_playerObj = driver _veh;
// Don't reward players with poptabs/respect if configured to do so
if !(DMS_credit_roadkill) then
{
_playerObj = objNull;
};
// Remove gear from roadkills if configured to do so
if (DMS_remove_roadkill && {(random 100) <= DMS_remove_roadkill_chance}) then
{
removeAllWeapons _unit;
removeAllAssignedItems _unit;
removeAllItemsWithMagazines _unit;
removeHeadgear _unit;
removeUniform _unit;
removeVest _unit;
removeBackpack _unit;
};
};};
if ((!isNull _playerObj) && {((getPlayerUID _playerObj) != "")}) then
{
_moneyGain = missionNamespace getVariable [format ["DMS_%1MoneyGainOnKill",_side],0];
_repGain = missionNamespace getVariable [format ["DMS_%1RepGainOnKill",_side],0];

View File

@ -4,6 +4,8 @@ See also: http://www.exilemod.com/forums/topic/dms-defents-mission-system/#post-
## To install:
Put the pre-packed PBO in your ```@ExileServer\addons\``` directory. It should be alongside ```exile_server``` and ```exile_server_config```.
### NOTE: It is heavily suggested that you use [The Unofficial Exile v0.9.19 SP3](http://www.exilemod.com/forums/topic/exile-server-0-9-19-rse-sp3-unofficial-download-here/) with DMS, as it will resolve several issues.
If you are using infiSTAR and want to keep ```_CGM = true;```, then set ```_UMW = true;```, and add ```DMS_MissionMarkerCircle```, ```DMS_MissionMarkerDot``` to ```_aLocalM```,
so your ```_aLocalM``` would look like:
@ -72,9 +74,16 @@ if (!hasInterface && !isServer) then
- [Zupa](https://github.com/Windmolders) for suggestions and coding help.
- [Nawuko](https://github.com/Nawuko) for catching a silly mistake :P
- [shaworth](https://github.com/shaworth) and [KawaiiPotato](https://github.com/KawaiiPotato) for making the README all nice and pretty :)
- Everbody's feedback on [the DMS thread on exile forums](http://www.exilemod.com/forums/topic/dms-defents-mission-system/#post-10353)
## Changelog:
#### September 8, 2015 (11:00 PM CST-America):
* AI Bodies should now be properly cleaned when run over (if configured to do so with ```DMS_remove_roadkill``` and ```DMS_remove_roadkill_chance```).
* Added config option ```DMS_credit_roadkill```. If set to true, players will get poptabs/respect for running over AI. Default: false.
* Fixed giving poptabs/respect for killing AI from vehicles. Passengers and mounted gunners should properly receive poptabs/respect when they kill AI.
* Launchers should now be reliably removed from AI bodies that have them.
#### September 7, 2015 (7:00 PM CST-America):
* AI bodies should now be cleared if configured to do so with "DMS_clear_AI_body" and "DMS_clear_AI_body_chance".