边缘世界 RimWorld

边缘世界 RimWorld

Children, school and learning
Dylan  [开发者] 2020 年 3 月 16 日 上午 9:28
Alien Children Backstories
引用自 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
最后由 Dylan 编辑于; 2020 年 3 月 16 日 上午 9:33
< >
正在显示第 1 - 9 条,共 9 条留言
Ryflamer 2020 年 3 月 16 日 下午 12:00 
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  [开发者] 2020 年 3 月 16 日 下午 4:08 
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
最后由 Dylan 编辑于; 2020 年 3 月 16 日 下午 4:09
Dylan  [开发者] 2020 年 3 月 16 日 下午 4:38 
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 2020 年 3 月 18 日 上午 2:53 
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  [开发者] 2020 年 3 月 18 日 上午 10:35 
引用自 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 2020 年 3 月 26 日 下午 4:14 
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  [开发者] 2020 年 3 月 26 日 下午 4:19 
引用自 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 2020 年 3 月 26 日 下午 5:40 
it's a node inside AlienRace.BackstoryDef
<forcedHediffs> <li>NoReproductionWarrior</li> <li>RaksuraNoFoodPoisoning</li> </forcedHediffs>
Dylan  [开发者] 2020 年 3 月 27 日 上午 11:23 
引用自 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)
< >
正在显示第 1 - 9 条,共 9 条留言
每页显示数: 1530 50