Ludeon Forums

RimWorld => Mods => Help => Topic started by: Delta_Com on March 04, 2014, 09:55:12 PM

Title: Weapon Help
Post by: Delta_Com on March 04, 2014, 09:55:12 PM
I've Been looking at the T-9, and was wondering what tells the game to make it light things on fire. I cannot seem to find anything in it's code. I'm trying to make a minigun that has incendiary rounds.
Title: Re: Weapon Help
Post by: SlimeCrusher on March 04, 2014, 10:11:29 PM
This is the code from my Flamethrower mod:

Quote   <ThingDef ParentName="BaseBullet">
      <defName>Bullet_Flame</defName>
      <label>Flamethrower Flame</label>
      <texturePath>Things/Projectile/Flame</texturePath>
      <thingClass>BulletIncendiary</thingClass> <--- This is all you need, just copy-paste the tag bellow the texturePath and it should work
      <damageType>Flame</damageType>
      <projectile>
         <damageAmountBase>1</damageAmountBase>
         <speed>30</speed>
      </projectile>
   </ThingDef>


   <ThingDef ParentName="BaseGun">
      <defName>Flamethrower</defName>
      <label>Flamethrower</label>
      <description>Burn! Buuuurn! The favorite weapon of a pyroman!</description>
      <texturePath>Things/Item/Equipment/Flamethrower</texturePath>
      <interactSound>InteractBoltActionRifle</interactSound>
      <purchasable>True</purchasable>
      <basePrice>500</basePrice>
      <verb>
         <projectileDef>Bullet_Flame</projectileDef>
         <accuracy>2</accuracy>
         <burstShotCount>30</burstShotCount>
         <ticksBetweenBurstShots>2</ticksBetweenBurstShots>
         <warmupTicks>250</warmupTicks>
         <range>10</range>
         <fireSound>FlameBrust</fireSound>
      </verb>
   </ThingDef>
Title: Re: Weapon Help
Post by: Delta_Com on March 04, 2014, 11:17:06 PM
Thanks a lot
EDIT: That actually didn't seem to work. Any ideas?
Title: Re: Weapon Help
Post by: SlimeCrusher on March 05, 2014, 10:19:04 AM
Can you please post the whole .xml file to take a look?
Title: Re: Weapon Help
Post by: Delta_Com on March 05, 2014, 02:18:15 PM
Just figured it out. I forgot to tell the minigun to actually fire the projectile I gave it.
(https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTPqCMTOFheYoB8F15gMXBdLjMq2k0utNl2-wAXQ_2H0-CDiZkYVg)
Now the pirates are burning!
Title: Re: Weapon Help
Post by: SlayR on March 06, 2014, 03:53:02 PM
I know i shouldn't be questioning here, but how can you make new kinds of bullets? (Like explosive) I didn't want to open a new post. ;D
Title: Re: Weapon Help
Post by: Kilroy232 on March 06, 2014, 08:20:01 PM
Quote
I know i shouldn't be questioning here, but how can you make new kinds of bullets? (Like explosive) I didn't want to open a new post. ;D
To make an explosive round you can actually use the grenade projectile and replace the texture of the projectile and even the sound of it if you so wished.

It is possible to modify the blast radius and all those good things this way easily  :)
Title: Re: Weapon Help
Post by: palandus on March 08, 2014, 02:35:03 AM
@SlayR; I'd suggest taking a look at both Weapons_Guns and Weapons_Grenades, copy the code to a different location and see which lines are used for each weapon type (so in this case, BulletBase and GrenadeBase) and mix and match code lines until is works; this is how I created my bunker wall, by combining Sandbags code with a Wall's code.