RimWorld

RimWorld

Children, school and learning
Dylan  [developer] 16 Mar, 2020 @ 9:28am
Alien Children Backstories
Originally posted by Ryflamer:
Ah unfortunately C# remains outside of my skillset so I'm not able to do anything about it.

In regards to alien children working for their bodyaddons/draw scale I know that Alien races currently adds a drawscale field to adjust the size of races.
Might be worth looking into if you can just use a fraction of whatever default drawscale for the race upon birth, and slowly scale it up to their default upon adulthood.

As for the backstory solution I -think- CnP had it so the child pawns of alien races were created if a pawnkind was made for them specifically where it could draw the pawn's specific values and in this case the backstory. If you were to go that route modders could just patch in a child pawnkind that would xpath detect children, and spawn backstories according to that pawnkind.

If you want anymore insight as to the specific HAR xml functionality let me know as I mess with it a fair bit. As well as I'd be interesting in trying to find a solution with whatever pleb XML knowledge I have

I have seen that drawcale thing, but I haven't been able to mess with it from my side yet - maybe even worth for me to just ask over at the AlienFramework side when I get into it again.

I had a quick look at it, do you mean the
<backstoryCategories> <li>ChjAndroid</li> </backstoryCategories>
part in "PawnKindDef" and then have a AlienRace.BackstoryDef for the childhood? (Like the Androids-Race seems to have) I could possibly just parse those childhood backstories for a specific defName ending like "_born" or something
Last edited by Dylan; 16 Mar, 2020 @ 9:33am
< >
Showing 1-9 of 9 comments
Ryflamer 16 Mar, 2020 @ 12:00pm 
Hmm I may have mis-remembered as I'm not seeing reference to what I had thought they had done with pawnkinds previously. The idea I can think of that'd be fairly easy for modders to implement from either your side or the race creators, would just be to create a baby pawnkind with appropriate age and backstory and it'd use that for baby pawns. Could be something as simple as detecting child at the end eg WoW_BloodElf_Child or something of that sort like you had mentioned. In case it's easier to talk on discord feel free to hit me up Ryflamer#0175
Dylan  [developer] 16 Mar, 2020 @ 4:08pm 
I have just updated the mod and included a basic way for the backstory to work (I think)

I tested it with the Android AlienRace:

<AlienRace.BackstoryDef> <defName>ChJAndroid_Child_Colony_NewbornCSL</defName> <title>born model</title> <titleShort>Basic</titleShort> <baseDescription>[PAWN_nameDef] was born!</baseDescription> <bodyTypeMale>Male</bodyTypeMale> <bodyTypeFemale>Female</bodyTypeFemale> <slot>Childhood</slot> <spawnCategories> <li>DontSpawnThisEver</li> </spawnCategories> <skillGains> <li> <defName>Social</defName> <amount>5</amount> </li> </skillGains> </AlienRace.BackstoryDef>

The defName of the backstory has to be the race-name + "_Child_Colony_NewbornCSL"

<PawnKindDef ParentName="BasePlayerPawnKind"> <defName>ChjAndroidColonist</defName> <label>android colonist</label> <race>ChjAndroid</race>

I included this part because otherwise the backstory does not seem to be loaded by the AlienRace framework (But I think if you would add a base-game backstory with the defName it would be ok)
<spawnCategories> <li>DontSpawnThisEver</li> </spawnCategories>

let me know if this works for you
Last edited by Dylan; 16 Mar, 2020 @ 4:09pm
Dylan  [developer] 16 Mar, 2020 @ 4:38pm 
You should see something like the following in the log (mod-option in my mod "Log debug info messages" must be on)

Children: Birth: AlienRace detected! Special color settings set! Children: Birth: FindCustomBackstory: Trying to find custom backstory for: ChjAndroid with name: ChjAndroid_Child_Colony_NewbornCSL Children: Birth: FindCustomBackstory: Found backstory: ChJAndroid_Child_Colony_NewbornCSL - born model Children: Birth: Backstory set to: ChJAndroid_Child_Colony_NewbornCSL Children: Birth: BackstorySkillBonus: Custom backstory loaded Children: Birth: BackstorySkillBonus: Custom backstory has skillGains Children: Birth: BackstorySkillBonus: Social from 0 to 5 ...
Ryflamer 18 Mar, 2020 @ 2:53am 
Yep managed to setup a patch for an initial race to test and all seems to work fine upon forcing a birth upon that race. Debug window also gave the log mentioned above. To any race modders looking to do the same that incorporate addons with backstories I have an example patch listed below.

https://hastebin.com/riyikigubo.js
Dylan  [developer] 18 Mar, 2020 @ 10:35am 
Originally posted by Ryflamer:
Yep managed to setup a patch for an initial race to test...

Nice ^^ could be that it needs some expanding in the future (maybe different ones depending on the life-stage the child is born in or something)
divineDerivative 26 Mar, 2020 @ 4:14pm 
My race has forced hediffs in their backstories which don't show up when a child is born. Do you know of a way I could apply the hediffs after the child is born?
Dylan  [developer] 26 Mar, 2020 @ 4:19pm 
Originally posted by divineDerivative:
My race has forced hediffs in their backstories which don't show up when a child is born. Do you know of a way I could apply the hediffs after the child is born?

Do you have an example file? Maybe I need to do something on my end
divineDerivative 26 Mar, 2020 @ 5:40pm 
it's a node inside AlienRace.BackstoryDef
<forcedHediffs> <li>NoReproductionWarrior</li> <li>RaksuraNoFoodPoisoning</li> </forcedHediffs>
Dylan  [developer] 27 Mar, 2020 @ 11:23am 
Originally posted by divineDerivative:
it's a node inside AlienRace.BackstoryDef

ah OK, so it is not like the skill or traits a base-game thing, that makes it a bit harder, but I will see if I can get to it.

(The forced traits from the backstory would need to be added aswell I think)
< >
Showing 1-9 of 9 comments
Per page: 1530 50