[Modding]Creating your own weapons

Discuss and distribute tools and methods for modding. Moderator - Grognak
Thunderr
Posts: 142
Joined: Sun May 19, 2013 9:09 pm
Location: Mines of Moria

Re: [Modding]Creating your own weapons

Postby Thunderr » Sat Jun 08, 2013 3:55 am

How would I get this weapon I just created into a .ftl file that I can import into superluminal?
User avatar
Sleeper Service
Posts: 2305
Joined: Sun Mar 24, 2013 8:49 pm

Re: [Modding]Creating your own weapons

Postby Sleeper Service » Sat Jun 08, 2013 10:09 am

Thunderr wrote:How would I get this weapon I just created into a .ftl file that I can import into superluminal?


I don't think superluminal suports custom weapons. But you can export your ship, put your weapon mod and your ship mod together and than add the weapon to your ship blueprint.
User avatar
kartoFlane
Posts: 1481
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Modding]Creating your own weapons

Postby kartoFlane » Sat Jun 08, 2013 10:19 am

Actually Superluminal does support custom weapons and drones.
Superluminal Guides: Loading mods in Superluminal
However it doesn't place the custom weapon's blueprint in the exported file... Only allows you to put the custom weapon in <weaponList><weaponList> tags. So you'll have to edit the files manually anyway, unless you're fine with your mod having a dependency on another.
Superluminal2 - a ship editor for FTL
Thunderr
Posts: 142
Joined: Sun May 19, 2013 9:09 pm
Location: Mines of Moria

Re: [Modding]Creating your own weapons

Postby Thunderr » Sat Jun 08, 2013 1:18 pm

Tha doesn't really answer my question. I wondeted how you turn the code tou sdded in the blueprints.xml, autoblueprints.xml, and animations.xml into a usable .ftl file without repackaging all the game code. Also, is it possible to combine mods into a single .ftl file?
speedoflight
Posts: 660
Joined: Mon Feb 18, 2013 11:08 am

Re: [Modding]Creating your own weapons

Postby speedoflight » Sat Jun 08, 2013 4:45 pm

Thunderr wrote:Tha doesn't really answer my question. I wondeted how you turn the code tou sdded in the blueprints.xml, autoblueprints.xml, and animations.xml into a usable .ftl file without repackaging all the game code. Also, is it possible to combine mods into a single .ftl file?


I think all the modders try to save work just making a general mod including all their mods. Me for example, i used back in the days some modifications to delay the fleet, more scrap at the beginning, and more enemy classes. So i merged all of em in 1, and i ven using some features in my mod omicron dynasty.

Of course, not everything can be merged. There are things that cant be added with a .append xml file, like the sector_data.xml file, for example and other ones. In this cases, since u need to include the entire same original sector_data.xml file, u are limited to the modifications u make on that very same file and thats all.

BUT, no repacking the data files is out of question, u cant do anything to avoid that, its just the way FTL modding works. Since the game does not know anything about mods or enything else, it just load the original files of the original FTL game from the installation directory, so it needs to be done in this repacking way.

About custom weapons in superluminal, of course u can add em. But be aware u need to load em, from the data file of the game, so the game needs to be already patched with that weapons before u can add em in superluminal.
My currently mods / wips ->
ImageImage
User avatar
Sleeper Service
Posts: 2305
Joined: Sun Mar 24, 2013 8:49 pm

Re: [Modding]Creating your own weapons

Postby Sleeper Service » Sat Jun 08, 2013 4:50 pm

Thunderr wrote:Also, is it possible to combine mods into a single .ftl file?


For that you just have to coppy the contend of the different xml.appends of the one mod into the xml.appends of the other mod. Contend of blueprints.xml.append from mod 1 goes into blueprints.xml.append of mod 2 and so one. If the mods use custom sprites you have to copy all the image files as well of course.
Thunderr
Posts: 142
Joined: Sun May 19, 2013 9:09 pm
Location: Mines of Moria

Re: [Modding]Creating your own weapons

Postby Thunderr » Sat Jun 08, 2013 8:42 pm

So I need to merge the .xml.appends and then merge the folders with the images? That doesn't seem to bad. Just one question, how do you make the .xml.append file, and what should it have in it? (as you can tell, this is my first weapon mod.)
User avatar
Sleeper Service
Posts: 2305
Joined: Sun Mar 24, 2013 8:49 pm

Re: [Modding]Creating your own weapons

Postby Sleeper Service » Sat Jun 08, 2013 11:18 pm

Thunderr wrote:how do you make the .xml.append file, and what should it have in it?


Honestly I have no idea how to create one from scratch. I think its just a text file, you can just copy one from other mods and fill it with your own stuff. Wait... I had this summary for weapon creation that I PMed someone... here it is:

Sleeper Service wrote:Weapon code is actually made up of three things:

1.: An animSheet. That tells the game where the weapon image file is, how big it is, how many animation frames it contains and how the game should navigate them. Goes into animations.xml.append and should look like this:

Code: Select all

<animSheet name="ba_missiles_peryton" w="84" h="44" fw="28" fh="44">weapons/ba_missiles_peryton_strip3.png</animSheet>


As you can see this tells the game the name of your weapon graphic. The image should be placed in img/weapons/.

2.: An weaponAnim. That tells the game how to animate the weapon properly with the informations from the animSheet. Also tells the game which glow to use during weapon charging. Goes into animations.xml.append as well and should look like this:

Code: Select all

<weaponAnim name="ba_missiles_peryton">
   <sheet>ba_missiles_peryton</sheet>
   <desc length="3" x="0" y="0"/>
   <chargedFrame>1</chargedFrame>
   <fireFrame>2</fireFrame>
   <firePoint  x="13" y="3"/>
   <mountPoint x="4" y="26"/>
   <chargeImage>weapons/ba_missiles_peryton_glow.png</chargeImage>
</weaponAnim>


As you can see it needs the corresponding animSheet in <sheet><sheet>. All the entries here have to match your weapon graphic to work properly.

3.: A weapon blueprint. It tells the game how the weapon should behave and what stats it gets. Should be put into blueprints.xml.append. Should look like this for example:

Code: Select all

<weaponBlueprint name="BA_MISSILES_PERYTON">
   <type>MISSILES</type>
   <title>Peryton Missile</title>
   <short>Peryton</short>
   <desc>Inventive but outdated missile design allows for two projectiles for the cost of one.</desc>
   <tooltip>Fires 2 missiles; 1 damage each; pierces  all shields.</tooltip>
   <damage>1</damage>
   <missiles>1</missiles>
   <shots>2</shots>
   <sp>5</sp>
   <fireChance>1</fireChance>
   <breachChance>1</breachChance>
   <cooldown>10</cooldown>
   <power>2</power>
   <cost>45</cost>
   <bp>7</bp>
   <rarity>1</rarity>
   <image>ba_missile_swarm</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>ba_missiles_peryton</weaponArt>
</weaponBlueprint>


As you can see, <weaponArt><weaponArt> needs the weaponAnim ID.
<weaponArt></weaponArt> defines the weapons projectile. If you have a costume projectile made then this also needs an own animSheet and Anim in animations.xml.append. Else you can just use vanilla projectiles.


I recommend you look at the files of some other weapon mods, that might help you to further understand how that stuff is structured.
speedoflight
Posts: 660
Joined: Mon Feb 18, 2013 11:08 am

Re: [Modding]Creating your own weapons

Postby speedoflight » Sun Jun 09, 2013 4:19 pm

Actually, this tutorial is a bit outdated, i think the fastest way is to look aroudn any mod out there and do a copy / paste. But one thing is true, for a weapon to work u need the animation code, the blueprint code (weapon definition and weapon blueprint) and of course the ship xml file where u write the mount locations. This translates in 3 text files, the animations.xml.append , where u put the animations of the weapon, projectile and explosion (if u included one), the blueprints.xml.append, where u add your weapon to the starting weapons blueprint list, and where u define the blueprint of the weapon (same name as the one u wrote in the starting weapons bluepring list). And finally the myship_xml.file , where u define the weapon mounts.

NOTE: In the blueprints.xml.append file the only thing u need to duplicate from the original blueprints.xml file is the starting weapons blueprint list, where u put your new weapon. Everything else is your mod code (in this case, the weapon definition blueprint and the line of code u write in the weapons list). In the animations.xml.append, u dont need to copy anything from the original game, just add your weapon animations (again, look at other mod and do it the same way). U need to be aware, laser weapons has the weapon animation, and the projectile animation as mandatory, for example, same as missiles (the only difference is missiles type weapons, projectiles are not animated, so the sprite will have only 1 in lenght). Beams have the weapon animation and the beam hit effect animation (the effect produced when the beam hits the ship).

Kknowing this, the fastest method to learn is just to look at other mod.
My currently mods / wips ->
ImageImage
Thunderr
Posts: 142
Joined: Sun May 19, 2013 9:09 pm
Location: Mines of Moria

Re: [Modding]Creating your own weapons

Postby Thunderr » Sun Jun 09, 2013 9:35 pm

Looking at Kieve's Incursor Cruiser (Thanks Kieve!), I found that for the .xml.append files, all you have to include is the added code. This tutorial really should be updated though, or a new one put in its place because it's VERY out of date.

Who is online

Users browsing this forum: No registered users and 13 guests