Skip to content

10Dozen/dzn_dynai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

dzn_dynai

Version: 1.3.1.5

Dynamic AI with Blackjack and Hookers

License: APL-SA

Dependencies

How To

Step By Step

See Getting Started Wiki

Control Zone

If zone is not active by default and before it activated you can use some functions to control zones:

  • dzn_zone1 call dzn_fnc_dynai_activateZone - activates zone and start spawn groups. Parameters: gamelogic object;
  • [dzn_zone1, [200,200,0], 90] call dzn_fnc_dynai_moveZone - moves and rotates given zone. Parameters: gamelogic object, pos3d, direction (optional);
  • dzn_zone1 call dzn_fnc_dynai_getZoneKeypoints - return all zone's keypoints (array of pos3ds);
  • [dzn_zone1, [ [200,200,0], [300,300,0], [400,400,0] ]] call dzn_fnc_dynai_setZoneKeypoints - set new keypoints for zone. Parameters: zone's GameLogic, array of pos3ds


Get more at API wiki.

Vehicle Behavior

Use different second value in vehicle array ( ["B_G_Offroad_01_armed_F","Vehicle",""] ) to get different behavior:
Vehicle, Vehicle Patrol - vehicle group will patrol through keypoints or random points in cycle.
Vehicle Advance - vehicle group will move through keypoints or several random points and will hold on the last checkpoint.
Vehicle Hold - vehicle group will hold therir position (static, AAA, defensive position)
Vehicle Road Hold/Road Patrol - vehicle group will hold their position at the road/patrol roads

Groups Reaction

If dzn_dynai_allowGroupResponse variable is true - group reactions will be used. That means, that group which met many hostiles or suffer great loses will call for help. Then nearby allied group will move to caller position to provide support. You can add Editor-placed units/groups to Group Reaction system (check wiki for details).

To enable/disable Group Reaction per zone, one may add extras section to zone's config:

,[
    ["providesSupport", false], /* when True makes groups to provide support to other groups */
    ["requestsSupport", true]   /* when True makes groups call for support */ 
]

Caching

If dzn_dynai_enableCaching variable is true - units, which are placed far from the players become 'cached' and will not affect on performance. Cached unit will be hidden, excluded from simulation (no physics, no AI, no graphics). Anyway group leaders will not be cached, so AI groups will patrol areas (using single unit per group) and when players come closer - rest of the squad will be uncached at the current position of group leader.
dzn_dynai_cacheDistance variable allow you to set minimum distance between unit and nearest player when unit become cached.
dzn_dynai_cachingTimeout and dzn_dynai_cacheCheckTimer allow you to customize time between cache/uncache checks (e.g. make periods longer/shorter)

Group Custom Skill Level

It is available to set individual skill level for every group. To do it - add skill array as 3rd argument of group array:

Simple skill

```sqf [ 28, [ ["B_G_Offroad_01_armed_F","Vehicle Patrol",""], ["B_Soldier_F",[0,"driver"],""], ["B_Soldier_F",[0,"gunner"],""] ],

[false, 0.5] /* Simple skill: isComplex(BOOLEAN), skill level(NUMBER) */ ]


<h4>Complex skill</h4>

```sqf
[
  28,
  [
	  ["B_G_Offroad_01_armed_F","Vehicle Patrol",""],
	  ["B_Soldier_F",[0,"driver"],""],
	  ["B_Soldier_F",[0,"gunner"],""]
  ],
  
  [true, [["accuracy, 0.5], ["spotTime", 0.9]]] /* Complex Skill: isComplex(BOOLEAN), Skill array (NUMBER) */]<