Is it possible to do these things yet? (Faction related)

Started by Andouce, May 18, 2015, 01:22:44 PM

Previous topic - Next topic

Andouce

Hi there everyone,

Currently I am in the process of making a mod which adds a new faction among various clothing and weapons etc.

I have custom backstories thanks to the mod. The question I have is is it possible to set multiple "backstory categories" or make your own for a faction?

So that the pawns that spawn, use specific backstories?

All of my custom pawns have the line of code shown below except with a custom tag for each pawn (Up to 9) which is linked within all my custom backstories. So in theory it is all linked except that in game they still spawn with all civil backgrounds.

(<backstoryCategory>MC</backstoryCategory>) - Within pawn def

So this means it is linked to the second piece of code within the faction def perhaps?
So if that is the case how would I make this category reflect multiple custom tags ? :P
(Line of code in question <backstoryCategory>Civil</backstoryCategory>) - Faction def

As it stands currently I want each pawn for my faction to be unique to a backstory for example

The medic pawn would spawn with my custom backstory for medic and only that one.

Currently this is the only thing that is annoying me with my work lol. Only thing left to attempt before I release it basically. Would appreciate any feedback for those more experienced or even Tyan.

Thanks again,

Andouce

Adamiks

I don't think there is a way to do this without dll's. I've tried to make something like this:
<backstoryCategory>
<li>Tribal</li>
<li>Civil</li>
</backstoryCategory>

Result - my game just crashed.

And something like this:
<backstoryCategory>Civil</backstoryCategory>
<backstoryCategory>Tribal</backstoryCategory>

Result - error pop-up and game just ignored Def.

1000101

Take a look at mipen's Mechanical Defense 2.  The droids all have custom backstories which is set in dll code.  If you take a look, these are the droids you are looking for.
(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

mipen

Are you using BackstoriesCore to add the backstories? If you are, in the <spawnCategories> tag in the BackstoryDef, the entries are strings. This means you can add your own tags.
I'm not sure what the difference between the FactionDef backstoryCategory and the PawnKindDef backstoryCategory is, but they are both strings. I would recommend trying the same tag in both of these, so make a faction with backstoryCategory = TestTag, and a pawnkinddef with backstoryCategory = TestTag. Then add <li>TestTag</li> to the spawnCategories for your backstory def. Test it in game and see if they get the backstory. I would recommend having two or more backstories with TestTag in the spawnCategories for both childhood and adulthood, as the game sometimes errors out if it can't find enough backstories. If it works and your new pawns get the backstories, then try changing the backstoryCategory inside the pawnkinddef to something new and adding some backstories with that new category tag. If that works, then you can make a bunch of pawnkinddefs using the same faction but with a different backstoryCategory. I don't think anyone else has tried this so it will likely be a lot of trial and error :) Good luck!

Andouce

Thanks guys, I shall have a look and see what I can do.

@Mipen, I am indeed using your mod and have done what you suggest in terms of the backstory category but I will look into it at a later date.

EDIT: Another question for those more experienced.

When making custom faction, what does the "selection weight" value represent?

Is it the higher the value the more likely it will spawn that pawn or lower or something?

Shinzy

Quote from: Andouce on May 20, 2015, 12:26:08 PMEDIT: Another question for those more experienced.

When making custom faction, what does the "selection weight" value represent?

Is it the higher the value the more likely it will spawn that pawn or lower or something?

if you look at the vanilla factions
like pirates for instance! you can see the selection weight on stuff like those heavy weapon raiders is really low compared to the others
So based on that I'm pretty sure the higher the value the more likely they're gna be selected

Andouce

Thanks Shinzy. That is what I was assuming but wanted to confirm it. Is most likely correct theory though. Well, I am further testing this mod of mine, hopefully I can actually get those backstories to work too with my pawns.

I think the issue is the faction backstory category determines what the faction pawns backstories are as opposed to the pawn backstory category. It is like it overrides it or something idk. But I love trial and error, it is what makes modding partially more enjoyable! tweaks tweaks, and more tweaks! :P