Giter Club home page Giter Club logo

jecstools's Introduction

JecsTools

v1.0.9.1 Documentation Support me on Patreon.

Adds modding components to RimWorld: vehicles, spell casting, weapon slots, oversized weapons, and more!


Note to players: This mod will not change your game, but rather it lets modders do more, so you can have an even more amazing RimWorld experience.

Note to modders: This mod contains components that allow you to do many new and different things in RimWorld. Check out RoxxPloxx's guide for more info here: https://github.com/roxxploxx/RimWorldModGuide/wiki

Total list of components:

CompAbilityUser

  • Adds spell/ability casting to humanlikes.

CompActivatableEffect

  • Adds an activation graphic for weapons (e.g. lightsaber beam).

CompDeflector

  • Allows the ability to knock projectiles away with melee weapons.

CompExtraSounds

  • Adds extra melee sounds to weapons.

CompLumbering

  • Gives pawns a staggered walking animation that cycles between two images. (e.g. ATST walking effect)

CompOversizedWeapon

  • Allows weapons to have graphic sizes that can be bigger than RimWorld's vanilla limits.

CompSlotLoadable

  • Adds slots to objects, weapons, apparel, etc that can be filled to have effects. (e.g. an ammo slot for guns with different kinds of ammunition, crystal slots for lightsabers, etc)

CompVehicle (Experimental, Additions by Swenzi)

  • Allows for a pawn to be treated as a vehicle that can be loaded with pilots, gunners, crew, and passengers.

CompInstalledPart

  • Allows for a part to be installable and uninstallable onto another thing. This is particularly useful for vehicle weapons.

CompToggleDef (by Roxxploxx)

  • A situational Component that allows you to toggle the ThingDef of a selected Thing via a radio button menu. ex. Change a ring to be for a pinky finger versus a ring or index finger.

CompDelayedSpawner

  • Allows us to create things or pawns after a set amount of time. For instance, I created an invisible spawner for the Star Vampire (as of this update) that uses this CompDelayedSpawner. This lets me trigger the Star Vampire incident, drop down some delayed spawners, and enjoy results after a short period of time. The CompDelayedSpawner is highly customizable for things, pawns, and even allows for setting mental states and hediffs.

Total List of Classes

JecsTools.Hediff_TransformedPart

  • Similar to added part, however, transformed parts will not remove the original parts when removed from the character. This allows for us to "transform" pawn parts. Such as having a colonists' hands turn into deadly claws.

JecsTools.JobGiver_AIFirelessTrashColonyClose JecsTools.JobGiver_AIFirelessTrashColonyDistant

  • These classes lets us call a special jobgiver for raiders that does not include setting fire to objects. This is good for monstrous creatures that do not have the ability to start fires but still want to break things.

Additions by roxxploxx. Additions by Swenzi. Transpilers by Erdelf. Extensive hours of testing, debugging, and fixes by Xen. "Hey, should we make this into a public toolset for people to take advantage of all this cool stuff?" - Jecrell "Hell yes - this is awesome stuff - people will love it!" - Xen

Special thanks to Pardeike's amazing non-destructive patching library, Harmony. Without his work, none of this would be possible.

Harmony


Email: matt.walls31@gmail.com MIT License

jecstools's People

Contributors

alycecil avatar cbornholdt avatar deeprogger avatar erdelf avatar jecrell avatar lbmaian avatar mehni avatar proxyer avatar roxxploxx avatar rwpsychology avatar xenempireadmin avatar yliankuo avatar zhqu1148980644 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jecstools's Issues

B18 Vehicle carvans and drafting issues

When drafting a vehicle it will not move as ordered, generates no error. Hauling is working properly.

JecsTools 1.0.9.3
Rimworld 0.18.1722

When trying to carvan with a vehicle and attack another area, I get the following debug:

Unexpected culture: . Resetting to en-US.
Verse.Log:Warning(String)
Verse.Root:CheckGlobalInit()
Verse.Root:Start()
Verse.Root_Entry:Start()

Command line arguments: -logfile /tmp/rimworld_log
Verse.Log:Message(String)
Verse.Root:CheckGlobalInit()
Verse.Root:Start()
Verse.Root_Entry:Start()

RimWorld 0.18.1722 rev1210
Verse.Log:Message(String)
RimWorld.VersionControl:LogVersionNumber()
Verse.Root:CheckGlobalInit()
Verse.Root:Start()
Verse.Root_Entry:Start()

Config error in Truck: surgery bed requirement mismatch; flesh-type Mechanoid is False, recipe Vehicle_RepairsTruck is True
Verse.Log:Warning(String)
Verse.DefDatabase`1:ErrorCheckAllDefs()
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
Verse.GenGeneric:InvokeStaticMethodOnGenericType(Type, Type, String)
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:m__1()

Loading game from file Debug Map with mods Core, JecsTools-master, and Transports
Verse.Log:Message(String)
Verse.SavedGameLoader:LoadGameFromSaveFile(String)
Verse.Root_Play:m__0()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:m__1()

Tried to add Truck60857 to ThingOwner but this thing is already in another container. owner=Caravan Caravan 1 (tile=89004), current container owner=(Map-0-PlayerHome). Use TryAddOrTransfer, TryTransferToContainer, or remove the item before adding it.
Verse.Log:Warning(String)
Verse.ThingOwner1:TryAdd(Thing, Boolean) CompVehicle.HarmonyCompVehicle:AddVehiclePawnsToCaravan(Caravan, Pawn, Boolean) RimWorld.Planet.Caravan:AddPawn_Patch1(Object, Pawn, Boolean) RimWorld.Planet.CaravanMaker:MakeCaravan(IEnumerable1, Faction, Int32, Boolean)
RimWorld.Planet.CaravanExitMapUtility:ExitMapAndCreateCaravan(IEnumerable1, Faction, Int32) RimWorld.Planet.CaravanExitMapUtility:ExitMapAndCreateCaravan(IEnumerable1, Faction, Int32, Int32)
RimWorld.Planet.CaravanFormingUtility:FormAndCreateCaravan(IEnumerable1, Faction, Int32, Int32) RimWorld.LordJob_FormAndSendCaravan:SendCaravan() Verse.AI.Group.TransitionAction_Custom:DoAction(Transition) Verse.AI.Group.Transition:Execute(Lord) Verse.AI.Group.Transition:CheckSignal(Lord, TriggerSignal) Verse.AI.Group.Lord:CheckTransitionOnSignal(TriggerSignal) Verse.AI.Group.Lord:ReceiveMemo(String) RimWorld.GatherAnimalsAndSlavesForCaravanUtility:CheckArrived(Lord, IntVec3, String, Predicate1, Predicate`1)
RimWorld.LordToil_PrepareCaravan_Leave:LordToilTick()
Verse.AI.Group.Lord:LordTick()
Verse.AI.Group.LordManager:LordManagerTick()
Verse.Map:MapPostTick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()

Couldn't add pawn Truck60857 to caravan.
Verse.Log:Error(String)
CompVehicle.HarmonyCompVehicle:AddVehiclePawnsToCaravan(Caravan, Pawn, Boolean)
RimWorld.Planet.Caravan:AddPawn_Patch1(Object, Pawn, Boolean)
RimWorld.Planet.CaravanMaker:MakeCaravan(IEnumerable1, Faction, Int32, Boolean) RimWorld.Planet.CaravanExitMapUtility:ExitMapAndCreateCaravan(IEnumerable1, Faction, Int32)
RimWorld.Planet.CaravanExitMapUtility:ExitMapAndCreateCaravan(IEnumerable1, Faction, Int32, Int32) RimWorld.Planet.CaravanFormingUtility:FormAndCreateCaravan(IEnumerable1, Faction, Int32, Int32)
RimWorld.LordJob_FormAndSendCaravan:SendCaravan()
Verse.AI.Group.TransitionAction_Custom:DoAction(Transition)
Verse.AI.Group.Transition:Execute(Lord)
Verse.AI.Group.Transition:CheckSignal(Lord, TriggerSignal)
Verse.AI.Group.Lord:CheckTransitionOnSignal(TriggerSignal)
Verse.AI.Group.Lord:ReceiveMemo(String)
RimWorld.GatherAnimalsAndSlavesForCaravanUtility:CheckArrived(Lord, IntVec3, String, Predicate1, Predicate1)
RimWorld.LordToil_PrepareCaravan_Leave:LordToilTick()
Verse.AI.Group.Lord:LordTick()
Verse.AI.Group.LordManager:LordManagerTick()
Verse.Map:MapPostTick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()

System.NullReferenceException: Object reference not set to an instance of an object
at CompVehicle.CompVehicle.GeneratePawn (System.Collections.Generic.List`1<RimWorld.PawnGenOption>) <0x00251>
at CompVehicle.CompVehicle.ResolveFactionPilots () <0x001d7>
at CompVehicle.CompVehicle.CompTick () <0x00037>
at Verse.ThingWithComps.Tick () <0x00060>
at (wrapper dynamic-method) Verse.Pawn.Tick_Patch1 (object) <0x00084>
at RimWorld.Planet.WorldPawns.WorldPawnsTick () <0x000a6>
at RimWorld.Planet.World.WorldTick () <0x00021>
at Verse.TickManager.DoSingleTick () <0x00310>

Verse.Log:Error(String)
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()

JecsTools :: CaravanJobTracker :: JobTracker Created
Verse.Log:Message(String)
JecsTools.Caravan_JobTracker:.ctor(Caravan)
JecsTools.CaravanJobGiver:NullHandler(Caravan)
JecsTools.CaravanJobGiver:CurJob(Caravan)
JecsTools.HarmonyCaravanPatches:GetGizmos_Jobs(Caravan, IEnumerable1&) RimWorld.Planet.Caravan:GetGizmos_Patch1(Object) RimWorld.InspectGizmoGrid:DrawInspectGizmoGridFor(IEnumerable1)
RimWorld.Planet.WorldInspectPane:DrawInspectGizmos()
RimWorld.InspectPaneUtility:ExtraOnGUI(IInspectPane)
RimWorld.Planet.WorldInspectPane:ExtraOnGUI()
Verse.WindowStack:WindowStackOnGUI()
RimWorld.UIRoot_Play:UIRootOnGUI()
Verse.Root:OnGUI()

Exception from long event: System.ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
at System.Collections.Generic.List`1[Verse.Pawn].get_Item (Int32 index) [0x00000] in :0
at RimWorld.Planet.CaravanArrivalAction_AttackSettlement.DoArrivalAction (RimWorld.Planet.Caravan caravan) [0x00000] in :0
at RimWorld.Planet.CaravanArrivalAction_AttackSettlement+c__AnonStorey0.<>m__0 () [0x00000] in :0
at Verse.LongEventHandler.UpdateCurrentSynchronousEvent (System.Boolean& sceneChanged) [0x00000] in :0
Verse.Log:Error(String)
Verse.LongEventHandler:UpdateCurrentSynchronousEvent(Boolean&)
Verse.LongEventHandler:LongEventsUpdate(Boolean&)
Verse.Root:Update()
Verse.Root_Play:Update()

Not issues but some questions for help

Excuse me. i was translated Star War'mods into Chinese. it was almost done, but not perfect.
Some words was not display Chineseword.
How to solve it?I want to finish it more fully.

  1. Keyed\AbilityUser.xml and Keyed\CompDeflector.xml under JecsTools. The Force and Fully Functional Lightsabers\Languages. It was translated but useless.

some AbilityStats

image

Stats Tab(colonist)

image

Stats Tab(Weapons)

image

2.Keyed\SWSaber_English.xml and Keyed\CompSlotLoadable_Strings.xml under Fully Functional Lightsabers\Languages just like upstair

image

image

image

Low needs check

Hi Jec,

I feel like the Pawn, has left the vehicle due to low needs breaks immersion,
Would their be a way to remove this check so pawns with low needs can drive vehicles?

Cheers,
OneSmallCoin

Error when equipping shield if one is already equipped.

If I have a pawn with a shield equipped, and try to equip a different one, I get this error:

JobDriver threw exception in initAction for pawn Rogrum driver=JobDriver_Equip (toilIndex=1) driver.job=(Equip (Job_87) A=Thing_RH_TET_Dwarf_ShieldMid58557) lastJobGiver=Verse.AI.ThinkNode_QueuedJob
System.NullReferenceException: Object reference not set to an instance of an object
at PawnShields.HarmonyPatches.EquipmentTracker_GetPawn (object) <0x0001e>
at PawnShields.HarmonyPatches.Patch_Pawn_EquipmentTracker_MakeRoomFor (Verse.Pawn_EquipmentTracker,Verse.ThingWithComps&) <0x00092>
at (wrapper dynamic-method) Verse.Pawn_EquipmentTracker.MakeRoomFor_Patch1 (object,Verse.ThingWithComps) <0x00152>
at Verse.AI.JobDriver_Equip/c__Iterator0.<>m__0 () <0x000f9>
at Verse.AI.JobDriver.TryActuallyStartNextToil () <0x0071f>

Verse.Log:Error(String, Boolean)
Verse.AI.JobUtility:TryStartErrorRecoverJob(Pawn, String, Exception, JobDriver)
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:Notify_PatherArrived()
Verse.AI.Pawn_PathFollower:PatherArrived()
Verse.AI.Pawn_PathFollower:TryEnterNextPathCell()
Verse.AI.Pawn_PathFollower:PatherTick()
Verse.Pawn:Tick_Patch1(Object)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()

I traced it back through your source code, and here's the function that fails. The only thing that can be null there seems to be 'pawnField_Pawn_EquipmentTracker'.

        public static Pawn EquipmentTracker_GetPawn(object instance)
        {
            return (Pawn)pawnField_Pawn_EquipmentTracker.GetValue(instance);
        }

Is this a known issue? I don't see an open issue for it. Any thoughts?

Make Harmony IDs unique

Harmony IDs identify the mod that is patching the methods. They should be unique. Since this is a library that is potentially used by several mods, it is not ok to have the same ID hard coded within the library.

Suggestion: add support for a prefix that is combined with the internal IDs to make them unique.

PawnShield should not be instantiated automatically

The PawnShield class has a harmony attribute which will automatically instantiate it. As being a library, this mod should not actually affect the game. PawnShield class conflict with CombatExtended mod, install both 2 mods will make a pawn to block a damage twice( once for CE, once for PawnShield ).

JobDriver threw exception in initAction for pawn PJ_ForceGhostR2986

JobDriver threw exception in initAction for pawn PJ_ForceGhostR2986 driver=JobDriver_WaitMaintainPosture (toilIndex=0) driver.job=(Wait_MaintainPosture (Job_208)) lastJobGiver=null
System.NullReferenceException: Object reference not set to an instance of an object
  at Verse.AI.JobDriver_Wait.CheckForAutoAttack () [0x00000] in <filename unknown>:0 
  at Verse.AI.JobDriver_Wait+<MakeNewToils>c__Iterator0.<>m__0 () [0x00000] in <filename unknown>:0 
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00000] in <filename unknown>:0 
Verse.Log:Error(String, Boolean)
Verse.AI.JobUtility:TryStartErrorRecoverJob(Pawn, String, Exception, JobDriver)
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.Pawn_JobTracker:StartJob(Job, JobCondition, ThinkNode, Boolean, Boolean, ThinkTreeDef, Nullable`1, Boolean)
Verse.AI.Pawn_JobTracker:EndCurrentJob(JobCondition, Boolean)
Verse.AI.JobDriver:EndJobWith(JobCondition)
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:Notify_PatherArrived()
Verse.AI.Pawn_PathFollower:PatherArrived()
Verse.AI.Pawn_PathFollower:TryEnterNextPathCell()
Verse.AI.Pawn_PathFollower:PatherTick()
Verse.Pawn:Tick_Patch1(Object)
AbilityUser.PawnSummoned:Tick()
Verse.TickList:Tick_Patch2(Object)
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()

How to repro: summon Force Ghost with no hostiles on map. (I think! Came across this when testing something else.)

Factions change inside vehicle.

Steps: Caravan with vehicle travels to raider base. No colonist exits. Caravan returns to player base. The vehicle "unloads", but actually leaves pawn reference inside the vehicle. When leaving the map in a new caravan, the vehicle removes the copy and turns the colonist inside into having a random faction

Vehicle Thinkrees

I'm having some issues with Vehciles. They are working 90% but I am having issues with the thinktrees?
When you draft the pawn, you cannot undraft it and the options to load or unload the Vehicle dissapear. This is in 1.0.0 any pointers would be really appreciated

Here is a copy of my source code. Try the Truck, Hagglian or Tank by direct placing Tank Parts, Truck Parts, etc and assembling them with a pawn.

https://www.dropbox.com/s/7v8hbz67gzze695/shipsvehicles.zip?dl=0


JobDriver threw exception in initAction for pawn Hagglund3333 driver=JobDriver_Wait (toilIndex=0) driver.job=(Wait (Job_682868)) lastJobGiver=null
System.NullReferenceException: Object reference not set to an instance of an object
  at Verse.AI.JobDriver_Wait.CheckForAutoAttack () [0x00099] in C:\Dev\RimWorld\Assets\Scripts\Verse\AI\JobDrivers\Basics\JobDriver_Wait.cs:95 
  at Verse.AI.JobDriver_Wait+<MakeNewToils>c__Iterator0.<>m__0 () [0x00057] in C:\Dev\RimWorld\Assets\Scripts\Verse\AI\JobDrivers\Basics\JobDriver_Wait.cs:48 
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00214] in C:\Dev\RimWorld\Assets\Scripts\Verse\AI\JobDrivers\JobDriver.cs:455 
Verse.Log:Error(String, Boolean) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Debug\Log\Log.cs:78)
Verse.AI.JobUtility:TryStartErrorRecoverJob(Pawn, String, Exception, JobDriver) (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\JobUtility.cs:22)
Verse.AI.JobDriver:TryActuallyStartNextToil() (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\JobDrivers\JobDriver.cs:459)
Verse.AI.JobDriver:ReadyForNextToil() (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\JobDrivers\JobDriver.cs:363)
Verse.AI.Pawn_JobTracker:StartJob_Patch1(Object, Job, JobCondition, ThinkNode, Boolean, Boolean, ThinkTreeDef, Nullable`1, Boolean)
Verse.AI.JobUtility:TryStartErrorRecoverJob(Pawn, String, Exception, JobDriver) (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\JobUtility.cs:39)
Verse.AI.Pawn_JobTracker:FinalizeTick() (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\Pawn_JobTracker.cs:175)
Verse.AI.Pawn_JobTracker:JobTrackerTick() (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\Pawn_JobTracker.cs:146)
Verse.Pawn:Tick_Patch1(Object)
Verse.TickList:Tick() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Game\Ticking\TickList.cs:125)
Verse.TickManager:DoSingleTick() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Game\Ticking\TickManager.cs:297)
Verse.TickManager:TickManagerUpdate() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Game\Ticking\TickManager.cs:261)
Verse.Game:UpdatePlay() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Game\Game.cs:505)
Verse.Root_Play:Update() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\Root\Root_Play.cs:99)

An error occurred while starting an error recover job. We have to stop now to avoid infinite loops. This means that the pawn is now jobless which can cause further bugs. pawn=Hagglund3333
Verse.Log:Error(String, Boolean) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Debug\Log\Log.cs:78)


Unlimited Fuel with caravans

Found an issue with vehicles. They have unlimited fuel when in a caravan (world view). The code to look at is here in CompVehicle.cs

 //If it isn't moving than it shouldn't use fuel
                if ((this.Pawn.pather != null && !this.Pawn.pather.Moving) || (this.Pawn.GetCaravan() != null && (this.Pawn.GetCaravan().CantMove)))
                    compRefuelable.Props.fuelConsumptionRate = 0f;
                else
                    //If it's moving than it should use fuel
                    compRefuelable.Props.fuelConsumptionRate = this.fuelConsumptionRate;

Change to something like this to fix:

if ((this.Pawn.pather != null && this.Pawn.pather.Moving))
                    compRefuelable.Props.fuelConsumptionRate = this.fuelConsumptionRate;
                else if((this.Pawn.GetCaravan() != null && !this.Pawn.GetCaravan().Resting) && (this.Pawn.GetCaravan() != null && !this.Pawn.GetCaravan().CantMove))
                    compRefuelable.Props.fuelConsumptionRate = this.fuelConsumptionRate;
                else  //If it isn't moving than it shouldn't use fuel
                    compRefuelable.Props.fuelConsumptionRate = 0f;

1.0 What heddifs does my PawnKindDef need to made a vehicle drivable?

I have managed to get a vehicle pawn into the game and the character can enter the vehicle but it is still not derivable, any pointers or an example def would be a wonderful help, again Jec, thanks for the great mod and support here are my Pawndefs:
base:

  <ThingDef Name="Vehicle" Abstract="True">
    <thingClass>Pawn</thingClass>
    <category>Pawn</category>
    <selectable>true</selectable>
    <tickerType>Normal</tickerType>
    <altitudeLayer>Pawn</altitudeLayer>
    <useHitPoints>false</useHitPoints>
    <hasTooltip>true</hasTooltip>
    <soundImpactDefault>BulletImpactMetal</soundImpactDefault>
    <statBases>
      <Mass>70</Mass>
      <PsychicSensitivity>0</PsychicSensitivity>
      <ToxicSensitivity>0</ToxicSensitivity>
      <Flammability>0</Flammability>
      <ComfyTemperatureMin>-100</ComfyTemperatureMin>
      <ComfyTemperatureMax>250</ComfyTemperatureMax>
    </statBases>
    <race>
      <thinkTreeMain>CompVehicle_Simple</thinkTreeMain>
      <thinkTreeConstant>CompVehicle_SimpleConstant</thinkTreeConstant>
      <nameGenerator>NamerAnimalGenericMale</nameGenerator>
      <nameGeneratorFemale>NamerAnimalGenericFemale</nameGeneratorFemale>
      <manhunterOnDamageChance>0.0125</manhunterOnDamageChance>
      <manhunterOnTameFailChance>0.003</manhunterOnTameFailChance>
      <nameOnNuzzleChance>0.5</nameOnNuzzleChance>
      <fleshType>Mechanoid</fleshType>
      <needsRest>false</needsRest>
      <hasGenders>false</hasGenders>
      <foodType>None</foodType>
    </race>
    <inspectorTabs>
      <li>ITab_Pawn_Health</li>
      <li>ITab_Pawn_Needs</li>
      <li>ITab_Pawn_Character</li>
      <li>ITab_Pawn_Gear</li>
    </inspectorTabs>
    <comps>
      <li>
        <compClass>CompAttachBase</compClass>
      </li>
    </comps>
    <drawGUIOverlay>true</drawGUIOverlay>
  </ThingDef>
Pawn:
<?xml version="1.0" encoding="utf-8" ?>
<Defs>

  <ThingDef ParentName="Vehicle">
    <defName>Drone</defName>
    <label>Pickup Truck</label>
    <description>A Pickup Truck. Used to transport goods and personnel around the planet.</description>
    <statBases>
      <Flammability>0.2</Flammability>
      <MoveSpeed>7.5</MoveSpeed>
      <CarryingCapacity>500</CarryingCapacity>
      <ArmorRating_Blunt>0.1</ArmorRating_Blunt>
      <ArmorRating_Sharp>0.1</ArmorRating_Sharp>
      <MeatAmount>0</MeatAmount>
    </statBases>
    <race>
      <intelligence>ToolUser</intelligence>
      <thinkTreeMain>CompVehicle_Simple</thinkTreeMain>
      <thinkTreeConstant>CompVehicle_SimpleConstant</thinkTreeConstant>
      <body>Truck_Body</body>
      <baseBodySize>1.0</baseBodySize>
      <baseHealthScale>10</baseHealthScale>
      <lifeStageAges>
        <li>
          <def>MechanoidFullyFormed</def>
          <minAge>0</minAge>
          <soundWounded>BulletImpactMetal</soundWounded>
          <soundDeath>Explosion_Bomb</soundDeath>
          <soundCall>Vehicle_Idle</soundCall>
        </li>
      </lifeStageAges>
      <soundCallIntervalRange>
        <min>50</min>
        <max>50</max>
      </soundCallIntervalRange>
      <soundMeleeHitPawn>Pawn_Melee_MechanoidSlash_HitPawn</soundMeleeHitPawn>
      <soundMeleeHitBuilding>Pawn_Melee_MechanoidSlash_HitBuilding</soundMeleeHitBuilding>
      <soundMeleeMiss>Pawn_Melee_MechanoidSlash_Miss</soundMeleeMiss>
    </race>
    <recipes>
    </recipes>
    <!--
    <butcherProducts>
      <Steel>200</Steel>
	  <Chemfuel>600</Chemfuel>
      <Component>8</Component>
    </butcherProducts>
    -->
	<comps>
    <li Class="CompProperties_Flickable"/>
    <li Class="CompProperties_Breakdownable"/>
    <li Class="CompProperties_Refuelable">
      <fuelConsumptionRate>2.0</fuelConsumptionRate>
      <fuelCapacity>300.0</fuelCapacity>
      <fuelFilter>
        <thingDefs>
          <li>Chemfuel</li>
        </thingDefs>
      </fuelFilter>
      <consumeFuelOnlyWhenUsed>true</consumeFuelOnlyWhenUsed>
    </li>
	  <li Class="CompVehicle.CompProperties_Vehicle">
      <!--
      Vehicle Type determines how movements are calculated.
      Vehicle Types :
         Aircraft, AircraftAmphibious, AircraftSpace
         Amphibious, LandWheeled, LandHover, LandWalker,
         Sea, SeaSubmarine, SpaceOuter
      -->
      <vehicleType>LandWheeled</vehicleType>
      <!--
      Handler types determine if vehicles require a person to
      handle various aspects of the vehicle's functions.
      Handling Types :
         Incapable, HandlerRequired, NoHandlerRequired
      -->
      <movementHandling>HandlerRequired</movementHandling>
      <weaponHandling>HandlerRequired</weaponHandling>
      <manipulationHandling>NoHandlerRequired</manipulationHandling>
	  <!-- Determines how much a vehicle can carry -->
      <cargoCapacity>275</cargoCapacity>
      <!-- Unloads all passengers when health percent reaches below this percentage. -->
      <ejectIfBelowHealthPercent>0.2</ejectIfBelowHealthPercent>
      <!-- If a bullet hits a seat, the passenger is injured by this factor of damage. -->
      <seatHitDamageFactor>1.00</seatHitDamageFactor>
      <!-- Chance of doubling that damage. -->
      <seatHitCriticalHitChance>0.15</seatHitCriticalHitChance>
      <canBeDowned>true</canBeDowned>
      <canWiggleWhenDowned>false</canWiggleWhenDowned>
      <soundEntry>Pawn_Mech_Centipede_Wounded</soundEntry>
      <soundMoving />
      <soundEject>Pawn_Mech_Centipede_Wounded</soundEject>
      <labelUndamaged>Undamaged</labelUndamaged>
      <labelDamaged>Damaged</labelDamaged>
      <labelInoperable>Inoperable</labelInoperable>
      <labelBroken>Broken</labelBroken>
		<roles>
		  <li>
		    <label>driver seat</label>
  			<labelPlural>drivers</labelPlural>
	  		<handlingTypes>
				<li>Movement</li>
				<li>Weapons</li>
			</handlingTypes>
		  	<slots>3</slots>
		  	<slotsToOperate>1</slotsToOperate>
		  	<slotTag>DriverSeat1</slotTag>
		  </li>
		  <li>
		    <label>middle seat</label>
  			<labelPlural>passengers</labelPlural>
		  	<slots>3</slots>
		  	<slotsToOperate>1</slotsToOperate>
		  	<slotTag>DriverSeat2</slotTag>
		  </li>
		  <li>
		    <label>passenger seat</label>
  			<labelPlural>passengers</labelPlural>
		  	<slots>3</slots>
		  	<slotsToOperate>1</slotsToOperate>
		  	<slotTag>DriverSeat3</slotTag>
		  </li>
		</roles>
	  </li>
   </comps>
  </ThingDef>

	<PawnKindDef>
		<defName>Drone</defName>
		<label>Pickup Truck</label>
		<race>Drone</race>
		<combatPower>999999</combatPower>
		<aiAvoidCover>true</aiAvoidCover>
		<lifeStages>
			<li>
				<bodyGraphicData>
					<texPath>Things/Vehicles/Drone/Truck</texPath>
					<graphicClass>Graphic_Multi</graphicClass>
					<drawSize>4,4</drawSize>
				</bodyGraphicData>
			</li>
		</lifeStages>
		<weaponMoney>
			<min>0</min>
			<max>0</max>
		</weaponMoney>
		<weaponTags>
		</weaponTags>
	</PawnKindDef>

</Defs>

Body:

<?xml version="1.0" encoding="utf-8" ?>
<Defs>

  <BodyPartDef>
    <defName>Exterior_Thermometer</defName>
    <label>thermometer</label>
    <hitPoints>1</hitPoints>
    <oldInjuryBaseChance>0</oldInjuryBaseChance>
    <skinCovered>false</skinCovered>
    <isSolid>true</isSolid>
    <isAlive>false</isAlive>
    <frostbiteVulnerability>0.01</frostbiteVulnerability>
  </BodyPartDef>

  <BodyPartDef>
    <defName>Truck_Body</defName>
    <label>body</label>
    <hitPoints>70</hitPoints>
    <oldInjuryBaseChance>0</oldInjuryBaseChance>
    <skinCovered>false</skinCovered>
    <isSolid>true</isSolid>
    <isAlive>false</isAlive>
  </BodyPartDef>

  <BodyPartDef>
    <defName>Truck_Cabin</defName>
    <label>cabin</label>
    <hitPoints>40</hitPoints>
    <oldInjuryBaseChance>0</oldInjuryBaseChance>
    <skinCovered>false</skinCovered>
    <isSolid>true</isSolid>
    <isAlive>false</isAlive>
    <tags>
      <li>SightSource</li>
      <li>HearingSource</li>
      <li>ConsciousnessSource</li>
    <li>DriverSeat</li>
    <li>PassengerSeat</li>
    </tags>
  </BodyPartDef>

  <BodyPartDef>
   <defName>Truck_Engine</defName>
   <label>engine</label>
   <hitPoints>30</hitPoints>
   <oldInjuryBaseChance>0</oldInjuryBaseChance>
   <skinCovered>false</skinCovered>
   <isSolid>true</isSolid>
   <isAlive>false</isAlive>
   <tags>
     <li>BreathingPathway</li>
     <li>EatingPathway</li>
     <li>TalkingPathway</li>
   </tags>
  </BodyPartDef>

  <BodyPartDef>
    <defName>Truck_Transmission</defName>
    <label>transmission</label>
    <hitPoints>30</hitPoints>
    <oldInjuryBaseChance>0</oldInjuryBaseChance>
    <skinCovered>false</skinCovered>
    <isSolid>true</isSolid>
    <isAlive>false</isAlive>
    <tags>
    <li>ManipulationLimbCore</li>
    </tags>
  </BodyPartDef>

  <BodyPartDef>
   <defName>Fuel_Tanks</defName>
   <label>fuel</label>
   <hitPoints>10</hitPoints>
   <oldInjuryBaseChance>0</oldInjuryBaseChance>
   <skinCovered>false</skinCovered>
   <isSolid>true</isSolid>
   <isAlive>false</isAlive>
   <tags>
     <li>EatingPathway</li>
   </tags>
 </BodyPartDef>

 <BodyPartDef>
  <defName>Wheel_Truck_LFDrive</defName>
  <label>wheel</label>
  <hitPoints>15</hitPoints>
  <oldInjuryBaseChance>0</oldInjuryBaseChance>
  <skinCovered>false</skinCovered>
  <isSolid>true</isSolid>
  <isAlive>false</isAlive>
  <tags>
    <li>MovingLimbCore</li>
  </tags>
</BodyPartDef>

<BodyPartDef>
 <defName>Wheel_Truck_RFDrive</defName>
 <label>wheel</label>
 <hitPoints>15</hitPoints>
 <oldInjuryBaseChance>0</oldInjuryBaseChance>
 <skinCovered>false</skinCovered>
 <isSolid>true</isSolid>
 <isAlive>false</isAlive>
 <tags>
   <li>MovingLimbCore</li>
 </tags>
</BodyPartDef>

<BodyPartDef>
 <defName>Wheel_Truck_LB</defName>
 <label>wheel</label>
 <hitPoints>15</hitPoints>
 <oldInjuryBaseChance>0</oldInjuryBaseChance>
 <skinCovered>false</skinCovered>
 <isSolid>true</isSolid>
 <isAlive>false</isAlive>
 <tags>
   <li>MovingLimbSegment</li>
 </tags>
</BodyPartDef>

<BodyPartDef>
 <defName>Wheel_Truck_RB</defName>
 <label>wheel</label>
 <hitPoints>15</hitPoints>
 <oldInjuryBaseChance>0</oldInjuryBaseChance>
 <skinCovered>false</skinCovered>
 <isSolid>true</isSolid>
 <isAlive>false</isAlive>
 <tags>
   <li>MovingLimbSegment</li>
 </tags>
</BodyPartDef>

<!-- ===== Truck Body ===== -->
  <BodyDef>
    <defName>Truck_Body</defName>
    <label>Truck</label>
    <corePart>
      <def>Truck_Body</def>
      <height>Middle</height>
      <depth>Outside</depth>
      <groups>
        <li>HeadAttackTool</li>
      </groups>
      <parts>
        <li>
          <def>Truck_Engine</def>
          <coverage>0.1</coverage>
          <depth>Inside</depth>
          <height>Bottom</height>
        </li>

        <li>
          <def>Truck_Transmission</def>
          <coverage>0.05</coverage>
          <depth>Inside</depth>
          <height>Bottom</height>
        </li>

        <li>
          <def>Truck_Cabin</def>
          <coverage>0.3</coverage>
        </li>

        <li>
          <def>Exterior_Thermometer</def>
          <coverage>0.01</coverage>
          <depth>Outside</depth>
        </li>

        <li>
          <def>Wheel_Truck_LFDrive</def>
          <coverage>0.01</coverage>
          <height>Bottom</height>
        </li>

        <li>
          <def>Wheel_Truck_RFDrive</def>
          <coverage>0.01</coverage>
          <height>Bottom</height>
        </li>

        <li>
          <def>Wheel_Truck_LB</def>
          <coverage>0.01</coverage>
          <height>Bottom</height>
        </li>

        <li>
          <def>Wheel_Truck_RB</def>
          <coverage>0.01</coverage>
          <height>Bottom</height>
        </li>

      </parts>
    </corePart>
  </BodyDef>

</Defs>

```Thank you for your help <3 Looking forward to getting this working to share with the community

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.