Modding:Conversations: Difference between revisions

138 bytes removed ,  22:44, 18 February 2022
m
Remove beta disclaimer
(Add 203.14 predicates)
m (Remove beta disclaimer)
Line 57: Line 57:


=== Merging ===
=== Merging ===
{{Betamoddingcontent}}
If multiple elements with the same <code>ID</code> are defined within the same scope, a merge will occur by default where the properties of the later element overwrite the former.<br />
If multiple elements with the same <code>ID</code> are defined within the same scope, a merge will occur by default where the properties of the later element overwrite the former.<br />
If an explicit ID isn't defined, one will be created based on other attributes.<br/>
If an explicit ID isn't defined, one will be created based on other attributes.<br/>
Line 81: Line 80:


=== Inheritance ===
=== Inheritance ===
{{Betamoddingcontent}}
In cases where you'd like your elements to appear in multiple places, you can inherit their properties with the <code>Inherits</code> attribute.<br />
In cases where you'd like your elements to appear in multiple places, you can inherit their properties with the <code>Inherits</code> attribute.<br />
The attribute can also take a comma separated list, meaning you can inherit and merge the properties of multiple parent elements together.<br />
The attribute can also take a comma separated list, meaning you can inherit and merge the properties of multiple parent elements together.<br />
Line 109: Line 107:


=== Distribution ===
=== Distribution ===
{{Betamoddingcontent}}
An alternative to explicitly inheriting elements where you'd like them repeated is distribution, where you specify directly on the element where it should propagate.<br/>
An alternative to explicitly inheriting elements where you'd like them repeated is distribution, where you specify directly on the element where it should propagate.<br/>
The <code>Distribute</code> attribute normally takes a list of element types, but if <code>Qualifier="ID"</code> is specified, a list of IDs can be provided.<br/>
The <code>Distribute</code> attribute normally takes a list of element types, but if <code>Qualifier="ID"</code> is specified, a list of IDs can be provided.<br/>
Line 143: Line 140:


=== Custom Delegates ===
=== Custom Delegates ===
{{Betamoddingcontent}}
It's possible to add your own delegates for you to use in XML by adding a <code>[ConversationDelegate]</code> attribute to a static method in C#.<br/>
It's possible to add your own delegates for you to use in XML by adding a <code>[ConversationDelegate]</code> attribute to a static method in C#.<br/>
Depending on the return type it will either be registered as a predicate (bool) or action (void), and variants of the delegate will automatically be created.
Depending on the return type it will either be registered as a predicate (bool) or action (void), and variants of the delegate will automatically be created.
Line 166: Line 162:


== Parts ==
== Parts ==
{{Betamoddingcontent}}
For more advanced or specific logic not easily reduced to a generally accessible delegate, a custom part is preferred.<br/>
For more advanced or specific logic not easily reduced to a generally accessible delegate, a custom part is preferred.<br/>
Similar to their equivalent for objects in `ObjectBlueprints.xml`, parts define custom behaviour for elements within and can be attached to most any element just like delegates.<br/>
Similar to their equivalent for objects in `ObjectBlueprints.xml`, parts define custom behaviour for elements within and can be attached to most any element just like delegates.<br/>
Line 206: Line 201:


=== Events ===
=== Events ===
{{Betamoddingcontent}}
Conversations have their own set of events to handle, but should be immediately familiar to anyone that has tampered with the [[Modding:Events#Minimal_Events|Minimal Events]] of game objects.
Conversations have their own set of events to handle, but should be immediately familiar to anyone that has tampered with the [[Modding:Events#Minimal_Events|Minimal Events]] of game objects.