Custom RaidStrategyDef

Started by Vindar, May 28, 2017, 04:38:49 PM

Previous topic - Next topic

Vindar

Anyone know how to make a custom RaidStrategyDef that doesn't affect other mods / the core files?

best i've been able to come up with is if you put

  <RaidStrategyDef Abstract="True">

than core and other mods wont be able to access it, but the problem w/ that is it also disappears for the mod in question.

Their is also the possibility of using the defpatching in combination w/ <disallowedStrategies> to remove the raid strategy from the core and any other mod after the fact, but that really feels clunky and like it's bound to go wrong.

am i missing something obvious here? or is my best bet the <disallowedStrategies> & defpatching combo?

I guess what i'm trying to ask is, is their an allowed strategies or something i can use in the <FactionDef>,     <pawnGroupMakers>, that will specify the use of a specific  RaidStrategyDef  before it gets tossed out w/ the deload by the abstract clause?

sorry if this question is confusing, tried to make it simple >.>;;;


jamaicancastle

Looking at the basic faction defs, they have flags for both <canSiege> and <canStageAttacks> that appear to enable those types of raids for those factions, while not causing any errors if they aren't present. (That is, the tribal faction, which can't siege, lacks a <canSiege> line at all rather than having one set to false.)

So you should be able to dig up the code that refers to these two attributes, and add a third one that works similarly, allowing your new strategy if and only if the faction has the right attribute set to true. This shouldn't cause any errors with factions that don't have that attribute at all, which would presumably include all vanilla factions and any factions from other mods (and you could patch in if you wanted specific other factions to have it).

minimurgle

Allow me to explain abstracts to you.

Say you have thought about a raid, or for this example a gun. This would be it's parent the abstract. if you look at the ThingDef for a gun you'll notice it has a parent listed. But those parents aren't in the game because they're abstract.

Now you have the actual raid, or again a gun. Except this time it's the actual ThingDef for the gun. This isn't abstract therefor it doesn't appear in the game. You'll notice raids don't carry the abstract tag because they are actual ingame thigs.


As for actually making a custom raid I can't help you too much hear because as far as I've looked most of it is c#. But I can say that you shouldn't need patching. As long as you don't modify the core files and add a completely new def for the raid you should be good.
Don't mind the questions. I'm probably just confused.

O Negative

From what I can tell, if you want a raid strategy to spawn a certain group of pawns, you're going to have to change the list of disallowed strategies in the pawn group makers found in the faction defs.

Otherwise, your new raid strategy is available as an option for any and all factions, with the use of any and all "normal" pawn group makers.

There isn't really an "allowed" version of the "disallowed" list. I think that's what you were asking? I hope that helps...