[Tutorial] New Guide on creating weapons

Discuss and distribute tools and methods for modding. Moderator - Grognak
Ferociousfeind
Posts: 13
Joined: Thu Jul 13, 2017 1:44 am

Re: [Tutorial] New Guide on creating weapons

Postby Ferociousfeind » Sun Nov 05, 2017 4:29 pm

Nevermind! I just figured it out! Using the power of "Get Info", then "Name & Extension" I got it to accept .ftl as a file extension. It's like how you have to right-click newly-downloaded files and click "run" instead of double-clicking it to get it to let you run the program. You've just gotta figure out the techie solution, because any old fart could go in there and screw up the file extensions. shrug.
User avatar
Whited
Posts: 35
Joined: Mon Jan 23, 2017 9:54 pm

Re: [Tutorial] New Guide on creating weapons

Postby Whited » Wed Jan 31, 2018 2:29 pm

Hello, i'm trying to get working multiple animations for explosions to work but no luck so far.
This is what i tryed but it just uses the basic explosion instead of my sprites:
<explosions>
<explosion>explosion_red</explosion>
<explosion>explosion_blue</explosion>
<explosion>explosion_green</explosion>
<explosion>explosion_purple</explosion>
</explosions>
Is someone got it to work?

Thanks.
User avatar
Arfy
Posts: 206
Joined: Mon Apr 11, 2016 4:14 am

Re: [Tutorial] New Guide on creating weapons

Postby Arfy » Thu Feb 01, 2018 12:53 am

Whited wrote:Hello, i'm trying to get working multiple animations for explosions to work but no luck so far.
This is what i tryed but it just uses the basic explosion instead of my sprites:
<explosions>
<explosion>explosion_red</explosion>
<explosion>explosion_blue</explosion>
<explosion>explosion_green</explosion>
<explosion>explosion_purple</explosion>
</explosions>
Is someone got it to work?


I'm not sure if you realized this yet; but the <explosion> tag cannot be turned into a list, it can only be this: <explosion>EXPLOSION_NAME</explosion>
Discord: ATLAS#9226
User avatar
Whited
Posts: 35
Joined: Mon Jan 23, 2017 9:54 pm

Re: [Tutorial] New Guide on creating weapons

Postby Whited » Thu Feb 01, 2018 8:07 am

For now i'm using the "explosion_random" with modified sprites.
User avatar
Kacpo
Posts: 9
Joined: Tue May 22, 2018 10:13 pm

Re: [Tutorial] New Guide on creating weapons

Postby Kacpo » Wed May 23, 2018 12:34 pm

Hi.
I'm relatively new and just recently started modding.

I've wanted to ask about beam and artillery weapon;
How would you go about creating custom artillery beam?

By that I mean a system that has different power/cooldown values instead of
1/50
2/40
3/30
4/20
Would it be doable and if yes, how?

Second thing;
I'm working on a custom weapon.
Following this guide I made it to:

Code: Select all

<weaponBlueprint name="RAIL_CANNON">  <!-- #essential -->
   <type>BEAM</type>        <!-- #essential -->
   <title>Magnetic Mass Driver</title>          <!-- #essential -->
   <short>Railgun</short>                          <!-- #essential -->
   <desc>A magnetic weapon launching shield piercing projectile that breaches hull</desc>                         <!-- #essential -->
   <tooltip>Ignores shields and guarantees a hull breach</tooltip>          <!-- #essential -->
   <damage>2</damage>
   <sp>5</sp>                           
   <fireChance>0</fireChance>
   <breachChance>10</breachChance>
   <cooldown>15</cooldown>                        <!-- #essential -->
   <power>3</power>                                    <!-- #essential -->
   <cost>100</cost>                                        <!-- #essential -->
   <length>1</length>
   <hullBust>0</hullBust>
   <bp>2</bp>
   <rarity>0</rarity>                                         <!-- #essential -->
   <image>laser_light1</image>                       <!-- #essential -->
   <launchSounds>                                           <!-- #essential -->
      <sound>lightLaser1</sound>         <!-- #will change that -->
      <sound>lightLaser2</sound>
      <sound>lightLaser3</sound>
   </launchSounds>
   <hitShipSounds>                                      <!-- #essential -->
      <sound>hitHull2</sound>         <!-- HOW DOES THAT CORELATE WITH BEAM? -->
      <sound>hitHull3</sound>
   </hitShipSounds>
   <hitShieldSounds>                                  <!-- #essential -->
      <sound>hitShield1</sound>         <!-- #SHOULD I INCLUDE THAT IN BEAM?-->
      <sound>hitShield2</sound>
      <sound>hitShield3</sound>
   </hitShieldSounds>
   <missSounds>                                        <!-- #essential -->
      <sound>miss</sound>         <!-- #SHOULD I INCLUDE THAT IN BEAM?-->
   </missSounds>
   <weaponArt>laser_burst_1</weaponArt>      <!-- #will change that -->
</weaponBlueprint>

all in XML file "blueprints.xml.append" located in my_weapon/data.

When it comes to Beam weapon, I'm also trying to make it quick, with the visable beam lasting as short as possible. (As to mimic a tracer left by fast moving object.)

I've changed the length to 1px but I'm not sure if that will affect the projection time.

Thanks for the awesome guide.
User avatar
mr_easy_money
Posts: 625
Joined: Fri May 29, 2015 9:05 pm

Re: [Tutorial] New Guide on creating weapons

Postby mr_easy_money » Wed May 23, 2018 10:01 pm

Kacpo wrote:How would you go about creating custom artillery beam?

By that I mean a system that has different power/cooldown values instead of
1/50
2/40
3/30
4/20
Would it be doable and if yes, how?

Only doable by the way the formula for artillery power levels works, as follows:
level 1 -> Base Cooldown x1.25
level 2 -> Base Cooldown x1.0
level 3 -> Base Cooldown x0.75
level 4 -> Base Cooldown x0.5
~(level 5 -> Base Cooldown x0.25. note: for level 5 you'll need to change the <maxPower> of the "artillery" sysBlueprint to 5. higher than level 5 is not recommended, as instant charge keeps firing, and can crash the game if on when jumping to asteroid fields. it is possible to make some ship artillery systems cap at different power levels.)

the Base Cooldown of the artillery is determined by the <cooldown> of the weapon. the artillery beam used on the federation a/b has a <cooldown> of 40. so then the time for the different levels becomes those cooldown values you stated:
level 1 -> 40 x1.25 = 50
level 2 -> 40 x1.0 = 40
level 3 -> 40 x0.75 = 30
level 4 -> 40 x0.5 = 20
Kacpo wrote:I'm working on a custom weapon.

not sure what you exactly mean by your question, but it sounds something along the lines of "How do I make this weapon an artillery weapon?". There's some other things to point out too, but first
Kacpo wrote:all in XML file "blueprints.xml.append" located in my_weapon/data.

looks good!
Kacpo wrote:When it comes to Beam weapon, I'm also trying to make it quick, with the visable beam lasting as short as possible. (As to mimic a tracer left by fast moving object.)

I've changed the length to 1px but I'm not sure if that will affect the projection time.

you can add a <speed> stat, which determines how fast along its span the beam will fire. I believe the default value is 5, but it can be changed to whatever you want (well, non-negative and nonzero I presume).

I see some comments in your code
Kacpo wrote:

Code: Select all

    ...
    <hitShipSounds>                                      <!-- #essential -->
      <sound>hitHull2</sound>         <!-- HOW DOES THAT CORELATE WITH BEAM? -->
      <sound>hitHull3</sound>
   </hitShipSounds>
   <hitShieldSounds>                                  <!-- #essential -->
      <sound>hitShield1</sound>         <!-- #SHOULD I INCLUDE THAT IN BEAM?-->
      <sound>hitShield2</sound>
      <sound>hitShield3</sound>
   </hitShieldSounds>
   <missSounds>                                        <!-- #essential -->
      <sound>miss</sound>         <!-- #SHOULD I INCLUDE THAT IN BEAM?-->
   </missSounds>
   ...

none of these should be included in weapons of type BEAM, as can be seen by vanilla beam weapons. this guide states "#essential" things, but I believe some of these are not in fact essential (partially because this guide is outdated), and what is essential differs for weapons of different <type>. in general, the vanilla data files are great sources of info, because well that's what this guide is based on!

weapons become artillery weapons when they are loaded into a ship.

let's look at what this means. the federation a has an artillery weapon. let's see where that's defined. let's also look at the weapon.

Code: Select all

<shipBlueprint name="PLAYER_SHIP_FED" layout="fed_cruiser" img="fed_cruiser">
   <!-- description stuff here -->
   <systemList>
      <!-- system stats here -->
      <artillery power="1" room="6" weapon="ARTILLERY_FED"/>
      <!-- system stats here -->
   </systemList>
   <!-- more ship stats here -->
</shipBlueprint>

<weaponBlueprint name="ARTILLERY_FED">
   <type>BEAM</type>
   <title id="weapon_ARTILLERY_FED_title"/>
   <short id="weapon_ARTILLERY_FED_short"/>
   <desc id="weapon_ARTILLERY_FED_desc"/>
   <tooltip id="weapon_ARTILLERY_FED_tooltip"/>
   <damage>1</damage>
   <sp>5</sp>
   <fireChance>1</fireChance>
   <breachChance>0</breachChance>
   <speed>13</speed>
   <cooldown>40</cooldown>
   <power>1</power>
   <cost>0</cost>
   <bp>5</bp>
   <rarity>0</rarity>
   <image>beam_contact</image>
   <length>500</length>
   <launchSounds>
      <sound>beam1</sound>
      <sound>beam1_2</sound>
   </launchSounds>
   <weaponArt>artillery_fed</weaponArt>
</weaponBlueprint>

as you can see it's loaded onto a ship by the <artillery> stat (inside the <systemList> of a <shipBlueprint>), with the weapon's name specified in the weapon attribute. I believe that's all there is to it!

you can also see on the ARTILLERY_FED that it has a <speed> of 13, so there's some idea of what the <speed> stat means.

some last things:
  1. you'll want to change the <image> of a beam to beam_contact. this is the effect you see when the beam hits a ship, or a shield (currently you have it set to laser_light1, the laser projectile, which will probably look rather strange).
  2. the <tooltip> you have should be changed into the exact stats of the weapon, because unlike for regular weapons which don't use the <tooltip> anymore -- deriving that mini description from the weapon's stats -- the artillery weapons will use the <tooltip> and needs it.
    here's how it looks on the federation a:
    Image
    so then also, if you change the cooldown to something other than 40, I'd change that "50 second cooldown" thing (found in text_misc.xml) to "Base cooldown x1.25", then state on the weapon desc, tooltip, or both what the real cooldown (and repeat for the rest of them. I believe the name of that thing is called artillery_1, artillery_2, artillery_3, and artillery_4 (and you can add an artillery_5 if you open that 5th power up as I said earlier).
  3. you can get rid of the <bp> stat, it isn't used for anything.
  4. a <hullBust> of 0 is the default, the same as leaving the stat out. only needs to be included it if you set it to 1.

looks like that's it! as always feel free to ask away more questions, I'm glad to answer them :D
TeamEXAngus
Posts: 48
Joined: Thu May 17, 2018 5:38 am

Re: [Tutorial] New Guide on creating weapons

Postby TeamEXAngus » Thu May 24, 2018 3:26 am

is it essential to call the files my_weapon/data/, etc? my computer won't let me put / in a file name!

Edit: I'm also using slipstream mod manager.
User avatar
Arfy
Posts: 206
Joined: Mon Apr 11, 2016 4:14 am

Re: [Tutorial] New Guide on creating weapons

Postby Arfy » Thu May 24, 2018 4:31 am

TeamEXAngus wrote:is it essential to call the files my_weapon/data/, etc? my computer won't let me put / in a file name!



"my_weapon/data/" is simply just the location/directory of the folder and file--where my_weapon is mod itself and data being the folder that contains .xml files.

Your mod file can be called anything, but the data folder has to be named data.
Discord: ATLAS#9226
TeamEXAngus
Posts: 48
Joined: Thu May 17, 2018 5:38 am

Re: [Tutorial] New Guide on creating weapons

Postby TeamEXAngus » Thu May 24, 2018 4:59 am

Arfy wrote:
TeamEXAngus wrote:is it essential to call the files my_weapon/data/, etc? my computer won't let me put / in a file name!



"my_weapon/data/" is simply just the location/directory of the folder and file--where my_weapon is mod itself and data being the folder that contains .xml files.

Your mod file can be called anything, but the data folder has to be named data.


thanks
TeamEXAngus
Posts: 48
Joined: Thu May 17, 2018 5:38 am

Re: [Tutorial] New Guide on creating weapons

Postby TeamEXAngus » Thu May 24, 2018 7:37 am

I can't seem to get it working! Anyone know what could be going wrong?

File
(Mod Name)/data/blueprints.xml

blueprints.xml:

Code: Select all

<weaponBlueprint name="LASER_PHASE_1">
   <type>LASER</type>
   <title>Phase Laser Mark I</title>
   <short>Phase Laser</short>
   <desc>This laser phases through shields.</desc>
   <tooltip>This laser phases through shields.</tooltip>
   <damage>1</damage>
   <shots>1</shots>
   <sp>5</sp>                           
   <fireChance>3</fireChance>
   <breachChance>0</breachChance>
   <cooldown>10</cooldown>
   <power>3</power>
   <cost>50</cost>
   <bp>2</bp>
   <rarity>1</rarity>
   <image>laser_light1</image>
   <launchSounds>
      <sound>lightLaser1</sound>
      <sound>lightLaser2</sound>
      <sound>lightLaser3</sound>
   </launchSounds>
   <hitShipSounds>
      <sound>hitHull2</sound>
      <sound>hitHull3</sound>
   </hitShipSounds>
   <hitShieldSounds>
      <sound>hitShield1</sound>
      <sound>hitShield2</sound>
      <sound>hitShield3</sound>
   </hitShieldSounds>
   <missSounds>
      <sound>miss</sound>
   </missSounds>
   <weaponArt>laser_burst_1</weaponArt>
</weaponBlueprint>