[Modding]Creating your own weapons

Discuss and distribute tools and methods for modding. Moderator - Grognak
AtillaBosma
Posts: 56
Joined: Tue Sep 18, 2012 3:51 pm

[Modding]Creating your own weapons

Postby AtillaBosma » Tue Sep 18, 2012 5:07 pm

___________________________________________
PART 1
___________________________________________
Hey guys, I found out how to add additional weapons to the game, just adding them, not yet making them dropped from events.
They are also duplicate weapons with just reskinned animations/models and damage values changed a bit, but I know people can figure it out further.

I shall give you a quick tutorial here:

Step 1: Unpack Data.dat and Resource.dat
That step is quite straightforward, follow the intructions in the first post.

Step 2: Go to data.dat-unpacked folder and look for these files:
Animations.xml, autoBlueprints.xml and Blueprints.xml.

Step 3: Open up Animations.xml.
What I did was make a duplicate missile, so look for

Code: Select all

<animSheet name="missiles_1" w="75" h="43" fw="25" fh="43">weapons/missiles_1_strip3.png</animSheet>


Copy that line and paste it underneath that line, rename it so it says this:

Code: Select all

<animSheet name="missiles_4" w="75" h="43" fw="25" fh="43">weapons/missiles_4_strip3.png</animSheet>


This means that it will start using the animation from the file missiles_4_strip3.png, but we'll get to that later.

Now look for this part of the code:

Code: Select all

<weaponAnim name="missiles_1">
   <sheet>missiles_1</sheet>
   <desc length="3" x="0" y="0"/>
   <chargedFrame>1</chargedFrame>
   <fireFrame>2</fireFrame>
   <firePoint  x="15" y="20"/>
   <mountPoint x="7" y="30"/>
   <chargeImage>weapons/missiles_1_glow.png</chargeImage>
</weaponAnim>


Copy that and paste it underneath with 1 line between, that means it will start using a duplicate version of missiles_1, change the code you pasted to:

Code: Select all

<weaponAnim name="missiles_4">
   <sheet>missiles_4</sheet>
   <desc length="3" x="0" y="0"/>
   <chargedFrame>1</chargedFrame>
   <fireFrame>2</fireFrame>
   <firePoint  x="15" y="20"/>
   <mountPoint x="7" y="30"/>
   <chargeImage>weapons/missiles_1_glow.png</chargeImage>
</weaponAnim>

This will make it so the weaponAnimation of Missiles_4, the one that we created earlier, will have the animation of missiles_1, you can make your own graphics but for the sake of this tutorial I didnt.

Now, the last part of the animations we have to cover is the actual projectile, look for this part of the code:

Code: Select all

<animSheet name="missile_1" w="32" h="80" fw="32" fh="80">weapons/missile_1.png</animSheet>
<anim name="missile_1">
   <sheet>missile_1</sheet>
   <desc length="1" x="0" y="0"/>
   <time>1</time>
</anim>


Do the same as last time and change the code to:

Code: Select all

<animSheet name="missile_4" w="32" h="80" fw="32" fh="80">weapons/missile_4.png</animSheet>
<anim name="missile_4">
   <sheet>missile_4</sheet>
   <desc length="1" x="0" y="0"/>
   <time>1</time>
</anim>


This means it will start using the file missile_4.png in the resource.dat as a graphic, but I'll get to that later.

Alright, we got the animations ready for our missile!
We only need to create the info about the missile, define its damage values and make it so your ship starts with it!

End of part 1 of this tutorial, I'll write part 2 as soon as possible.

___________________________________________
PART 2
___________________________________________
Alright, lets continue!

Lets go to autoBlueprints.xml, this is gonna be a quick one since it's just 1 line of code that you need to add.

Look for:

Code: Select all

<name>MISSILES_1</name>


And then make a copy of it underneath it, rename it to:

Code: Select all

<name>MISSILES_4</name>


There we go, that is autoBlueprints.xml done!

Let's go further then, here comes the damage value part etc. etc.

Step 1: Go to Blueprints.xml and look for:

Code: Select all

<blueprintList name="STARTING_WEAPONS">


You should see

Code: Select all

   <name>MISSILES_2_PLAYER</name>
underneath it, make a copy of that line and paste it underneath it, of course renaming it to:

Code: Select all

<name>MISSILES_4</name>


again.

Now, here comes the damage value stuff, look for this line:

Code: Select all

<weaponBlueprint name="MISSILES_1">
   <type>MISSILES</type>
   <title>Leto Missiles</title>
   <short>Leto</short>
   <desc>This launcher is outdated and weak, but can still be effective.</desc>
   <tooltip>Fires 1 missile; does 1 damage; pierces all shields.</tooltip>
   <damage>1</damage>
   <missiles>1</missiles>
   <shots>1</shots>
   <sp>5</sp>
   <fireChance>1</fireChance>
   <breachChance>1</breachChance>
   <cooldown>9</cooldown>
   <power>1</power>
   <cost>20</cost>
   <bp>2</bp>
   <rarity>0</rarity>
   <image>missile_1</image>
   <launchSounds>
      <sound>smallMissile1</sound>
      <sound>smallMissile2</sound>
   </launchSounds>
   <hitShipSounds>
      <sound>smallExplosion</sound>
   </hitShipSounds>
   <hitShieldSounds>
      <sound>hitShield1</sound>
      <sound>hitShield2</sound>
      <sound>hitShield3</sound>
   </hitShieldSounds>
   <missSounds>
      <sound>miss</sound>
   </missSounds>
   <weaponArt>missiles_1</weaponArt>
</weaponBlueprint>


Copy that and paste it underneath it with 1 line inbetween, change the code you pasted underneath to:

Code: Select all

<weaponBlueprint name="MISSILES_4">
   <type>MISSILES</type>
   <title>PUTYOURWEAPONTITLEHERE</title>
   <short>SHORTNAMEFORYOUWEAPON</short>
   <desc>YOURWEAPONDESCRIPTION</desc>
   <tooltip>TOOLTIPFORYOURWEAPON</tooltip>
   <damage>AMOUNTOFDAMAGEITDOES</damage>
   <missiles>AMOUNTOFMISSILESITTAKESFORITTOSHOOT</missiles>
   <shots>AMOUNTOFSHOTSITSHOOTS</shots>
   <sp>HOWMUCHSHIELDPOINTSITPENETRATES</sp>
   <fireChance>HOWMUCHCHANCEITHASTOCREATEAFIRE</fireChance>
   <breachChance>HOWMUCHCHANCEITHASTOBREAKHULL</breachChance>
   <cooldown>COOLDOWNTIME</cooldown>
   <power>POWERCOST</power>
   <cost>MONEYCOST</cost>
   <bp>2</bp>
   <rarity>HOWRAREITIS</rarity>
   <image>missile_4</image>
   <launchSounds>
      <sound>smallMissile1</sound>
      <sound>smallMissile2</sound>
   </launchSounds>
   <hitShipSounds>
      <sound>smallExplosion</sound>
   </hitShipSounds>
   <hitShieldSounds>
      <sound>hitShield1</sound>
      <sound>hitShield2</sound>
      <sound>hitShield3</sound>
   </hitShieldSounds>
   <missSounds>
      <sound>miss</sound>
   </missSounds>
   <weaponArt>missiles_4</weaponArt>
</weaponBlueprint>


Of course don't forget to change all those big caps-locked messages to your liking.

End of part 2, next part will show you how to create custom animations and graphics.

___________________________________________
PART 3
___________________________________________
Well then, let's go to the custom animations/graphics!

Step 1: Go to the folder resource.dat-unpacked
You have probably unpacked resource.dat and data.dat, or else you couldn't have started modding, so yeah, look for that folder.

Step 2: Go to img\weapons and make a copy of missile_1.png and missiles_1_strip_3.png
In the other 2 parts we told the code to look for these files, but we said that the name for them were missile_4.png and missiles_4_strip_3.png, so rename the copies you made of those files.

Step 3: Create your own graphics!
HINT: USE PAINT.NET OR PHOTOSHOP, IF YOU DONT THE FILES WILL LOOK LIKE BIG WHITE BLOCKS!

You can change the colour of the missile or launcher, maybe change it to a nyan gun or something, then just overwrite it!

Step 4: Pack the 2 folders!
What I did was make a .cmd file that automatically packs the 2 files, make a .cmd in the folder that has data.dat-unpacked and resource.dat-unpacked in it and paste this into the CMD:

Code: Select all

ftldat pack O:\FTLModding\data.dat O:\FTLModding\data.dat-unpacked
ftldat pack O:\FTLModding\resource.dat O:\FTLModding\resource.dat-unpacked


Then run the CMD and it will have created the 2 files called data.dat and resource.dat, put those in your FTL\resources folder and start the game, it will have the mods you included in the game!

And that's it, I will put 1 extra that will show you how to make it your starting weapon!

___________________________________________
PART 4(EXTRA)
___________________________________________
Alright then, step 1!

Step 1: Look for the file called Blueprints.xml in the data.dat-unpacked folder
Look for this part in the code:

Code: Select all

<shipBlueprint name="PLAYER_SHIP_HARD" layout="kestral" img="kestral">
   <class>Kestrel Cruiser</class>
   <name>The Kestrel</name>
   <desc>This class of ship was decommissioned from Federation service years ago.  After a number of refits and updating this classic ship is ready for battle.</desc>
   <systemList>
      <pilot power="1" room="0" start="true" img="room_pilot">
         <slot>
            <direction>right</direction>
            <number>0</number>
         </slot>
      </pilot>
      <doors power="1" room="2" start="true" img="room_doors"/>
      <sensors power="1" room="3" start="true" img="room_sensors"/>
      <medbay power="1" room="4" start="true" img="room_medbay">
         <slot>
            <number>1</number>
         </slot>
      </medbay>
      <oxygen power="1"  room="13" start="true" img="room_oxygen"/>
      <shields power="2" room="5" start="true" img="room_shields"/>
      <engines power="2" room="14" start="true" img="room_engines"/>
      <weapons power="3" room="10" start="true" img="room_weapons"/>
      <drones power="2" room="1" start="false"/>
      <teleporter power="1" room="15"   start="false"/>
      <cloaking power="1" room="8" start="false"/>
   </systemList>
   <weaponSlots>4</weaponSlots>
   <droneSlots>2</droneSlots>
   <weaponList count="2" missiles="8">
      <weapon name="MISSILES_2_PLAYER"/>
      <weapon name="LASER_BURST_3"/>
   </weaponList>
   <health amount="30"/>
   <maxPower amount ="8"/>
   <crewCount amount = "3" class="human"/>
</shipBlueprint>


Do you see this part:

Code: Select all

   <weaponList count="2" missiles="8">
      <weapon name="MISSILES_2_PLAYER"/>
      <weapon name="LASER_BURST_3"/>

Change the

Code: Select all

<weapon name="MISSILES_2_PLAYER"/>
to

Code: Select all

<weapon name="MISSILES_4"/>
.
This will make it so instead of the usual missile launcher it will spawn you with the weapon you made in the previous tutorials.

And thats it!

Edit: Thank Cash at Folsom for pointing out some errors in the tutorial, I fixed them now.
Edit 2: If you want to know how to make the weapon drop through an event, please look at this tutorial viewtopic.php?f=4&t=2533
Last edited by AtillaBosma on Fri Sep 21, 2012 12:17 pm, edited 5 times in total.
AtillaBosma
Posts: 56
Joined: Tue Sep 18, 2012 3:51 pm

Re: [Modding]Creating your own weapons

Postby AtillaBosma » Tue Sep 18, 2012 5:18 pm

Just saw an error in the code, lemme quickly fix it!
Deon
Posts: 4
Joined: Wed Sep 19, 2012 4:52 am

Re: [Modding]Creating your own weapons

Postby Deon » Wed Sep 19, 2012 4:57 am

Nice tutorial. It should also be easy to add your weapons to shops and enemies, you just need to include them in appropriate xml files.
buzzyrecky
Posts: 43
Joined: Wed Sep 19, 2012 8:15 am

Re: [Modding]Creating your own weapons

Postby buzzyrecky » Wed Sep 19, 2012 10:51 am

Wouldnt the shops/loot function for the weapons just be setting the rarity to anything but 0?

Also, if you could clarify what the bp/sp in the weapon stats is, I'd be appreciative. I'm trying this weapon stuff out for the first time and having a blast... hopefully it works.
Amiths
Posts: 7
Joined: Sun Sep 16, 2012 2:22 am

Re: [Modding]Creating your own weapons

Postby Amiths » Wed Sep 19, 2012 5:24 pm

And how to i add the weapons to AI fleet? I went to blueprints.xml but i could only find the layout of my own ships not AI ships. Thx!
AtillaBosma
Posts: 56
Joined: Tue Sep 18, 2012 3:51 pm

Re: [Modding]Creating your own weapons

Postby AtillaBosma » Wed Sep 19, 2012 5:49 pm

buzzyrecky wrote:Wouldnt the shops/loot function for the weapons just be setting the rarity to anything but 0?

Also, if you could clarify what the bp/sp in the weapon stats is, I'd be appreciative. I'm trying this weapon stuff out for the first time and having a blast... hopefully it works.


I am not sure what BP and SP means, but I think that SP means how much Shield Points it penetrates.
So if their shield points is like, 5, and your weapon SP is 6 it penetrates the shield, but if your weapons SP is like 4, it takes away 4 shield points.

Seriously not sure about BP.

Rarity has to do with how rare it is for an event to drops it, not sure about that.
AtillaBosma
Posts: 56
Joined: Tue Sep 18, 2012 3:51 pm

Re: [Modding]Creating your own weapons

Postby AtillaBosma » Wed Sep 19, 2012 5:50 pm

Amiths wrote:And how to i add the weapons to AI fleet? I went to blueprints.xml but i could only find the layout of my own ships not AI ships. Thx!


The AI ships take their weapons from autoBlueprints.xml, not from Blueprints.xml.
Tysonclyde
Posts: 41
Joined: Mon Sep 17, 2012 11:16 am

Re: [Modding]Creating your own weapons

Postby Tysonclyde » Wed Sep 19, 2012 7:10 pm

This has helped me so much. thank you :).
AtillaBosma
Posts: 56
Joined: Tue Sep 18, 2012 3:51 pm

Re: [Modding]Creating your own weapons

Postby AtillaBosma » Wed Sep 19, 2012 7:11 pm

Tysonclyde wrote:This has helped me so much. thank you :).

No problem, I enjoy being part of the just started modding scene ^^
Tysonclyde
Posts: 41
Joined: Mon Sep 17, 2012 11:16 am

Re: [Modding]Creating your own weapons

Postby Tysonclyde » Wed Sep 19, 2012 7:14 pm

When I am finished creating my weapon you should download it.
viewtopic.php?f=4&t=2541&p=10435#p10435

Who is online

Users browsing this forum: No registered users and 10 guests