Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. //simple AI Skill script v0.1
  2. //code samples takes from EOS by ENIGMA
  3. //
  4. //save this as setSkillv01.sqf and put it in your ..Profile\mpmissions\missionName.mapName\scripts\setSkillv01.sqf
  5. //put this in init.sqf or initServer.sqf:
  6. //[] execVM "scripts\setSkillv01.sqf";
  7.  
  8. if (!isServer) exitWith {};
  9.  
  10. waitUntil {time > 5}; //increase if you have units spawning in at beginning.
  11.  
  12. _skillset = [
  13. 0.25, // aimingAccuracy
  14. 0.45, // aimingShake
  15. 0.6, // aimingSpeed
  16. 0.4, // spotDistance
  17. 0.4, // spotTime
  18. 1, // courage
  19. 1, //endurance
  20. 1, // reloadSpeed
  21. 1, // commanding
  22. 1 // general
  23. ];
  24.  
  25.  
  26. {
  27. if ((side _x) == west) then //east for opfor, remove this line and line 35 if you want to change skill on every ai.
  28. {
  29. _unit = _x;
  30. {
  31. _skillvalue = (_skillset select _forEachIndex) + (random 0.05) - (random 0.05); //Remove the random if you want
  32. _unit setSkill [_x,_skillvalue];
  33. } forEach ['aimingAccuracy','aimingShake','aimingSpeed','spotDistance','spotTime','courage','endurance','reloadSpeed','commanding','general'];
  34.  
  35. };
  36. } forEach allUnits;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement