Jump to content

141_Soap

Member
  • Content Count

    5
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About 141_Soap

  • Rank
    Rookie

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. 141_Soap

    [Release] POG Surrender

    Unfortunately I am having this error pop-up from POGSURInit.sqf line 10. Edit: Got it working without any errors (at least for now) here is the code: POGSURInit.sqf - > I decided that the script will be better off without the part with fleeing command since I can't see a point of it being here. - > I have also replaced the params from execVM part with the numbers themselves (it caused the game not realizing what they mean: Undefined variable in expression: _fear) - > I made the waitUntil more reading friendly ie. put different things in brackets and fixed the _nearguy condition, still looks a little bit wonky but works _unit = _this select 0; _fear = -0.2; //Set AI resistance to surrendering after getting scared. This is their actual "morale level" in-game. Ranges from -1.0 to 1.0. I've found that -0.1 feels the best, but you may think differently. (https://community.bistudio.com/wiki/morale) _nearguy = 30; //Set how close someone of the opposite team has to be in order to keep them under control (guarded). _badboys = 1; //Sets whether or not you want some AI to stop surrendering and flee if they aren't being guarded. Some AI will never try to flee. There is a 20 percent chance that a surrendered AI could be a "bad boy". if (side _unit != playerSide) then { _unit spawn { waitUntil {(morale _this <= -0.1) && (_this call BIS_fnc_enemyDetected == true) && (((_this findNearestEnemy position _this) distance _this <= 30) == true)}; [_this, 1, 50, -0.1] execVM "scripts\pogsur\POGSUR.sqf"; }; }; POGSUR.sqf Barely done anything to it, I have changed only two things: - > Defined the _badboy variable at the beginning of the file and also moved the _badboy 'randomizer' to the beginning of the file - > Edited the waitUntil the same way as in the first file _unit = _this select 0; _bad = _this select 1; _nearguy = _this select 2; _fear = _this select 3; _badboy = 0; if (_bad == 1) then { _badboy = selectRandom [0,1,2,3,4]; } else { _badboy = 0; }; _unit setUnitPos "AUTO"; _unit enableai "PATH"; _unit setCombatMode "BLUE"; _unit leaveVehicle vehicle _unit; doGetOut _unit; _unit action ["Eject", vehicle _unit]; sleep .1; _weapon = currentWeapon _unit; _unit removeWeapon (currentWeapon _unit); sleep .1; _weaponHolder = "WeaponHolderSimulated" createVehicle [0,0,0]; _weaponHolder addWeaponCargoGlobal [_weapon,1]; _weaponHolder setPos (_unit modelToWorld [0,.2,1.2]); _weaponHolder disableCollisionWith _unit; _dir = random(360); _speed = 1.5; _weaponHolder setVelocity [_speed * sin(_dir), _speed * cos(_dir),0]; _unit setUnitPos "UP"; _unit setBehaviour "SAFE"; _unit setSpeedMode "Limited"; sleep 0.1; ["ace_captives_setSurrendered", [_unit, true]] call CBA_fnc_globalEvent; if (_badboy == 1) then { sleep random [0,60,120]; waitUntil {(morale _unit >= _fear) && (_unit call BIS_fnc_enemyDetected == false) && (((_unit findNearestEnemy position _unit) distance _unit >= _nearguy) == true) && (_unit getVariable ["ace_captives_isHandcuffed", false])}; ["ace_captives_setSurrendered",[_unit,false]] call CBA_fnc_globalEvent; _unit setUnitPos "AUTO"; _unit setBehaviour "AWARE"; _unit setSpeedMode "NORMAL"; } else {}; All in all it's a great work, couple of errors here and there but they could be caused by some game updates 🙂 Cheers
  2. Hey, I know this thread is a year old but just wanted to give a quick heads up. The script seems somewhat working. The incoming shells/missiles do explode in the air but the Preatiorians are not firing at them. Maybe if you possibly read this, you can figure out what's going on. Edit: Nevermind... Arma was just doing it's own shit as always 😉
  3. Hey @kirumy I'm very interested in outcome of this. One thing i don't know is where exactly do I put this? "Init" part in init.sqf or weapon's init field? And where to put the main part with FSG_fnc_addCram and FSG_fnc_addSam?
×