BIS fnc locations: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *L([a-z ])" to "$1 - l$2")
 
(63 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma2
____________________________________________________________________________________________
|version1= 1.00


| arma2 |= Game name
|game2= arma2oa
|version2= 1.50


|1.00|= Game version
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| <pre>
|game4= arma3
/*
|version4= 0.50
File: locations.sqf


Description:
|gr1= Systems
Creates location logics in the given area


Parameter(s):
|arg=
_this select 0: String, Location, Object or Array - Location type(s), list of custom locations or list of logics
_this select 1: Object or Array - Checked area (trigger or array in format [center,distance])
_this select 2: Boolean - Debug mode


Returned value:
|eff=
Array - list of all location logics in given area (both new and already created ones)
Note: If locations given by type (String) only config locations are used (not custom locations created via createLocation - because there is no way to get unique id/name for them). For script created locations - give list of them to this function.
*/
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_locations]]; --> |= Syntax
|descr= Creates or registers location logics (used in various modules, like [[Ambient Civilians]], [[Ambient Civilian Vehicles]] or Warfare 2).


|p1= |= Parameter 1
Upon registering, function will set following variables into location logic's variable space:
* "class" - unique class of location (either {{hl|BIS_loc_<configname>}} or {{hl|BIS_loc_custom_<ID>}})
* "name" - name of location from config or [[setName]] command. If none is defined, class is used
* "type" - config type
* "neighbors" - config defined neighbor locations


| |= Return value
If you are registering currently existing object and some of variables above is already stored in it, it will '''not''' be replaced.
____________________________________________________________________________________________


|x1= <code></code> |=
|s1= [types, area, debug] call [[BIS_fnc_locations]]
____________________________________________________________________________________________


| |= See also
|p1= types: [[String]] or [[Array]] of [[String]]s


}}
|p2= area: [[Array]] in format [center, distance]
 
|p3= debug: [[Boolean]] (Optional)
 
|r1= [[Array]] - list of registered locations
 
|s2= [objects] call [[BIS_fnc_locations]]
 
|p21= objects: Array of [[Object]]s or [[Location]]s - list of specific locations to be registered
 
|r2= [[Array]] - list of registered locations
|x1= <sqf>["CityCenter", [getPosATL player, 1000]] call BIS_fnc_locations;</sqf>
 
|x2= <sqf>[["acityc_dolina"]] call BIS_fnc_locations;</sqf>


<h3 style="display:none">Notes</h3>
|x3= <sqf>[[myLocation1, myLocation2], [], true] call BIS_fnc_locations;</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|seealso= [[Functions Library]]
</dl>
}}


<h3 style="display:none">Bottom Section</h3>
{{Note
[[Category:Function Group: Systems|{{uc:locations}}]]
|user= Str
[[Category:Functions|{{uc:locations}}]]
|timestamp= 20090531151500
[[Category:{{Name|arma2}}: Functions|{{uc:locations}}]]
|text= You can also use <sqf inline>"" call BIS_fnc_locations</sqf> for quick debug of all locations on landscape
[[Category:{{Name|arma2oa}}: Functions|{{uc:locations}}]]
}}
[[Category:{{Name|tkoh}}: Functions|{{uc:locations}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:locations}}]]

Latest revision as of 16:38, 8 November 2023

Hover & click on the images for description

Description

Description:
Creates or registers location logics (used in various modules, like Ambient Civilians, Ambient Civilian Vehicles or Warfare 2). Upon registering, function will set following variables into location logic's variable space:
  • "class" - unique class of location (either BIS_loc_<configname> or BIS_loc_custom_<ID>)
  • "name" - name of location from config or setName command. If none is defined, class is used
  • "type" - config type
  • "neighbors" - config defined neighbor locations
If you are registering currently existing object and some of variables above is already stored in it, it will not be replaced.
Execution:
call
Groups:
Systems

Syntax

Syntax:
[types, area, debug] call BIS_fnc_locations
Parameters:
types: String or Array of Strings
area: Array in format [center, distance]
debug: Boolean (Optional)
Return Value:
Array - list of registered locations

Alternative Syntax

Syntax:
[objects] call BIS_fnc_locations
Parameters:
objects: Array of Objects or Locations - list of specific locations to be registered
Return Value:
Array - list of registered locations

Examples

Example 1:
["CityCenter", [getPosATL player, 1000]] call BIS_fnc_locations;
Example 2:
[["acityc_dolina"]] call BIS_fnc_locations;
Example 3:
[[myLocation1, myLocation2], [], true] call BIS_fnc_locations;

Additional Information

See also:
Functions Library

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Str - c
Posted on May 31, 2009 - 15:15 (UTC)
You can also use "" call BIS_fnc_locations for quick debug of all locations on landscape