Ludeon Forums

RimWorld => Mods => Help => Topic started by: Pfluger on March 02, 2014, 11:17:25 PM

Title: Made a custom gun. Not appearing in game??
Post by: Pfluger on March 02, 2014, 11:17:25 PM
So I made a colt 1911 and it's not in the debug menu nor spawning on raiders
here is the code from my Weapons_Guns.xml

<ThingDef ParentName="BaseBullet">
<defName>Bullet_1911</defName>
<label>Pistol bullet</label>
<texturePath>Things/Projectile/Bullet_Small</texturePath>
<projectile>
<impactWorld>True</impactWorld>
<damageType>Bullet</damageType>
<DamageAmountBase>15</DamageAmountBase>
<Speed>60</Speed>
</projectile>
</ThingDef>

<ThingDef ParentName="BaseGun">
<defName>Gun_1911</defName>
<label>M1911</label>
<description>The 1911 is a single-action, semi-automatic, magazine-fed, recoil-operated pistol chambered for the .45 ACP cartridge, which served as the standard-issue sidearm for the United States Armed Forces from 1911 to 1985.</description>
<texturePath>Things/Item/Equipment/Default</texturePath>
<interactSound>InteractPistol</interactSound>
<purchasable>True</purchasable>
<basePrice>80</basePrice>
<verb>
<projectileDef>Bullet_Pistol</projectileDef>
<accuracy>6</accuracy>
<warmupTicks>58</warmupTicks>
<range>30</range>
<fireSound>ShotPistol</fireSound>
</verb>
</ThingDefs>

Please note that this is just the part for my gun.
If anyone can help that'd be amazing  ;D

Also my mod folder contains 2 folders which are the
Textures
Defs-ThingDefs-M1911.xml(Which is posted as this)

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


<ThingDef Name="BaseGun" Abstract="True">
<category>Item</category>
<eType>Equipment</eType>
<thingClass>Equipment</thingClass>
<label>Gun</label>
<equipmentType>Primary</equipmentType>
<isGun>True</isGun>
<pathCost>10</pathCost>
<useStandardHealth>True</useStandardHealth>
<selectable>True</selectable>
<maxHealth>100</maxHealth>
<altitudeLayer>Item</altitudeLayer>
<alwaysHaulable>True</alwaysHaulable>
<tickerType>Never</tickerType>
<storeCategories>
<li>Weapons</li>
</storeCategories>
<comps>
<li>
<compClass>CompForbiddable</compClass>
</li>
</comps>
<verb>
<id>Nonnative</id>
<verbClass>Verb_Shoot</verbClass>
<cooldownTicks>30</cooldownTicks>
<label>VerbGun</label>
<description>Verb fires bullets.</description>
<hasStandardCommand>true</hasStandardCommand>
<targetParams>
<canTargetPawns>true</canTargetPawns>
<canTargetBuildings>true</canTargetBuildings>
<worldObjectTargetsMustBeAutoAttackable>true</worldObjectTargetsMustBeAutoAttackable>
</targetParams>
<canMiss>true</canMiss>
</verb>
</ThingDef>

<ThingDef Name="BaseBullet" Abstract="True">
<category>Projectile</category>
<tickerType>Normal</tickerType>
<altitudeLayer>Projectile</altitudeLayer>
<thingClass>Bullet</thingClass>
<label>Bullet</label>
<useStandardHealth>False</useStandardHealth>
<neverMultiSelect>True</neverMultiSelect>
<baseMaterialType>Transparent</baseMaterialType>
</ThingDef>

</ThingDefs>

Thank you so so so so much
Much Love, Pfluger!
Title: Re: Made a custom gun. Not appearing in game??
Post by: Cala13er on March 03, 2014, 03:25:58 AM

[attachment deleted by admin: too old]
Title: Re: Made a custom gun. Not appearing in game??
Post by: SlimeCrusher on March 03, 2014, 09:08:55 AM
If you made a custom raider, im sorry, it will NOT spawn, only if you modify existing raiders... I know they don't spawn for a fact, because i tried adding a "Pyroman" that uses my flamethrower, molotov and T9 IL but it doesn't spawn, only in the debug menu

Also, as Cala13er said, check that you enabled your mod on the Mods thingy on the Rimworld menu (Ingame)
Title: Re: Made a custom gun. Not appearing in game??
Post by: Cala13er on March 03, 2014, 09:44:38 AM
Yeah sorry. I've not added a gun yet. If I was too I'd make it a class file then reference it. And I was unsure about the raider thing because again. I don't plan on adding raiders.so never checled it out.
Title: Re: Made a custom gun. Not appearing in game??
Post by: Architect on March 03, 2014, 11:09:17 AM
Yeah, youll need to go into the file @Cala13er had identified, and modify one of the current dudes already in so for instance with the scavenger:
<possibleStartingWeapons>
<li>Gun_Pistol</li>
<li>Gun_Pistol</li>
<li>Gun_Pistol</li>
<li>Gun_Pistol</li>
<li>Gun_Pistol</li>
<li>Gun_Pistol</li>
<li>Gun_Pistol</li>
<li>Gun_Pistol</li>
<li>Gun_Lee-Enfield</li>
<li>Gun_Pump Shotgun</li>
<li>Gun_1911</li>
</possibleStartingWeapons>
Title: Re: Made a custom gun. Not appearing in game??
Post by: Evul on March 03, 2014, 12:34:26 PM
make sure that <ThingDef Name="BaseGun" Abstract="True">...</ThingDefs> and <ThingDef Name="BaseBullet" Abstract="True">...</ThingDefs> is present in your gun file. also that the file starts and end with:
<?xml version="1.0" encoding="utf-8" ?>
<ThingDefs>
...
</ThingDefs>


if you done that right you have a gun present in the Debug menu. if not its not there. :P
Also as the other guys say if you what raiders to use the gun edit the PawnKinds_Raiders. It picks a gun from the list by random. So the more the gun is appearing in the list the larger is the chance the weapon appears.


(... represents code.)
Title: Re: Made a custom gun. Not appearing in game??
Post by: Pfluger on March 03, 2014, 06:32:28 PM
Hmmm tried all of this and it did not work...
If anyone has a skype and can help please add me: fluffymascot123
Title: Re: Made a custom gun. Not appearing in game??
Post by: Evul on March 03, 2014, 08:21:29 PM
I sent a message to you one Skype.