Modding:Encounters and Population: Difference between revisions

Jump to navigation Jump to search
add dynamic table example
(add dynamic table example)
Line 56: Line 56:
}
}
</syntaxhighlight>
</syntaxhighlight>
== Dynamic Tables ==
The game sometimes uses dynamically generated population tables, which are constructed from objects in ObjectBlueprints.xml.
For example, <code>XRL.World.Parts.PsionicDervish</code> may select an object from the <code>DynamicInheritsTable:BaseLongBlade:Tier5</code>, <code>DynamicInheritsTable:BaseLongBlade:Tier7</code>, or <code>DynamicInheritsTable:BaseLongBlade:Tier9</code> tables depending on the type of dervish. This table will select any item that inherits from "BaseLongBlade" as long as it does not have the <code>ExcludeFromDynamicEncounters</code> tag. For dynamic tables of this type with a tier, the game will strongly weight items of the specified tier, but items of other tiers can also be selected.
For example, <code>DynamicInheritsTable:BaseLongBlade:Tier5</code> will give a weight of 1000 to items of the specified tier, a weight of 100 to items one tier above or below that, a weight of 10 to items two tiers above or below that, and a weight of 1 to all other items. This results in a population table being constructed by the game similar to the following:
{| class="wikitable"
! Item
! Weight
|-
| {{favilink id|Long Sword}}
| 1
|-
| {{favilink id|Two-Handed Sword}}
| 1
|-
| {{favilink id|Long Sword2}}
| 1
|-
| {{favilink id|Long Sword2th}}
| 1
|-
| {{favilink id|Steel Long Sword}}
| 1
|-
| {{favilink id|Steel Long Swordth}}
| 1
|-
| {{favilink id|Long Sword3}}
| 10
|-
| {{favilink id|Long Sword3th}}
| 10
|-
| {{favilink id|Long Sword4}}
| 100
|-
| {{favilink id|Long Sword4th}}
| 100
|-
| {{favilink id|Long Sword5}}
| 1000
|-
| {{favilink id|Long Sword5th}}
| 1000
|-
| {{favilink id|Long Sword6}}
| 100
|-
| {{favilink id|Long Sword6th}}
| 100
|-
| {{favilink id|Long Sword7}}
| 10
|-
| {{favilink id|Long Sword7th}}
| 10
|-
| {{favilink id|Long Sword8}}
| 1
|-
| {{favilink id|Long Sword8th}}
| 1
|-
| {{favilink id|Vibro Blade}}
| 1000
|}


{{Modding Navbox}}
{{Modding Navbox}}

Navigation menu