Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
guides:simplecache [2019/01/12 18:10]
Skeet created
guides:simplecache [2019/01/12 18:23]
Skeet
Line 1: Line 1:
-#​cbb_simplecache 
- 
 Gives mission makers an easy and performance-friendly method of caching groups of AI. Gives mission makers an easy and performance-friendly method of caching groups of AI.
  
Line 6: Line 4:
  
 AI will only be "​uncached"​ - enableSimulationGlobal true, and hideObjectGlobal false - when: AI will only be "​uncached"​ - enableSimulationGlobal true, and hideObjectGlobal false - when:
-    ​1) a specified variable goes from `false` to `true`; +1) a specified variable goes from `false` to `true`; 
- or + 
- 2) players of a specified side (and optionally as/in a vehicle class that is/is a child of a specified class) enter the same region in which the AI were cached+**or** 
 + 
 +2) players of a specified side (and optionally as/in a vehicle class that is/is a child of a specified class) enter the same region in which the AI were cached
  
 Included is a sample mission showing a few different use cases and markers documenting them. Included is a sample mission showing a few different use cases and markers documenting them.
- The sample mission can be found in @CBB_Mods_A3\examples\cbb_simpleCache.VR+The sample mission can be found in @CBB_Mods_A3\examples\cbb_simpleCache.VR
  
 Below are the full documentation instructions also included in the cbb_simpleCache.sqf file. Below are the full documentation instructions also included in the cbb_simpleCache.sqf file.
  
  
- 
- 
-cbb_simpleCache 
  
 AUTHOR AUTHOR
     ​     ​
- Iron+**Iron**
  
 DESCRIPTION DESCRIPTION
Line 37: Line 34:
   
  This system is only designed to cache AI once and then uncache them once. It is not capable of repeated cycles or recaching AI should players leave and return to an area; a different caching system is required for scenarios where players are expected/​allowed to travel at random across a region and the AI be repeatedly uncached whenever the players are near.  This system is only designed to cache AI once and then uncache them once. It is not capable of repeated cycles or recaching AI should players leave and return to an area; a different caching system is required for scenarios where players are expected/​allowed to travel at random across a region and the AI be repeatedly uncached whenever the players are near.
 +
 +
 +
  
 ARGUMENTS ARGUMENTS
Line 108: Line 108:
  [ west , "​All"​ ] - Uncache when players on west enter the trigger area. Also looks at classes not normally considered as occupied by players - backpacks, buildings, etc. - and is untested and not recommended. But, it's there, if you really want it.  [ west , "​All"​ ] - Uncache when players on west enter the trigger area. Also looks at classes not normally considered as occupied by players - backpacks, buildings, etc. - and is untested and not recommended. But, it's there, if you really want it.
   
- ---------- ​         ---------- ​         ---------- ​         ---------- + 
-  + 
- OPTIONAL+OPTIONAL
   
  2: [ side(s) of AI to cache , optional classname(s) AI vehicles must inherit from to cache] (ARRAY)  2: [ side(s) of AI to cache , optional classname(s) AI vehicles must inherit from to cache] (ARRAY)
Line 158: Line 158:
  The trigger'​s onActivation will call cbb_simpleCache,​ and be constructed as described in the arguments above and full examples below.  The trigger'​s onActivation will call cbb_simpleCache,​ and be constructed as described in the arguments above and full examples below.
   
- ---------- ​         ---------- ​         ---------- ​         ---------- +Using a separate variable to decide when to uncache units. This is the highest performance method. The ""​ around the variable name are required. The named uncache variable must be uninitialized or be a boolean false, or cbb_simpleCache will abort.
-  +
- Using a separate variable to decide when to uncache units. This is the highest performance method. The ""​ around the variable name are required. The named uncache variable must be uninitialized or be a boolean false, or cbb_simpleCache will abort.+
   
  0 = [ thisTrigger , "​uncacheVariableName"​ ] call cbb_fnc_simpleCache;​  0 = [ thisTrigger , "​uncacheVariableName"​ ] call cbb_fnc_simpleCache;​
Line 190: Line 188:
  Same uncache parameter as above.  Same uncache parameter as above.
  Caches all AI in the trigger area that are on side EAST or RESISTANCE, and of vehicle type "​air"​. Ground units will not be cached.  Caches all AI in the trigger area that are on side EAST or RESISTANCE, and of vehicle type "​air"​. Ground units will not be cached.
-  + 
- ---------- ​         ---------- ​         ---------- ​         ---------- + 
-  + 
- Using the trigger-area defined by the caching trigger in the map editor to decide when to uncache units. This will automatically uncache AI when players matching a required side and optionally in a vehicle inheriting from a given classname enter the trigger area. This method is not quite as high-performance,​ but it is very easy to configure.+Using the trigger-area defined by the caching trigger in the map editor to decide when to uncache units. This will automatically uncache AI when players matching a required side and optionally in a vehicle inheriting from a given classname enter the trigger area. This method is not quite as high-performance,​ but it is very easy to configure.
   
  The following examples will include versions of the above 2nd optional parameter as well.  The following examples will include versions of the above 2nd optional parameter as well.
  • Last modified: 5 years ago
  • by Skeet