Ludeon Forums

RimWorld => Mods => Help => Topic started by: Kirid on March 12, 2014, 05:50:22 AM

Title: Hedges xml
Post by: Kirid on March 12, 2014, 05:50:22 AM
This mod works for the most part, and I want to fix it before I post it
<ThingDef ParentName="BuildingBase">
<defName>Hedge</defName>
<eType>Wall</eType>
<label>Hedge</label>
<thingClass>Building</thingClass>
<linkDrawerType>Basic</linkDrawerType>
<blueprintTexturePath>Things/Building/Linked/Wall_Blueprint_Atlas</blueprintTexturePath>
<texturePath>Things/Building/Linked/Hedge_Atlas</texturePath>
<menuIconPath>Things/Building/Linked/Hedge_MenuIcon</menuIconPath>
-<linkFlags>
<li>Hedge</li>
</linkFlags>

This code isn't working, getting an error
     Tried to load data
                     -into type Thingdef that does not have a matching field
             Exception parsing <li>Hedge</li> to type Linkflags: Exception parsing Linkflags from "Hedge"

Other buildings and walls seem to have their linkflags set as the def name. Power Conduits and sandbags are examples that linkflag to their own defname.
If I change Hedge to Wall, they will connect to each other and to walls, but that leads me to think etype defines Linkflags.  :-\
Any ideas?
      
Title: Re: Hedges xml
Post by: Darker on March 12, 2014, 06:21:20 AM
Unfortunately, link flags seem to be hardcoded information, rather than a thing definition refference:

public enum LinkFlags
{
None = 0,
Wall = 1,
Sandbags = 2,
Rock = 4,
Minerals = 8,
PowerConduit = 16,
MapEdge = 32
}

The names are the same, yes but it's a different thing. In fact, the link flags you see are reffering to this enumerator.
Title: Re: Hedges xml
Post by: Kirid on March 12, 2014, 06:33:31 AM
Hmmm, well thank you. I guess I'll just hope we can edit that later. I've hooked the hedges to only attach to sandbags, and coded them similar, they are basically recolored sandbags. At least the two probably wont be built next to each other much Need to fix the texture a bit then I'll upload a version so anyone who wants to can try them.

edit It works fine now except it still gives an error in the dev log
Tried to load data.
              -into type ThingDef that does not have a matching field

My other mod does this too, not sure what is wrong, both function fine.
Pre-Screenshot, before another round of tweaking the texture

[attachment deleted by admin: too old]