<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://www.polymorph.games/foundation/modding/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://www.polymorph.games/foundation/modding/feed.php">
        <title>Foundation - Modding Documentation - guides</title>
        <description></description>
        <link>https://www.polymorph.games/foundation/modding/</link>
        <image rdf:resource="https://www.polymorph.games/foundation/modding/_media/wiki/dokuwiki.svg" />
       <dc:date>2026-04-20T11:02:08+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://www.polymorph.games/foundation/modding/guides/2-scales-in-a-building?rev=1614099337&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.polymorph.games/foundation/modding/guides/checklist-for-platform-collider?rev=1614099308&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.polymorph.games/foundation/modding/guides/checklist-for-worker-path?rev=1616017038&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.polymorph.games/foundation/modding/guides/compute-water-elevation?rev=1614099168&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.polymorph.games/foundation/modding/guides/options_for_workplace?rev=1614099367&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.polymorph.games/foundation/modding/guides/proximity-trigger?rev=1614099914&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.polymorph.games/foundation/modding/guides/random_doors_and_windows?rev=1614099383&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.polymorph.games/foundation/modding/guides/tips-on-quaternion?rev=1614099438&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://www.polymorph.games/foundation/modding/_media/wiki/dokuwiki.svg">
        <title>Foundation - Modding Documentation</title>
        <link>https://www.polymorph.games/foundation/modding/</link>
        <url>https://www.polymorph.games/foundation/modding/_media/wiki/dokuwiki.svg</url>
    </image>
    <item rdf:about="https://www.polymorph.games/foundation/modding/guides/2-scales-in-a-building?rev=1614099337&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-02-23T16:55:37+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>2-scales-in-a-building</title>
        <link>https://www.polymorph.games/foundation/modding/guides/2-scales-in-a-building?rev=1614099337&amp;do=diff</link>
        <description>Having 2 Scales on the same Building

The following code is an example of 2 scales for the same building


-- Register the primary root part
myMod:register({
    DataType = &quot;BUILDING_PART&quot;,
    Id = &quot;MY_PRIMARY_ROOT_PART&quot;,
    Mover = { DataType = &quot;BUILDING_PART_MOVER_INSTANCE&quot; },
    ConstructorData = {
        DataType = &quot;BUILDING_CONSTRUCTOR_SCALER&quot;,
	CoreObjectPrefab = &quot;MY_PRIMARY_ROOT_PREFAB&quot;,
	EndPart = &quot;MY_SECONDARY_ROOT_PART&quot;,
        FillerList = {
            &quot;MY_PRIMARY_TILING3_PART&quot;,…</description>
    </item>
    <item rdf:about="https://www.polymorph.games/foundation/modding/guides/checklist-for-platform-collider?rev=1614099308&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-02-23T16:55:08+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>checklist-for-platform-collider</title>
        <link>https://www.polymorph.games/foundation/modding/guides/checklist-for-platform-collider?rev=1614099308&amp;do=diff</link>
        <description>Adding Platform Collider to a Building

The Example02 contains a platform-collider: a mesh over the ground on which the villagers can climb and walk.

Once your building is well displayed in game, here is a simple check list to be sure you didn&#039;t forget something about the collider:</description>
    </item>
    <item rdf:about="https://www.polymorph.games/foundation/modding/guides/checklist-for-worker-path?rev=1616017038&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-03-17T21:37:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>checklist-for-worker-path</title>
        <link>https://www.polymorph.games/foundation/modding/guides/checklist-for-worker-path?rev=1616017038&amp;do=diff</link>
        <description>Defining Building&#039;s Worker Path

You can choose a path for a worker when he is going to his workplace.

This path is defined by path points. These are locators under MAYA set in the fbx under the buildingPart of the workplace. 

Once your building is well displayed in game, here is a simple check list to be sure you didn&#039;t forget something about the path:</description>
    </item>
    <item rdf:about="https://www.polymorph.games/foundation/modding/guides/compute-water-elevation?rev=1614099168&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-02-23T16:52:48+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>compute-water-elevation</title>
        <link>https://www.polymorph.games/foundation/modding/guides/compute-water-elevation?rev=1614099168&amp;do=diff</link>
        <description>Custom Component: Computing Ground or Water Elevation

The following LUA code computes and returns the global Y elevation of water from a global position:

 
function MY_CUSTOM_COMPONENT:computeWaterElevation(_globalPosition)
    local raycastResult = {}
 
    -- Raycast from the _globalPosition + 1000
    -- to _globalPosition - 1000
    -- only on objects with a WATER flag
    local FromPosition = { _globalPosition[1], _globalPosition[2]+1000, _globalPosition[3] }
    local ToPosition = { _glo…</description>
    </item>
    <item rdf:about="https://www.polymorph.games/foundation/modding/guides/options_for_workplace?rev=1614099367&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-02-23T16:56:07+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>options_for_workplace</title>
        <link>https://www.polymorph.games/foundation/modding/guides/options_for_workplace?rev=1614099367&amp;do=diff</link>
        <description>Options for Workplaces

Basics

This is an example of a simple workplace MY_BUILDING with a worker of job MY_BUILDING_JOB producing MY_BUILDING_OUTPUT_RESOURCE from MY_BUILDING_INPUT_RESOURCE:


    myMod:register({
        DataType = &quot;BUILDING_PART&quot;,
        Id = &quot;MY_BUILDING_PART&quot;,
        Mover = { DataType = &quot;BUILDING_PART_MOVER_INSTANCE&quot; },
        ConstructorData = {
            DataType = &quot;BUILDING_CONSTRUCTOR_DEFAULT&quot;,
            CoreObjectPrefab = &quot;MY_BUILDING_PREFAB&quot;
        },
      …</description>
    </item>
    <item rdf:about="https://www.polymorph.games/foundation/modding/guides/proximity-trigger?rev=1614099914&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-02-23T17:05:14+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>proximity-trigger</title>
        <link>https://www.polymorph.games/foundation/modding/guides/proximity-trigger?rev=1614099914&amp;do=diff</link>
        <description>Custom Component: Proximity Trigger


local COMP_PROXIMITY_TRIGGER = {
	TypeName = &quot;COMP_PROXIMITY_TRIGGER&quot;,
	ParentType = &quot;COMPONENT&quot;,
	Properties = {}
}

function COMP_PROXIMITY_TRIGGER:update()
    -- Position of the Prefab the component is assigned to
    local pos1 = self:getOwner():getGlobalPosition()
    
    -- Using COMP_AGENT to include non-villagers too like the Envoy
    self:getLevel():getComponentManager(&quot;COMP_AGENT&quot;):getAllComponent():forEach(
        function(comp)
            --…</description>
    </item>
    <item rdf:about="https://www.polymorph.games/foundation/modding/guides/random_doors_and_windows?rev=1614099383&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-02-23T16:56:23+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>random_doors_and_windows</title>
        <link>https://www.polymorph.games/foundation/modding/guides/random_doors_and_windows?rev=1614099383&amp;do=diff</link>
        <description>How to Randomly set Doors and Windows on a Building

Here is an example of a building (myBuilding) with randomly set door (3 models) and windows (2 models):


-- Apply building asset processor
    myMod:registerAssetProcessor(&quot;models/myFbxName.fbx&quot;, {
        DataType = &quot;BUILDING_ASSET_PROCESSOR&quot;
    })
 
-- Register prefab nodes
    myMod:registerAssetId(&quot;models/myFbxName.fbx/Prefab/myBuildingPart&quot;, &quot;MY_BUILDING_PREFAB&quot;)

-- Register the assemblage part
    myMod:register({
        DataType = &quot;…</description>
    </item>
    <item rdf:about="https://www.polymorph.games/foundation/modding/guides/tips-on-quaternion?rev=1614099438&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-02-23T16:57:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>tips-on-quaternion</title>
        <link>https://www.polymorph.games/foundation/modding/guides/tips-on-quaternion?rev=1614099438&amp;do=diff</link>
        <description>Tips on Quaternions

Since 1.5, Foundation allows to mod Custom component and links it to a fbx (see Exemple02) 

Assuming the local axis Y of the building is vertical (most cases),
a way to compute the cosinus (named cosp) and sinus (named sinp) of the rotation angle of the building around the vertical is the following:</description>
    </item>
</rdf:RDF>
