Sorry about the caps -.- but I am angry lol. Someone please help I am trying to create a melee weapon so I created folder inside the mod folder and got to work. First I created Folder Path: Defs/ThingDefs then I created text file Weapons_Melee with the following code:
Quote<?xml version="1.0" encoding="utf-8" ?>
<ThingDefs>
<ThingDef Name="BaseMeleeWeapon" Abstract="True">
<category>Item</category>
<eType>Equipment</eType>
<thingClass>Equipment</thingClass>
<equipmentType>Primary</equipmentType>
<pathCost>10</pathCost>
<useStandardHealth>True</useStandardHealth>
<selectable>True</selectable>
<onGroundRandomRotateAngle>35</onGroundRandomRotateAngle>
<statBases>
<MaxHealth>100</MaxHealth>
<Flammability>1.0</Flammability>
</statBases>
<altitudeLayer>Item</altitudeLayer>
<alwaysHaulable>True</alwaysHaulable>
<tickerType>Never</tickerType>
<techLevel>Midworld</techLevel>
<weaponTags>
<li>Melee</li>
</weaponTags>
<storeCategories>
<li>Weapons</li>
</storeCategories>
<comps>
<li>
<compClass>CompForbiddable</compClass>
</li>
</comps>
</ThingDef>
<!-- ============================================================== -->
<ThingDef ParentName="BaseMeleeWeapon">
<defName>MeleeWeaponry_Lightsaber</defName>
<label>Lightsaber</label>
<description>Sword of Light used by the Jedi Order in the Star Wars Universe, keep the peace with a weapon of no equal.</description>
<graphicPathSingle>lightsaber</graphicPathSingle>
<soundInteract>InteractPistol</soundInteract>
<tradersCarry>True</tradersCarry>
<baseMarketValue>1500</baseMarketValue>
<equippedAngleOffset>-39</equippedAngleOffset>
<verbs>
<li>
<verbClass>Verb_MeleeAttack</verbClass>
<cooldownTicks>100</cooldownTicks>
<hasStandardCommand>true</hasStandardCommand>
<meleeDamageAmount>25</meleeDamageAmount>
<meleeDamageDef>Cut</meleeDamageDef>
</li>
</verbs>
</ThingDef>
Now then I went on to create Textures folder with a PNG file inside called lightsaber (4.49KB 64x64)
Finally I created a Folder called About with the following code:
Quote<?xml version="1.0" encoding="utf-8"?>
<ModMetaData>
<name>somethingA7</name>
<author>Sooner535</author>
<targetVersion>Alpha 7</targetVersion>
<description>the best</description>
</ModMetaData>
My mod shows up in the mod thing in menu but the author is unlisted and so is description (name and if I put a pic work fine)
The weapon does not show up in the spawn menu when I start a new colony so what is the flim flam deal?
For the weapon .xml file, add this as the final line:
</ThingDefs>
As for the About part, the file inside that folder must be named: About.xml
If you wish for it to also show a graphic, the graphic file must be named: Preview.png
After activating your mod in-game, hit the tilde key (~) to bring up the error console. If there is anything written in Yellow, that generally means you've got something wrong in the xml.
If there's anything seriously wrong with your mod, the game brings that window up itself when the mod is activated in-game.
Where? The final line is that lol. Also change it to a XML file -.- I feel retarded lol thanks a ton
Quote from: Sooner535 on October 02, 2014, 11:21:03 PM
Where? The final line is that lol. Also change it to a XML file -.- I feel retarded lol thanks a ton
The final line you gave in the OP is this: </ThingDef>
The weapon definition file also needs this tag </ThingDefs> to close the open <ThingDefs> tag you've got on the 2nd line.
Ah I see that, thanks. Do I even have a open thingdef? I can't seem to see one only the thingdefs
Everything else in both files appear to be correctly opened and closed, so the mod should be working for you now.
Is it?
The main problem was I didn't turn my text files into XML files (was wondering why it wasn't working. Everything seems to be working great. Thanks for the help I owe ya one :D if you have time I have 3 more questions. 1. How can I make a weapon that just knocks out enemies instead of killing them? 2. What exactly does equip angle offset do? And finally is there a code I can use to make raiders not spawn with it? (Or just specific pawns I pick?)
Sorry two more Qs >.< 1. What if I wanted to make the weapon block incoming bullets? Is there a way to edit swing times, miss chances, and range for melee? (Boar spears range 2 lol)
1. Set <meleeDamageDef> to Stun
2. Try different values and watch closely your pawn, I suspect this determines the saber laser orientation (like |, / or --) when the colonist is drafted.
3. You should play with the weapon tags. The raiders pick their weapon in function of their money and the weapon tags they are allowed to pick from.
4. Block incoming projectile => .DLL is mandatory (but can be easily made based on the Jaxxa shields: detect projectiles in a certain radius, destroy it and apply some visual effect). However, I believe moving the saber when a projectile is destroyed will be quite more difficult.
5. I don't know, did not tested melee weapons yet.
I had played around with stun times it just stuns the guy, can I arrest or capture while stunned?
So I got it working but now my weapon is a lightsaber with a white background lol how do I remove that? The background for it is transparent
You must create textures with alpha layer (it defines the transparency of each pixel).
Paint.net or GIMP or Photoshop do this pretty well.
You must incapacitate a pawn to capture him, not only stun him.
However, once stunned, you can safely send some colonists to smash him with theirs fists until he falls... :) or dies... >:(
If you are a coder, go ahead and extend the Bullet projectile class to make a 100% chance incapacitating gun.
If no, well, just wait my next weapon mod which should contain a taser... 8)
I have been working on my knowledge for about 7 hours lol I think I can safely balance a few weapons and make them fun at the same time. I would like to know should I use mediafire, adfly, moddb, and/or nexus?
Need help again, I am trying to create a Ronon Blaster using a custom Skin for the gun (working) and bullet (not so much)
Here is the code:
Quote<?xml version="1.0" encoding="utf-8" ?>
<ThingDefs>
<ThingDef Name="BaseGun" Abstract="True">
<category>Item</category>
<eType>Equipment</eType>
<thingClass>Equipment</thingClass>
<equipmentType>Primary</equipmentType>
<pathCost>10</pathCost>
<useStandardHealth>True</useStandardHealth>
<selectable>True</selectable>
<onGroundRandomRotateAngle>35</onGroundRandomRotateAngle>
<statBases>
<MaxHealth>100</MaxHealth>
<Flammability>1.0</Flammability>
</statBases>
<altitudeLayer>Item</altitudeLayer>
<alwaysHaulable>True</alwaysHaulable>
<tickerType>Never</tickerType>
<techLevel>Spacer</techLevel>
<storeCategories>
<li>Weapons</li>
</storeCategories>
<comps>
<li>
<compClass>CompForbiddable</compClass>
</li>
</comps>
</ThingDef>
<ThingDef Name="BaseHumanGun" ParentName="BaseGun" Abstract="True">
<weaponTags>
<li>Gun</li>
</weaponTags>
</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>
<shaderType>Transparent</shaderType>
</ThingDef>
<!-- ============================================================== -->
<ThingDef ParentName="BaseBullet">
<defName>laser</defName>
<label>laser</label>
<texturePath>Bullets</texturePath>
<projectile>
<flyOverhead>false</flyOverhead>
<damageDef>Bullet</damageDef>
<DamageAmountBase>10</DamageAmountBase>
<Speed>50</Speed>
</projectile>
</ThingDef>
<ThingDef ParentName="BaseHumanGun">
<defName>RononPistol</defName>
<label>Ronon Pistol</label>
<description>Laser pistol used by Ronon in the Stargate Atlantis series, accurate, medium range, and quick shooting make this pistol a weapon of choice for any fighter.</description>
<graphicPathSingle>RononPistol</graphicPathSingle>
<soundInteract>InteractPistol</soundInteract>
<tradersCarry>True</tradersCarry>
<baseMarketValue>1500</baseMarketValue>
<verbs>
<li>
<verbClass>Verb_Shoot</verbClass>
<cooldownTicks>80</cooldownTicks>
<hasStandardCommand>true</hasStandardCommand>
<projectileDef>Bullet_Pistol</projectileDef>
<accuracyTouch>0.90</accuracyTouch>
<accuracyShort>0.90</accuracyShort>
<accuracyMedium>0.90</accuracyMedium>
<accuracyLong>0.85</accuracyLong>
<burstShotCount>2</burstShotCount>
<ticksBetweenBurstShots>8</ticksBetweenBurstShots>
<warmupTicks>30</warmupTicks>
<range>18</range>
<fireSound>ShotPistol</fireSound>
</li>
</verbs>
</ThingDef>
</ThingDefs>
What I do not understand is if I change the texture part to use single path and then set bullets it auto grabs the default skin for a bullet even though I am telling it the file name is laser so how does that work? The bullet it located at: Mods/the mod 2/Textures/Bullets/laser.png
You'll need to change the
<texturePath>Bullets</texturePath> into
<graphicPathSingle>Bullets/laser</graphicPathSingle>
Also Ronon/Conan/Drogo <3 ;D
I put in that exact code and what I get is a white generic bullet :/ which like I said doesn't make much sense considering I told it to go to the laser and instead it's trying to revert to the white bullet? Idk and yes I agree >.<
Do the bullets need to be a specific size or something? It is a red laser exc shot with a PNG Transparent background 64x64
You need to change this line: <projectileDef>Bullet_Pistol</projectileDef>
To this: <projectileDef>laser</projectileDef>
In the event computers take over you guys will win for us >.< that did the trick thanks a ton now one more thing the projectile on the pic is facing left to right and it comes out up to down (think shooting a lightsaber from a gun that looks like its being held lol) is there a way to fix this?
Nevermind I rotated the picture and it fixed itself apparently it likes up down pics -.- well thanks for your help guys I am sure eventually I will have more Qs but for now I can shut up :P
Quote from: Sooner535 on October 03, 2014, 06:01:06 PM
Nevermind I rotated the picture and it fixed itself apparently it likes up down pics -.- well thanks for your help guys I am sure eventually I will have more Qs but for now I can shut up :P
I was just about to send my reply to "Try rotate the image by 180 degrees" but you figured it out already =P
Good job!
Lightsabre projectiles wouldn't have been *that* bad though
Lol no but it did surprise me when my 2 cm barrel started shooting 3 inch lasers >.<
2 inch to 3 cm -.-