modParams: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(perks)
m (Some wiki formatting)
 
(45 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Command|=
{{RV|type=command
____________________________________________________________________________________________
 
|arma3 |= Game
|game1= arma3
|1.62|= Game Version
|version1= 1.62
|arg=  |= Multiplayer Arguments
 
|eff= |= Multiplayer Effects
|gr1= Mods and Addons
____________________________________________________________________________________________
 
| Returns list of mod parameters according to given options, values are in same order as the given options. Available options:  
|descr= Returns list of mod parameters according to given options, values are in same order as the given options.
* <tt>"name"</tt>: [[String]] - name to be shown (Arma 3 instead of A3, etc.)
 
* <tt>"picture"</tt>: [[String]] - picture shown in Mod Launcher
|s1= [[modParams]] [modClass, options]
* <tt>"logo"</tt>: [[String]] -  logo to be shown in Main Menu
 
* <tt>"logoOver"</tt>: [[String]] - logo to be shown in Main Menu when mouse is over
|p1= modClass: [[String]] - mod classname
* <tt>"logoSmall"</tt>: [[String]] - small version of logo, prepared for drawing small icons
 
* <tt>"tooltip"</tt>: [[String]] - tooltip to be shown on mouse over  
|p2= options: [[Array]] of [[String]]s - can be: <spoiler>
* <tt>"tooltipOwned"</tt>: [[String]] - tooltip to be shown on mouse over the icon when DLC is owned by player
{{{!}} class="wikitable"
* <tt>"action"</tt>: [[String]] - url to be triggered when mod button is clicked
! Option
* <tt>"actionName"</tt>: [[String]] - what to put on Action Button
! [[:Category:Data Types|Data Type]]
* <tt>"overview"</tt>: [[String]] - overview text visible in expansion menu
! Description
* <tt>"hidePicture"</tt>: [[Boolean]] - do not show mod picture icon in the main menu mod list
{{!}}-
* <tt>"hideName"</tt>: [[Boolean]] - do not show mod name in the main menu mod list
{{!}} {{hl|"name"}}
* <tt>"defaultMod"</tt>: [[Boolean]] - default mods cannot be moved or disabled by Mod Launcher
{{!}} [[String]]
* <tt>"serverOnly"</tt>: [[Boolean]] - mod doesn't have to be installed on client in order to play on server with this mod running
{{!}} Name to be shown (Arma 3 instead of A3, etc.)
* <tt>"active"</tt>: [[Boolean]] - active mod (activated through command line or stored in profile by mod launcher)  
{{!}}-
'''NOTE''' that this command doesn't actually tell you if the mod is running for real or pretend to be running.
{{!}} {{hl|"picture"}}
|= Description
{{!}} [[String]]
____________________________________________________________________________________________
{{!}} Picture shown in Mod Launcher
| [[modParams]] [modClass, options] |= Syntax
{{!}}-
|p1= [modClass, options]: [[Array]]|=
{{!}} {{hl|"logo"}}
|p2= modClass: [[String]] - class name of the mod |= Parameter 1
{{!}} [[String]]
|p3= options: [[Array]] - see description |= Parameter 2
{{!}} Logo to be shown in Main Menu
| [[Array]] - retrieved requested data on success or empty array [] |= Return Value
{{!}}-
|x1= <code>_data = [[modParams]] ["Kart", ["name", "logo", "picture"]];</code> |= Example 1
{{!}} {{hl|"logoOver"}}
| [[configSourceModList]], [[configSourceMod]] |= See Also
{{!}} [[String]]
{{!}} Logo to be shown in Main Menu when mouse is over
{{!}}-
{{!}} {{hl|"logoSmall"}}
{{!}} [[String]]
{{!}} Small version of logo, prepared for drawing small icons
{{!}}-
{{!}} {{hl|"tooltip"}}
{{!}} [[String]]
{{!}} Tooltip to be shown on mouse over  
{{!}}-
{{!}} {{hl|"tooltipOwned"}}
{{!}} [[String]]
{{!}} Tooltip to be shown on mouse over the icon when DLC is owned by player
{{!}}-
{{!}} {{hl|"action"}}
{{!}} [[String]]
{{!}} URL to be triggered when mod button is clicked
{{!}}-
{{!}} {{hl|"actionName"}}
{{!}} [[String]]
{{!}} What to put on Action Button
{{!}}-
{{!}} {{hl|"overview"}}
{{!}} [[String]]
{{!}} Overview text visible in expansion menu
{{!}}-
{{!}} {{hl|"hidePicture"}}
{{!}} [[Boolean]]
{{!}} Do not show mod picture icon in the main menu mod list
{{!}}-
{{!}} {{hl|"hideName"}}
{{!}} [[Boolean]]
{{!}} Do not show mod name in the main menu mod list
{{!}}-
{{!}} {{hl|"defaultMod"}}
{{!}} [[Boolean]]
{{!}} Default mods cannot be moved or disabled by Mod Launcher
{{!}}-
{{!}} {{hl|"serverOnly"}}
{{!}} [[Boolean]]
{{!}} Mod does not have to be installed on client in order to play on server with this mod running
{{!}}-
{{!}} {{hl|"active"}}
{{!}} [[Boolean]]
{{!}} Active mod (activated through command line or stored in profile by mod launcher)
{{Feature|important|Note that {{hl|"active"}} does not actually tell if a mod is actually running.}}
{{!}}}
</spoiler>
 
|r1= [[Array]] - retrieved requested data on success or empty array {{hl|[]}}
 
|x1= <sqf>_data = modParams ["Kart", ["name", "logo", "picture"]];</sqf>
 
|seealso= [[configSourceModList]] [[configSourceMod]]
}}
}}


<dl class='command_description'>
{{Note
<!-- BEGIN Note Section -->
|user= Killzone_Kid
<!-- For example:
|timestamp= 20170424212500
<dd class='notedate'>Posted on Month Day, Year - Time (UTC)</dd>
|text= This command used to spam .[[rpt]] when queried mod didn't exist, making it little awkward to use for testing if mod is active. For example:
<dt class='note'>'''[[User:User Name|User Name]]'''</dt>
<sqf>_superDuperModEnabled = modParams ["super_duper", ["active"]] param [0, false];</sqf>
<dd class='note'>This is an example note. It is true and verifiable, and contains a little code snippet.
Since v1.69 the command would fail silently if mod didn't exist, but would still log .rpt error if the mod name passed to the command was empty or there was an error processing one of the passed options.
<code>[[if]] ([[_this]] == anExample) [[then]] { [[hint]] Leave it here for others to read; };</code></dd>
}}
-->
<!-- END Note Section -->
</dl>


<h3 style='display:none'>Bottom Section</h3>
{{Note
<!-- Appropriate categories go here -->
|user= heyoxe
|timestamp= 20210226164200
|text= For each value, it will first read the value from the {{hl|mod.cpp}} file, if the value is not in it (or the files does not exist), it will try to read it from the {{hl|CfgMods}} entry as long as it has the '''exact''' same name. If you try to get {{hl|"name"}} and the command cannot find it in either of those locations, it will return the same value as the {{hl|modClass}} input.<br>
In practice, this means that content from user mods will always be read from {{hl|mod.cpp}} and never from the {{hl|CfgMods}}.
}}


[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
{{Note
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
|user= mikero
 
|timestamp= 20211007162117
<!-- CONTINUE Notes -->
|text= Later versions of PboProject and its friends with arma as the intended engine, will '''never''' allow a cfgmods to appear in a pbo. Instead, it will scribble it out to a mod.cpp in the mods\ folder that this pbo was intended for.
<dl class="command_description">
}}
<dd class="notedate">Posted on April 24, 2017 - 21:25 (UTC)</dd>
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
<dd class="note">This command used to spam .[[rpt]] when queried mod didn't exist, making it little awkward to use for testing if mod is active. For example:
<code>_superDuperModEnabled = [[modParams]] ["super_duper", ["active"]] param [0, false];</code>
Since v1.69 the command would fail silently if mod doesn't exist.
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 17:04, 27 July 2022

Hover & click on the images for description

Description

Description:
Returns list of mod parameters according to given options, values are in same order as the given options.
Groups:
Mods and Addons

Syntax

Syntax:
modParams [modClass, options]
Parameters:
modClass: String - mod classname
options: Array of Strings - can be:
Option Data Type Description
"name" String Name to be shown (Arma 3 instead of A3, etc.)
"picture" String Picture shown in Mod Launcher
"logo" String Logo to be shown in Main Menu
"logoOver" String Logo to be shown in Main Menu when mouse is over
"logoSmall" String Small version of logo, prepared for drawing small icons
"tooltip" String Tooltip to be shown on mouse over
"tooltipOwned" String Tooltip to be shown on mouse over the icon when DLC is owned by player
"action" String URL to be triggered when mod button is clicked
"actionName" String What to put on Action Button
"overview" String Overview text visible in expansion menu
"hidePicture" Boolean Do not show mod picture icon in the main menu mod list
"hideName" Boolean Do not show mod name in the main menu mod list
"defaultMod" Boolean Default mods cannot be moved or disabled by Mod Launcher
"serverOnly" Boolean Mod does not have to be installed on client in order to play on server with this mod running
"active" Boolean Active mod (activated through command line or stored in profile by mod launcher)
Note that "active" does not actually tell if a mod is actually running.
↑ Back to spoiler's top
Return Value:
Array - retrieved requested data on success or empty array []

Examples

Example 1:
_data = modParams ["Kart", ["name", "logo", "picture"]];

Additional Information

See also:
configSourceModList configSourceMod

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
Killzone_Kid - c
Posted on Apr 24, 2017 - 21:25 (UTC)
This command used to spam .rpt when queried mod didn't exist, making it little awkward to use for testing if mod is active. For example:
_superDuperModEnabled = modParams ["super_duper", ["active"]] param [0, false];
Since v1.69 the command would fail silently if mod didn't exist, but would still log .rpt error if the mod name passed to the command was empty or there was an error processing one of the passed options.
heyoxe - c
Posted on Feb 26, 2021 - 16:42 (UTC)
For each value, it will first read the value from the mod.cpp file, if the value is not in it (or the files does not exist), it will try to read it from the CfgMods entry as long as it has the exact same name. If you try to get "name" and the command cannot find it in either of those locations, it will return the same value as the modClass input.
In practice, this means that content from user mods will always be read from mod.cpp and never from the CfgMods.
mikero - c
Posted on Oct 07, 2021 - 16:21 (UTC)
Later versions of PboProject and its friends with arma as the intended engine, will never allow a cfgmods to appear in a pbo. Instead, it will scribble it out to a mod.cpp in the mods\ folder that this pbo was intended for.