Differences

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

Link to this comparison view

Both sides previous revision Previous revision
guides:simplecache [2019/01/12 18:21]
Skeet
guides:simplecache [2019/01/12 18:23] (current)
Skeet
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.
 +
 + 0 = [ thisTrigger , "​uncacheVariableName"​ ] call cbb_fnc_simpleCache;​
 + Will only be uncached when the variable ​ uncacheVariableName ​ is true.
 + Caches all AI in the trigger area.
 + This is probably the highest-performance,​ easiest-to-use,​ and most common implementation of cbb_simpleCache.
 +
 + 0 = [ thisTrigger , "​uncacheVariableName"​ , [ east ] ] call cbb_fnc_simpleCache;​
 + Same uncache parameter as above.
 + Caches all AI of side EAST in the trigger area.
 +
 + 0 = [ thisTrigger , "​uncacheVariableName"​ , [ "​man"​ ] ] call cbb_fnc_simpleCache;​
 + Same uncache parameter as above.
 + Caches all AI of type "​man"​ in the trigger area.
 +
 + 0 = [ thisTrigger , "​uncacheVariableName"​ , [ east , "​landvehicle"​ ] ] call cbb_fnc_simpleCache;​
 + Same uncache parameter as above.
 + Caches all AI in the trigger area that are side EAST and type "​landvehicle"​.
 +
 + 0 = [ thisTrigger , "​uncacheVariableName"​ , [ east , resistance , "​man"​ , "​tank"​ ] ] call cbb_fnc_simpleCache;​
 + Same uncache parameter as above.
 + Caches all AI in the trigger on side EAST or RESISTANCE, that are of type "​man"​ or "​tank"​. Cars and aircraft, for example, will not be cached.
 +
 + 0 = [ thisTrigger , "​uncacheVariableName"​ , [ "​man"​ , resistance , "​tank"​ , east ] ] call cbb_fnc_simpleCache;​
 + Same uncache parameter as above.
 + Same caching as the previous example. This demonstrates that for ease-of-use the order of elements in the sub-array does not matter.
 +
 + 0 = [ thisTrigger , "​uncacheVariableName"​ , [ east , resistance , "​Air"​] ] call cbb_fnc_simpleCache;​
 + 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.
 +
 +
 +
 +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.
 +
 + 0 = [ thisTrigger , [ west ] ] call cbb_fnc_simpleCache;​
 + Uncache when players on WEST, in a vehicle of type "​land"​ (remember the default "​land"​ is used when none is given, and that infantry are vehicles of type "​land"​) enter the trigger area.
 + Caches all AI in the trigger area.
 + If using a trigger area instead of an uncache variable, this is probably the highest-performance,​ easiest-to-use,​ and most common implementation of cbb_simpleCache.
 +
 + 0 = [ thisTrigger , [ west , "​man"​ ] , [ east ] ] call cbb_fnc_simpleCache;​
 + Uncache when players on WEST, in a vehicle of type "​man"​ (meaning infantry only; players inside another vehicle will not count), enter the trigger area.
 + Caches all AI of side EAST in the trigger area.
 +
 + 0 = [ thisTrigger , [ "​man"​ , west ] , [ "​man"​ ] ] call cbb_fnc_simpleCache;​
 + Same uncaching as the previous example, demonstrating that for ease-of-use the order of elements in the sub-array does not matter.
 + Caches all AI of type "​man"​ in the trigger area.
 +
 + Special cases for the uncache parameters that exist but should only be used with careful consideration.
 + Note: the cache parameters here are merely a continution of the above examples, are perfectly fine to use, and not part of any special case. It is only the uncache parameters, the first array, that is noteworthy.
 +
 + 0 = [ thisTrigger , [ west , "​AllVehicles"​ ] , [ east , "​landvehicle"​ ] ] call cbb_fnc_simpleCache;​
 + Uncache when players on WEST enter the trigger area. This includes when aircraft fly through it, even if they are many thousand meters above the ground. This is *usually* not the intended outcome of the mission maker, and should not be used without consideration.
 + Caches all AI in the trigger area that are side EAST and type "​landvehicle"​.
 +
 + 0 = [ thisTrigger , [ west , "​All"​ ] , [ east , resistance , "​man"​ , "​tank"​ ] ] call cbb_fnc_simpleCache;​
 + 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.
 + Caches all AI in the trigger on side EAST or RESISTANCE, that are of type "​man"​ or "​tank"​. Cars and aircraft, for example, will not be cached.
 +
  
  • Last modified: 13 months ago
  • by Skeet