<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://community.bistudio.com/wiki?action=history&amp;feed=atom&amp;title=Arma_Reforger%3AScripting_Conf_File_Usage</id>
	<title>Arma Reforger:Scripting Conf File Usage - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://community.bistudio.com/wiki?action=history&amp;feed=atom&amp;title=Arma_Reforger%3AScripting_Conf_File_Usage"/>
	<link rel="alternate" type="text/html" href="https://community.bistudio.com/wiki?title=Arma_Reforger:Scripting_Conf_File_Usage&amp;action=history"/>
	<updated>2026-05-22T08:54:12Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.0</generator>
	<entry>
		<id>https://community.bistudio.com/wiki?title=Arma_Reforger:Scripting_Conf_File_Usage&amp;diff=370976&amp;oldid=prev</id>
		<title>Lou Montana: Text replacement - &quot;\{\{GameCategory\|armaR\|Modding\|(Guidelines|Tutorials)\|([^=&amp;#8629;]*)\}\}&quot; to &quot;{{GameCategory|armaR|Modding|$2|$1}}&quot;</title>
		<link rel="alternate" type="text/html" href="https://community.bistudio.com/wiki?title=Arma_Reforger:Scripting_Conf_File_Usage&amp;diff=370976&amp;oldid=prev"/>
		<updated>2025-02-26T12:32:01Z</updated>

		<summary type="html">&lt;p&gt;Text replacement - &amp;quot;\{\{GameCategory\|armaR\|Modding\|(Guidelines|Tutorials)\|([^=↵]*)\}\}&amp;quot; to &amp;quot;{{GameCategory|armaR|Modding|$2|$1}}&amp;quot;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:32, 26 February 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l94&quot;&gt;Line 94:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 94:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{GameCategory|armaR|Modding|Tutorials&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|Scripting&lt;/del&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{GameCategory|armaR|Modding&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|Scripting&lt;/ins&gt;|Tutorials}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lou Montana</name></author>
	</entry>
	<entry>
		<id>https://community.bistudio.com/wiki?title=Arma_Reforger:Scripting_Conf_File_Usage&amp;diff=341826&amp;oldid=prev</id>
		<title>Lou Montana: Page creation</title>
		<link rel="alternate" type="text/html" href="https://community.bistudio.com/wiki?title=Arma_Reforger:Scripting_Conf_File_Usage&amp;diff=341826&amp;oldid=prev"/>
		<updated>2023-06-27T18:34:15Z</updated>

		<summary type="html">&lt;p&gt;Page creation&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Sometimes, a {{hl|.conf}} file can be useful in order to store multiple settings/values that would otherwise be flooding a class' member variables.&lt;br /&gt;
&lt;br /&gt;
Two main approaches exist to refer to a {{hl|.conf}} file:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! {{Link|#ResourceName Approach}}&lt;br /&gt;
! {{Link|#Object Approach}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* {{Icon|checked}} a default value is possible&lt;br /&gt;
* {{Icon|unchecked}} Big setup&lt;br /&gt;
* {{Icon|unchecked}} No data preview&lt;br /&gt;
|&lt;br /&gt;
* {{Icon|checked}} Quick setup&lt;br /&gt;
* {{Icon|checked}} Data preview and creation on the fly&lt;br /&gt;
* {{Icon|unchecked}} a default value is not possible&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following examples assume a {{hl|.conf}} file is to be used in a custom entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;enforce&amp;gt;&lt;br /&gt;
[EntityEditorProps(category: &amp;quot;GameScripted/Misc&amp;quot;)]&lt;br /&gt;
class SCR_ExampleEntityClass : GenericEntityClass&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class SCR_ExampleEntity : GenericEntity&lt;br /&gt;
{&lt;br /&gt;
	// config will be used here&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/enforce&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ResourceName Approach ==&lt;br /&gt;
&lt;br /&gt;
The simplest course of action is to target the wanted {{hl|.conf}} file with a {{hl|ResourceName}} path:&lt;br /&gt;
&amp;lt;enforce&amp;gt;&lt;br /&gt;
class SCR_ExampleEntity : GenericEntity&lt;br /&gt;
{&lt;br /&gt;
	protected ResourceName m_sConfig = &amp;quot;{EAD206A79A774696}Configs/EntityCatalog/FactionLess/EntityCatalog_Characters.conf&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/enforce&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A proper way to make things easy is to have this property as an attribute:&lt;br /&gt;
&amp;lt;enforce&amp;gt;&lt;br /&gt;
class SCR_ExampleEntity : GenericEntity&lt;br /&gt;
{&lt;br /&gt;
	[Attribute(defvalue: &amp;quot;{EAD206A79A774696}Configs/EntityCatalog/FactionLess/EntityCatalog_Characters.conf&amp;quot;, params: &amp;quot;conf&amp;quot;)]&lt;br /&gt;
	protected ResourceName m_sConfig;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/enforce&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, ''any'' config file can be used. This is not what is wanted here. Hopefully, the Attribute can be made to target the specific config type we want:&lt;br /&gt;
&amp;lt;enforce&amp;gt;&lt;br /&gt;
class SCR_ExampleEntity : GenericEntity&lt;br /&gt;
{&lt;br /&gt;
	[Attribute(defvalue: &amp;quot;{EAD206A79A774696}Configs/EntityCatalog/FactionLess/EntityCatalog_Characters.conf&amp;quot;, params: &amp;quot;conf class=SCR_EntityCatalogMultiList&amp;quot;)]&lt;br /&gt;
	protected ResourceName m_sConfig;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/enforce&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this done, the entity now either has a ''path'' to a config, or an empty path. Remains here to ''load'' this config, cast it to make sure of its content - requiring a dedicated method:&lt;br /&gt;
&amp;lt;enforce&amp;gt;&lt;br /&gt;
class SCR_ExampleEntity : GenericEntity&lt;br /&gt;
{&lt;br /&gt;
	[Attribute(params: &amp;quot;conf&amp;quot;)]&lt;br /&gt;
	protected ResourceName m_sConfig = &amp;quot;{EAD206A79A774696}Configs/EntityCatalog/FactionLess/EntityCatalog_Characters.conf&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
	SCR_EntityCatalogMultiList LoadConfig()&lt;br /&gt;
	{&lt;br /&gt;
		if (m_sConfig.IsEmpty())&lt;br /&gt;
			return null;&lt;br /&gt;
&lt;br /&gt;
		Resource resource = Resource.Load(m_sConfig);&lt;br /&gt;
		if (!resource.IsValid())&lt;br /&gt;
			return null;&lt;br /&gt;
&lt;br /&gt;
		return SCR_EntityCatalogMultiList.Cast(BaseContainerTools.CreateInstanceFromContainer(resource.GetResource().ToBaseContainer()));&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/enforce&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Object Approach ==&lt;br /&gt;
&lt;br /&gt;
This way is faster to setup, but disallows a default value:&lt;br /&gt;
&amp;lt;enforce&amp;gt;&lt;br /&gt;
class SCR_ExampleEntity : GenericEntity&lt;br /&gt;
{&lt;br /&gt;
	[Attribute()]&lt;br /&gt;
	protected ref SCR_EntityCatalogMultiList m_Config;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/enforce&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method makes the Config field void of any data, but allows to either click the &amp;quot;set class&amp;quot; button to '''create''' a config on the fly or to '''drag and drop''' a {{hl|.conf}} file to fill the field instantly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{GameCategory|armaR|Modding|Tutorials|Scripting}}&lt;/div&gt;</summary>
		<author><name>Lou Montana</name></author>
	</entry>
</feed>