Help giving a custom alien race verbs from royalty apparel.

Started by PM_ME_NAKED_SINGULARITIES, September 12, 2020, 10:49:27 PM

Previous topic - Next topic

PM_ME_NAKED_SINGULARITIES

Unfortunately I am just beginning my journey into programming and modding and I've been messing around with various verb extender frameworks but haven't had any luck so far. I'm looking to give certain alien races access to the new royalty apparel abilities like the jump pack and shield deployment as innate abilities for said alien race. Any and all advice is greatly appreciated!

RawCode

what about just giving pawn that specific verb?

without any frameworks

PM_ME_NAKED_SINGULARITIES

Should I use a Hediff for that, or would I need to edit the assembly?

RawCode

well, pawns have innate verbs, like melee attack, have you checked pawn defs?

PM_ME_NAKED_SINGULARITIES

Not yet but that makes a lot of sense! In case my lack of skill wasn't obvious enough. But to add a new verb for a specific type of pawn (ie a custom race) would the verbs be defined in the .dll or an xml file? (Thank you so much for helping my dumbass)

RawCode

if not yet, then please check pawn defs.

defs are stored in XML files, there are hardcoded defs in code, but this is not case, hardcoded defs called "implied defs"

PM_ME_NAKED_SINGULARITIES

Ok So i tried copy/pasting the comps and verb defs in the pawnkinds.xml and I get this error on startup: XML error: <comps><li Class="CompProperties_Reloadable"><maxCharges>5</maxCharges><ammoDef>Chemfuel</ammoDef><ammoCountPerCharge>20</ammoCountPerCharge><baseReloadTicks>60</baseReloadTicks><soundReload>Standard_Reload</soundReload><hotKey>Misc4</hotKey><chargeNoun>jump</chargeNoun><displayGizmoWhileUndrafted>false</displayGizmoWhileUndrafted></li></comps> doesn't correspond to any field in type PawnKindDef. Context: <PawnKindDef ParentName="BasePlayerPawnKind"><race>Android5Tier</race><combatPower>30</combatPower><isFighter>false</isFighter><apparelIgnoreSeasons>true</apparelIgnoreSeasons><forceNormalGearQuality>true</forceNormalGearQuality><defName>AndroidT5Colonist</defName><label>T5 Android Colonist</label><backstoryFiltersOverride><li><categories><li>TranscendantBackstory</li></categories></li></backstoryFiltersOverride><defaultFactionType>PlayerColonyAndroid</defaultFactionType><chemicalAddictionChance>0.00</chemicalAddictionChance><techHediffsMoney><min>2000</min><max>10000</max></techHediffsMoney><techHediffsTags><li>secret</li></techHediffsTags><techHediffsChance>0.1</techHediffsChance><backstoryCryptosleepCommonality>0</backstoryCryptosleepCommonality><comps><li Class="CompProperties_Reloadable"><maxCharges>5</maxCharges><ammoDef>Chemfuel</ammoDef><ammoCountPerCharge>20</ammoCountPerCharge><baseReloadTicks>60</baseReloadTicks><soundReload>Standard_Reload</soundReload><hotKey>Misc4</hotKey><chargeNoun>jump</chargeNoun><displayGizmoWhileUndrafted>false</displayGizmoWhileUndrafted></li></comps><verbs><li><verbClass>Verb_Jump</verbClass><label>jump</label><violent>false</violent><hasStandardCommand>true</hasStandardCommand><onlyManualCast>True</onlyManualCast><forceNormalTimeSpeed>false</forceNormalTimeSpeed><warmupTime>0.5</warmupTime><warmupEffecter>JumpWarmupEffect</warmupEffecter><requireLineOfSight>true</requireLineOfSight><targetParams><canTargetLocations>true</canTargetLocations><canTargetPawns>false</canTargetPawns><canTargetBuildings>false</canTargetBuildings></targetParams></li></verbs></PawnKindDef>

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

XML error: <verbs><li><verbClass>Verb_Jump</verbClass><label>jump</label><violent>false</violent><hasStandardCommand>true</hasStandardCommand><onlyManualCast>True</onlyManualCast><forceNormalTimeSpeed>false</forceNormalTimeSpeed><warmupTime>0.5</warmupTime><warmupEffecter>JumpWarmupEffect</warmupEffecter><requireLineOfSight>true</requireLineOfSight><targetParams><canTargetLocations>true</canTargetLocations><canTargetPawns>false</canTargetPawns><canTargetBuildings>false</canTargetBuildings></targetParams></li></verbs> doesn't correspond to any field in type PawnKindDef. Context: <PawnKindDef ParentName="BasePlayerPawnKind"><race>Android5Tier</race><combatPower>30</combatPower><isFighter>false</isFighter><apparelIgnoreSeasons>true</apparelIgnoreSeasons><forceNormalGearQuality>true</forceNormalGearQuality><defName>AndroidT5Colonist</defName><label>T5 Android Colonist</label><backstoryFiltersOverride><li><categories><li>TranscendantBackstory</li></categories></li></backstoryFiltersOverride><defaultFactionType>PlayerColonyAndroid</defaultFactionType><chemicalAddictionChance>0.00</chemicalAddictionChance><techHediffsMoney><min>2000</min><max>10000</max></techHediffsMoney><techHediffsTags><li>secret</li></techHediffsTags><techHediffsChance>0.1</techHediffsChance><backstoryCryptosleepCommonality>0</backstoryCryptosleepCommonality><comps><li Class="CompProperties_Reloadable"><maxCharges>5</maxCharges><ammoDef>Chemfuel</ammoDef><ammoCountPerCharge>20</ammoCountPerCharge><baseReloadTicks>60</baseReloadTicks><soundReload>Standard_Reload</soundReload><hotKey>Misc4</hotKey><chargeNoun>jump</chargeNoun><displayGizmoWhileUndrafted>false</displayGizmoWhileUndrafted></li></comps><verbs><li><verbClass>Verb_Jump</verbClass><label>jump</label><violent>false</violent><hasStandardCommand>true</hasStandardCommand><onlyManualCast>True</onlyManualCast><forceNormalTimeSpeed>false</forceNormalTimeSpeed><warmupTime>0.5</warmupTime><warmupEffecter>JumpWarmupEffect</warmupEffecter><requireLineOfSight>true</requireLineOfSight><targetParams><canTargetLocations>true</canTargetLocations><canTargetPawns>false</canTargetPawns><canTargetBuildings>false</canTargetBuildings></targetParams></li></verbs></PawnKindDef>

RawCode

it will be somewhat reasonable to post both your custom XMLs and complete logfile as files, not copypaste of random location.

PM_ME_NAKED_SINGULARITIES

While this isn't a direct answer to your question i've tried some other methods. While I've been doing some more testing, one of the biggest blockers I've noticed is that the verbs defined by the royalty apparel like <verbClass>Verb_Jump</verbClass>, and <verbClass>Verb_DeployBroadshield</verbClass> seem to need the comp <li Class="CompProperties_Reloadable">
        <maxCharges>1</maxCharges>
        <destroyOnEmpty>true</destroyOnEmpty>
        <soundReload>Standard_Reload</soundReload>
        <hotKey>Misc4</hotKey>
        <chargeNoun>shield</chargeNoun>
        <displayGizmoWhileUndrafted>false</displayGizmoWhileUndrafted>
      </li>
or something similar for the jetpack, etc. Everytime I try to remove this comp the utility stops working and I am at a loss as to what I could replace it with, because my goal is to remove the need for charges/reloading all together. Any advice? Again thanks for the help!

LWM

If your C# is strong, you could always make a derived class of the comp, and make it auto-reload?  I don't know if it would solve the problem (you clearly have a better grasp than I) but it's a thought?