Defining Zones?

Started by Fluff_Thorrent, May 01, 2016, 07:03:05 AM

Previous topic - Next topic

Fluff_Thorrent

Hi!

I'm looking for some help in defining a new type of zone, with a certain affordance (for a custom terrain). I can't seem to find any files in "Defs" that handle those. Are they defined within some .dll?

1000101

You need to write a new Zone class and add a designator to define it.

Although for A12, you can look at latta's "No Cleaning Please" mod which does this exact thing.  This will at least give you point of reference.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

Fluff_Thorrent

Quote from: 1000101 on May 02, 2016, 05:17:58 PM
You need to write a new Zone class and add a designator to define it.

Although for A12, you can look at latta's "No Cleaning Please" mod which does this exact thing.  This will at least give you point of reference.
Thanks! I'll have a look :)

CastAway

That mod was not updated for a while and also requires CCL to work. I am thinking to make a similar one for A16 and without depending on CCL. At the moment I am trying to add two zone designators to zone category and so far managed only to replace existing ones. How does one extend that list? Preferably using C# only? I looked at how CCL does injections but cannot make it to work in my mod:


var designator = (Designator) Activator.CreateInstance(
GenTypes.GetTypeInAnyAssembly( "MyMod.MyZoneDesignatorClass" ) );

DefDatabase<DesignationCategoryDef>.GetNamed("Zone", true )
.resolvedDesignators.Add( designator );