Skip to content

Instantly share code, notes, and snippets.

View jameslkingsley's full-sized avatar

James Kingsley jameslkingsley

View GitHub Profile
// Place your settings in this file to overwrite the default settings
{
"files.exclude": {},
"window.openFilesInNewWindow": false,
"window.reopenFolders": "all",
"editor.roundedSelection": false,
"editor.insertSpaces": false,
"editor.fontSize": 14,
"editor.wrappingColumn": 0
}
rifles[] = {
{"rhs_weap_ak74m_2mag", 0.75},
{"another_rifle", 0.25}
};
if (!isServer) exitWith {};
[] spawn {
_protected = [];
while {true} do {
{
_unit = _x;
if (!isPlayer _unit && !(_unit in _protected)) then {
_group = group _unit;
_isHandled = _unit getVariable ["ARC_aiHandled", false];
if (!isServer) exitWith {};
[] spawn {
_protected = [];
while {true} do {
{
_unit = _x;
if (!isPlayer _unit && !(_unit in _protected)) then {
_group = group _unit;
_isHandled = _unit getVariable ["ARC_aiHandled", false];
{
//_x disableAI "MOVE"; // Disables move to enable animations
[_x, _grp, _cover] spawn {
PARAMS_3(_x,_grp,_cover);
while {(_x distance _cover) > 1} do {
_coverdir = [(getpos leader _grp), getpos _cover] call BIS_fnc_dirTo;
_grp setFormDir _coverdir;
_x setDir _coverdir;
_sup = getSuppression _x;
if (_sup > 0.2) then {
/*
Default jog: AmovPercMrunSlowWrflDf 1.396s
Sprint: AmovPercMevaSlowWrflDf 0.621s
*/
_handle = _this spawn {
private ["_unit", "_dest"];
_unit = _this select 0;
_dest = _this select 1;
void add_weapon_item(const object& obj_, const std::string& weapon_name_, const std::string& item_name_);
void add_weapon_item(const object& obj_, const std::string& weapon_name_, const std::string& item_name_, int ammo_count_);
void add_weapon_item(const object& obj_, const std::string& weapon_name_, const std::string& item_name_, int ammo_count_, const std::string& muzzle_name_);
///////////////////////////////////////////////////////////////////////
void add_weapon_item(const object& obj_, const std::string& weapon_name_, const std::string& item_name_) {
game_value params({
weapon_name_,
item_name_
/////////// HPP ///////////////////////////
void add_weapon_item(const object& obj_, const std::string& weapon_name_, const std::string& item_name_);
void add_weapon_item(const object& obj_, const std::string& weapon_name_, const std::string& item_name_, int ammo_count_ = 1, const std::string& muzzle_name_ = "");
/////////// CPP ///////////////////////////
void add_weapon_item(const object& obj_, const std::string& weapon_name_, const std::string& item_name_) {
game_value params({
weapon_name_,
item_name_
});
#define PROTO(CNAME) \
class ##CNAME##;
#define GRENADE(CNAME, PNAME) \
class ##CNAME##: ##PNAME## \
{ \
aiDispersionCoefX = 40; \
aiDispersionCoefY = 40; \
minRange = 2000; \
minRangeProbab = 0; \
class CfgPatches
{
class arc_ai_main
{
units[] = {};
weapons[] = {};
requiredVersion = 1.54;
author[] = {"Ed", "Kingsley"};
authorUrl = "https://github.com/jameslkingsley/";
version = "1.0.0.0";