Trained shooter Custom trait. (Help)

Started by adtrl, December 19, 2016, 11:41:34 AM

Previous topic - Next topic

adtrl

So I made my trait. It worked, then an update came and wiped it. Now I'm unable to make it work again. So below is the tid-bit, let me know what I need to do to make it work. (If I need to add more, all you need to do is ask.)

     <Li>
       <label>Trained-shooter</label>
        <description>NAME trained to shoot faster and to the hit the target.</description>
        <commonality>0.7</commonality>
       <degree>5</degree>
       <statOffsets>
         <AimingDelayFactor>-0.9</AimingDelayFactor>
         <ShootingAccuracy>0.90</ShootingAccuracy>
       </statOffsets>
       <skillGains>
         <li>
           <key>Shooting</key>
          <value>5</value>
         </Li>
       </skillGains>
     </Li>   
Rawr ^.=.^

joaonunes

Quote from: adtrl on December 19, 2016, 11:41:34 AM
So I made my trait. It worked, then an update came and wiped it. Now I'm unable to make it work again. So below is the tid-bit, let me know what I need to do to make it work. (If I need to add more, all you need to do is ask.)

     <Li>
       <label>Trained-shooter</label>
        <description>NAME trained to shoot faster and to the hit the target.</description>
        <commonality>0.7</commonality>
       <degree>5</degree>
       <statOffsets>
         <AimingDelayFactor>-0.9</AimingDelayFactor>
         <ShootingAccuracy>0.90</ShootingAccuracy>
       </statOffsets>
       <skillGains>
         <li>
           <key>Shooting</key>
          <value>5</value>
         </Li>
       </skillGains>
     </Li>   


Check the source code of the game to see which tags were changed, that's pretty much the standard procedure after an update, to see what has changed in order to be able to adapt the code/xml files.

May I ask why did you make that trait?
Do you want your colonists to look manlier?
Get a free mustache sample here!

adtrl

Quote from: joaonunes on December 19, 2016, 03:16:19 PM
Quote from: adtrl on December 19, 2016, 11:41:34 AM
So I made my trait. It worked, then an update came and wiped it. Now I'm unable to make it work again. So below is the tid-bit, let me know what I need to do to make it work. (If I need to add more, all you need to do is ask.)

     <Li>
       <label>Trained-shooter</label>
        <description>NAME trained to shoot faster and to the hit the target.</description>
        <commonality>0.7</commonality>
       <degree>5</degree>
       <statOffsets>
         <AimingDelayFactor>-0.9</AimingDelayFactor>
         <ShootingAccuracy>0.90</ShootingAccuracy>
       </statOffsets>
       <skillGains>
         <li>
           <key>Shooting</key>
          <value>5</value>
         </Li>
       </skillGains>
     </Li>   


Check the source code of the game to see which tags were changed, that's pretty much the standard procedure after an update, to see what has changed in order to be able to adapt the code/xml files.

May I ask why did you make that trait?

Where would I find the source code? I made this trait for use in my games for people who shoot faster but can hit their target.
Rawr ^.=.^

joaonunes

Quote from: adtrl on December 19, 2016, 06:05:52 PM
Where would I find the source code? I made this trait for use in my games for people who shoot faster but can hit their target.

You may find it inside the directory "../Rimworld/mods/Core/" followed by the folder where traits are stored, in your case.
Have you checked the "Expanded Traits" mod? It adds a lot of traits and possibly even a couple of ones that do exactly what you want (called Rookie, Veteran, Commando, etc...). If you do not want to use that mod at least use it as a guideline to what you must do to your file. Hope that helps
Do you want your colonists to look manlier?
Get a free mustache sample here!

adtrl

#4
Quote from: joaonunes on December 19, 2016, 09:30:33 PM
Quote from: adtrl on December 19, 2016, 06:05:52 PM
Where would I find the source code? I made this trait for use in my games for people who shoot faster but can hit their target.

You may find it inside the directory "../Rimworld/mods/Core/" followed by the folder where traits are stored, in your case.
Have you checked the "Expanded Traits" mod? It adds a lot of traits and possibly even a couple of ones that do exactly what you want (called Rookie, Veteran, Commando, etc...). If you do not want to use that mod at least use it as a guideline to what you must do to your file. Hope that helps

Thanks. I did what you said and I'm not sure what to look for, everything seems the same.

As for the mod, never heard of it till now.
Rawr ^.=.^

joaonunes

Quote from: adtrl on December 20, 2016, 06:53:37 AM
Thanks. I did what you said and I'm not sure what to look for, everything seems the same.

As for the mod, never heard of it till now.

Expanded Traits <<---- Here you go :D

This has been taken from one of his traits:

        <TraitDef>
<defName>Veteran</defName>
<commonality>0.30</commonality>
<degreeDatas>
<li>
<label>veteran</label>
<description>NAME has seen HIS fair share of battle, and lives to tell the tale.</description>
<statFactors>
<MeleeHitChance>1.20</MeleeHitChance>
</statFactors>
<statOffsets>
<AimingDelayFactor>-0.20</AimingDelayFactor>
<ShootingAccuracy>0.15</ShootingAccuracy>
</statOffsets>
<skillGains>
<li>
<key>Melee</key>
<value>3</value>
</li>
<li>
<key>Shooting</key>
<value>3</value>
</li>
</skillGains>
</li>
</degreeDatas>
<conflictingTraits>
<li>Rookie</li>
<li>Novice</li>
<li>Elite</li>
<li>Commando</li>
<li>Trooper</li>
<li>Psychopath</li>
</conflictingTraits>
<requiredWorkTags>
<li>Violent</li>
</requiredWorkTags>
</TraitDef>


This should be the basic structure of your config
Do you want your colonists to look manlier?
Get a free mustache sample here!

adtrl

Rawr ^.=.^