BIS fnc loadFunctions: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
| arma3 | | arma3 | ||
|1.00 | |1.00 | ||
|gr1 = Diagnostic | |gr1 = Diagnostic | ||
| Compile scripts and save them into globally available functions. Defines [[_fnc_scriptName]] variable. | | Compile scripts and save them into globally available functions. Defines [[_fnc_scriptName]] variable. | ||
| [fileDirectory, prefix, nameVars, global] call [[BIS_fnc_loadFunctions]] | | [fileDirectory, prefix, nameVars, global] call [[BIS_fnc_loadFunctions]] | ||
|p1= fileDirectory: [[String]] - script path | |p1= fileDirectory: [[String]] - script path | ||
|p2= prefix: [[String]] - variable prefix {{Informative|<tt>"BIS_fnc_"</tt> prefix is reserved and cannot be used.}} | |p2= prefix: [[String]] - variable prefix {{Informative|<tt>"BIS_fnc_"</tt> prefix is reserved and cannot be used.}} | ||
|p3= nameVars: [[Array]] of [[String|Strings]] '''or''' [[Array]] of [[Array]] - list of variables to be declared. | |p3= nameVars: [[Array]] of [[String|Strings]] '''or''' [[Array]] of [[Array]] - list of variables to be declared. | ||
* [[Array]] of [[String|Strings]] to format [variable, variable, …] - final variable is <tt>prefix + variable</tt>, loaded from <tt>path + variable + ".sqf"</tt> | * [[Array]] of [[String|Strings]] to format [variable, variable, …] - final variable is <tt>prefix + variable</tt>, loaded from <tt>path + variable + ".sqf"</tt> | ||
* [[Array]] of [[Array]] to format [<nowiki/>[variable, fileName], [variable, fileName], …] - final variable is <tt>prefix + variable</tt>, loaded from <tt>path + fileName + ".sqf"</tt> | * [[Array]] of [[Array]] to format [<nowiki/>[variable, fileName], [variable, fileName], …] - final variable is <tt>prefix + variable</tt>, loaded from <tt>path + fileName + ".sqf"</tt> | ||
|p4= global: [[Boolean]] - [[true]] for global persistent execution on all clients | |p4= global: [[Boolean]] - [[true]] for global persistent execution on all clients | ||
| [[Boolean]] - [[true]] when done | | [[Boolean]] - [[true]] when done | ||
|x1= <code>["scripts\myDir\", "MY_fnc_", ["script1", "script2"], [[true]]] [[call]] [[BIS_fnc_loadFunctions]];</code> | |x1= <code>["scripts\myDir\", "MY_fnc_", ["script1", "script2"], [[true]]] [[call]] [[BIS_fnc_loadFunctions]];</code> | ||
|x2= <code>["scripts\myDir\", "MY_fnc_", [["script1", "script1file"], ["script2", "script2file"]], [[false]]] [[call]] [[BIS_fnc_loadFunctions]];</code> | |x2= <code>["scripts\myDir\", "MY_fnc_", [["script1", "script1file"], ["script2", "script2file"]], [[false]]] [[call]] [[BIS_fnc_loadFunctions]];</code> | ||
| [[compile]], [[compileFinal]], [[preprocessFileLineNumbers]] | | [[compile]], [[compileFinal]], [[preprocessFileLineNumbers]] | ||
}} | }} | ||
Revision as of 23:10, 17 January 2021
Description
- Description:
- Compile scripts and save them into globally available functions. Defines _fnc_scriptName variable.
- Execution:
- call
- Groups:
- Diagnostic
Syntax
- Syntax:
- [fileDirectory, prefix, nameVars, global] call BIS_fnc_loadFunctions
- Parameters:
- fileDirectory: String - script path
- prefix: String - variable prefix
- nameVars: Array of Strings or Array of Array - list of variables to be declared.
- global: Boolean - true for global persistent execution on all clients
- Return Value:
- Boolean - true when done
Examples
- Example 1:
["scripts\myDir\", "MY_fnc_", ["script1", "script2"], true] call BIS_fnc_loadFunctions;
- Example 2:
["scripts\myDir\", "MY_fnc_", [["script1", "script1file"], ["script2", "script2file"]], false] call BIS_fnc_loadFunctions;
Additional Information
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