Help with weapon

Discuss and distribute tools and methods for modding. Moderator - Grognak
User avatar
Auron1
Posts: 224
Joined: Thu Sep 01, 2016 7:34 pm

Help with weapon

Postby Auron1 » Mon Oct 03, 2016 8:57 am

Hello,
in the last days I have developed a new weapon for the game, but it doesn't seem to be working. I have followed the tutorial "How to build a weapon", but there must be something wrong somewhere... can you help me?
Below, I will post the 2 .xml.append files. If you need the .png just let me know.

I changed the weapon design, for the bullet and all sounds I am using the standard files for now.

Blueprints.xml.append

Code: Select all

<weaponBlueprint name="STORM_LASER">
   <type>LASER</type>       
   <title>Star-Lord Custom Laser</title>         
   <short>Storm Laser</short>                         
   <desc>A custom weapon created by Rocket Raccoon specifically for Star-Lord. This model was damaged by an extremely powerful ion storm, resulting in a limited bullet-charging capacity. It's unlikely someone can fix that.</desc>                         
   <tooltip>This weapon charges up to three bullets.</tooltip>         
   <damage>1</damage>
   <shots>1</shots>
   <boost>
      <type>shots</type>
      <amount>1</amount>
      <count>3</count>
   </boost>               
   <sp>0</sp> 
   <persDamage>15</persDamage>
   <fireChance>5</fireChance>
   <breachChance>0</breachChance>
   <stun>1</stun>
   <cooldown>8</cooldown>                     
   <power>2</power>                                   
   <cost>120</cost>                                   
   <bp>2</bp>
   <rarity>5</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>storm_laser</weaponArt>     
</weaponBlueprint>


Animations.xml.append

Code: Select all

<animSheet name="storm_laser" w="322" h="64" fw="23" fh="64">weapons/storm_laser.png</animSheet>
<weaponAnim name="storm_laser">
   <sheet>storm_laser</sheet>
   <desc length="14" x="0" y="0"/>
   <chargedFrame>8</chargedFrame>
   <fireFrame>11</fireFrame>
   <firePoint  x="13" y="63"/>
   <mountPoint x="2" y="44"/>
</weaponAnim>
Has anyone ever considered a Warhammer 40,000 Mod for this game? It would be awesome!
User avatar
mr_easy_money
Posts: 625
Joined: Fri May 29, 2015 9:05 pm

Re: Help with weapon

Postby mr_easy_money » Tue Oct 04, 2016 5:37 am

Auron1 wrote:Hello,
in the last days I have developed a new weapon for the game, but it doesn't seem to be working. I have followed the tutorial "How to build a weapon", but there must be something wrong somewhere... can you help me?
Below, I will post the 2 .xml.append files. If you need the .png just let me know.

first of all, it looks like there are several things going on here. i'll try and dissect it, and maybe that will fix some of the issues. I'm not entirely sure what problems you are having as you haven't specified... :|

Auron1 wrote:

Code: Select all

<weaponBlueprint name="STORM_LASER">
   
   ...
   
   <boost>
      <type>shots</type>
      <amount>1</amount>
      <count>3</count>
   </boost>

okay so you're using boost with type shots. I'm not sure how this works, but I believe sleeper service said something about how this could or should work. I'm going to assume it's okay for now. there are some other issues.
Auron1 wrote:

Code: Select all

<persDamage>15</persDamage>

okay, so I think you're misunderstanding here what the persDamage tag does. for every unit of persDamage, the crew damage increases by 15. right now, the crew damage is set at 15 * 15 = 225, which is overkill. if you just want it to do 15 crew damage, you should only have a value of 1 in there.
Auron1 wrote:

Code: Select all

<stun>1</stun>

just a heads up that this means a stun duration of 1 second, not a stunChance of 1. I think you know this but just making sure.
Auron1 wrote:

Code: Select all

   <rarity>5</rarity>                                     
   <weaponArt>storm_laser</weaponArt>     

rarity is set to 5, seems fine and the weaponArt tag looks good. it just has to be the same as the weaponAnim name as that is what it refers to.
Auron1 wrote:Animations.xml.append

Code: Select all

<animSheet name="storm_laser" w="322" h="64" fw="23" fh="64">weapons/storm_laser.png</animSheet>
<weaponAnim name="storm_laser">
   <sheet>storm_laser</sheet>
   <desc length="14" x="0" y="0"/>
   <chargedFrame>8</chargedFrame>
   <fireFrame>11</fireFrame>
   <firePoint  x="13" y="63"/>
   <mountPoint x="2" y="44"/>
</weaponAnim>

okay so this looks fine for the weapon anim and sheet for any regular weapon. I would recommend renaming the file name to include how many frames it has as that is what vanilla does; lets you know how many frames are in the .png file without even opening it. I'm going to assume that you're not referring to any image problems

However, I think the main problem you have is that you are making a weapon that uses the boost tag. I would recommend looking at gentasaurus 's tutorial on weapons with a boost effect. I'm not entirely sure if shots is a valid type for boost, but there is also some missing animation stuff. again, I'm not entirely sure if this will fix your issue as I'm not sure what the issue is.

here is the link: viewtopic.php?f=12&t=29812

for boost type weapons, I think you need a boost tag in the weaponAnim because it's a boost type weapon. this is explained much better in the tutorial, but you need to create a second animation for the boost glow itself...

okay I'm confused here... I think that gentasaurus would do a better job at tackling your issue than me :oops:
User avatar
Auron1
Posts: 224
Joined: Thu Sep 01, 2016 7:34 pm

Re: Help with weapon

Postby Auron1 » Tue Oct 04, 2016 7:44 am

mr_easy_money wrote:first of all, it looks like there are several things going on here. i'll try and dissect it, and maybe that will fix some of the issues. I'm not entirely sure what problems you are having as you haven't specified... :|
...
okay so you're using boost with type shots. I'm not sure how this works, but I believe sleeper service said something about how this could or should work. I'm going to assume it's okay for now. there are some other issues.

Auron1 wrote:

Code: Select all

<persDamage>15</persDamage>


okay, so I think you're misunderstanding here what the persDamage tag does. for every unit of persDamage, the crew damage increases by 15. right now, the crew damage is set at 15 * 15 = 225, which is overkill. if you just want it to do 15 crew damage, you should only have a value of 1 in there.

Auron1 wrote:

Code: Select all

<stun>1</stun>

just a heads up that this means a stun duration of 1 second, not a stunChance of 1. I think you know this but just making sure.

okay so this looks fine for the weapon anim and sheet for any regular weapon. I would recommend renaming the file name to include how many frames it has as that is what vanilla does; lets you know how many frames are in the .png file without even opening it. I'm going to assume that you're not referring to any image problems

However, I think the main problem you have is that you are making a weapon that uses the boost tag. I would recommend looking at gentasaurus 's tutorial on weapons with a boost effect. I'm not entirely sure if shots is a valid type for boost, but there is also some missing animation stuff. again, I'm not entirely sure if this will fix your issue as I'm not sure what the issue is.

here is the link: viewtopic.php?f=12&t=29812

for boost type weapons, I think you need a boost tag in the weaponAnim because it's a boost type weapon. this is explained much better in the tutorial, but you need to create a second animation for the boost glow itself...

okay I'm confused here... I think that gentasaurus would do a better job at tackling your issue than me :oops:


I didn't explain the issue I have because I don't know what's wrong... the weapon just does not appear anywhere. I don't know if there is something more.
Thanks for clarifying how PersDamage works: I thought I had to write the exact amount of damage, not that there is an hidden x15 multiplier. I'll fix that.
As for the stun, yes → it is meant to stun only for 1 second with an (hidden) StunChance=100%.

Now, I think the real issue is the Boost tag, because gentasaurus says there are only 2 types of boost available in game: cooldown and damage. I wanted to add more bullets... I guess it's not possible :|
I'll have to reconfigure my weapon somehow, meanwhile I'll try to figure out what else must be done when using a "boost" tag.

Thank you very much for replying :D
Has anyone ever considered a Warhammer 40,000 Mod for this game? It would be awesome!
User avatar
mr_easy_money
Posts: 625
Joined: Fri May 29, 2015 9:05 pm

Re: Help with weapon

Postby mr_easy_money » Tue Oct 04, 2016 8:24 am

Auron1 wrote:I didn't explain the issue I have because I don't know what's wrong... the weapon just does not appear anywhere. I don't know if there is something more.

oh that must be because the rarity is set to 5. best way to test it out is to just put in some random ship into the same blueprints.xml.append file with one of the weapons changed to your weapon, or if you want to add a weapon to it be sure to increase the "count". that way you can test it directly. my words on the animation are about the boost glow (you know, if the cooldown is changing there's one light for the first time fired, then two after the second time, etc.). I tested the weapon substituting in some random weaponArt just so I can see its stats in action. Just make sure when you use the weapon image you set the right height and width of each frame in the weaponAnim IIRC so that the weapon art doesn't start moving around strangely (remember it's an animation ;) )
interestingly when I put in the burst_laser_1 image (basic laser I think) it was moving around strangely but I think it looks kinda cool tbh

setting rarity to 5 makes it barely able to be found in stores. I have a feeling you meant it this way because of the price? in any case I'll cite Metzelmax's description of the rarity tag from Metzelmax's New guide on creating weapons (source: viewtopic.php?t=17122)

Code: Select all

<rarity>
Sets how rare it is in game.
0 means the weapon will not drop randomly or appear in stores.
1 lowest rarity, meaning that it is very likely to appear in a store or drop.
5 highest rarity. barely ever shows up.
Make sure only to enter values between 0-5 or it might crash.


I get confused frequently because I start answering questions really late for me. it's 4 in the morning here :P.

EDIT: I know you've kinda seen shots doesn't work but maybe it could apply to other types who knows? increase in fire chance, stun duration who knows? maybe that works. or maybe we haven't looked at implementing <shots> as boost correctly. time to catch some Z's
User avatar
Auron1
Posts: 224
Joined: Thu Sep 01, 2016 7:34 pm

Re: Help with weapon

Postby Auron1 » Tue Oct 04, 2016 12:39 pm

mr_easy_money wrote:oh that must be because the rarity is set to 5.
...
setting rarity to 5 makes it barely able to be found in stores. I have a feeling you meant it this way because of the price? in any case I'll cite Metzelmax's description of the rarity tag from Metzelmax's New guide on creating weapons (source: viewtopic.php?t=17122)

Code: Select all

<rarity>
Sets how rare it is in game.
0 means the weapon will not drop randomly or appear in stores.
1 lowest rarity, meaning that it is very likely to appear in a store or drop.
5 highest rarity. barely ever shows up.
Make sure only to enter values between 0-5 or it might crash.


Oh, that's my dumbness striking again. I was sure that rarity=5 → commonest item, while it's actually the contrary (because rarity=0 is an object which cannot be obtained).
I've fixed that and I've created a glow.png to be added. The boost tag now works with cooldown instead of amount of bullets (at least until it is uncovered if there are more boost types undescribed yet).
I have to double check the animation.xml.append file, meanwhile thanks for your help :mrgreen:
Has anyone ever considered a Warhammer 40,000 Mod for this game? It would be awesome!
User avatar
Auron1
Posts: 224
Joined: Thu Sep 01, 2016 7:34 pm

Re: Help with weapon

Postby Auron1 » Tue Oct 04, 2016 4:06 pm

I have worked with both .xml files, here they are:

blueprints.xml.append

Code: Select all

<weaponBlueprint name="STORM_LASER">
   <type>LASER</type>       
   <title>Star-Lord Custom Laser</title>         
   <short>Storm Laser</short>                         
   <desc>A custom weapon created by Rocket Raccoon specifically for Star-Lord. This model was damaged by an extremely powerful ion storm, resulting in a reduced firerate. It's unlikely someone can fix that.</desc>                         
   <tooltip>This weapon charges quicker after every shot.</tooltip>         
   <damage>1</damage>
   <shots>1</shots>
   <boost>
      <type>cooldown</type>
      <amount>1</amount>
      <count>5</count>
   </boost>               
   <sp>0</sp> 
   <persDamage>1</persDamage>
   <fireChance>5</fireChance>
   <breachChance>0</breachChance>
   <stunChance>9</stunChance>
   <stun>1</stun>
   <cooldown>9</cooldown>                     
   <power>2</power>                                   
   <cost>120</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>storm_laser_f14</weaponArt>     
</weaponBlueprint>

<!-- THE KESTREL -->
<!-- LAYOUT = DEFAULT -->
<!-- SHIP ID = 0 -->   
<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="4" 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="storm_laser"/>
      <weapon name="storm_laser"/>
   </weaponList>
   <health amount="30"/>
   <maxPower amount ="8"/>
   <crewCount amount = "3" class="human"/>
</shipBlueprint>


animations.xml.append

Code: Select all

<animSheet name="storm_laser_charge" w="115" h="64" fw="23" fh="64">weapons\storm_laser_glow_f5.png</animSheet>
<anim name="storm_laser_charge">
   <sheet>chainlaser_1_charge</sheet>
   <desc length="5" x="0" y="0"/>
   <time>1.0</time>
</anim>

<animSheet name="storm_laser" w="322" h="64" fw="23" fh="64">weapons/storm_laser_f14.png</animSheet>
<weaponAnim name="storm_laser">
   <sheet>storm_laser</sheet>
   <desc length="14" x="0" y="0"/>
   <chargedFrame>8</chargedFrame>
   <fireFrame>11</fireFrame>
   <firePoint  x="13" y="63"/>
   <mountPoint x="2" y="44"/>
   <boost>storm_laser_glow_f5</boost>
</weaponAnim>


They seem ok to me... but considering my poor skills here, a couple of extra eyes would indeed be useful here! :)
(BTW, I am currently not bothering if the weapon is OP or not, for now I would like it to work!)
Has anyone ever considered a Warhammer 40,000 Mod for this game? It would be awesome!
User avatar
mr_easy_money
Posts: 625
Joined: Fri May 29, 2015 9:05 pm

Re: Help with weapon

Postby mr_easy_money » Tue Oct 04, 2016 8:32 pm

There is something amiss here...; I've only kept the relevant bits
Auron1 wrote:blueprints.xml.append

Code: Select all

<weaponBlueprint name="STORM_LASER">
   ...
   <weaponArt>storm_laser_f14</weaponArt>
</weaponBlueprint>

animations.xml.append

Code: Select all

<animSheet name="storm_laser_charge" w="115" h="64" fw="23" fh="64">weapons\storm_laser_glow_f5.png</animSheet>
<anim name="storm_laser_charge">
   <sheet>chainlaser_1_charge</sheet>
   ...
</anim>

<animSheet name="storm_laser" w="322" h="64" fw="23" fh="64">weapons/storm_laser_f14.png</animSheet>
<weaponAnim name="storm_laser">
   <sheet>storm_laser</sheet>
   ...
   <boost>storm_laser_glow_f5</boost>
</weaponAnim>

The weaponArt tag should match the name of its weaponAnim. so in this case the weaponArt tag should have storm_laser instead of storm_laser_f14. the same thing goes for the boost tag in the weaponAnim relating to the boost anim. in this case the boost tag should have storm_laser_charge instead of storm_laser_glow_f5. you need to use the names of the anims rather than the name of the image, hence why the sheet tag in the weaponAnim tag has the name of the animSheet (even though it's the same name).

I cannot stress how important it is to make sure that the frame height and width (denoted by fh and fw respectively) match each frame of the weapon you're using so that the only part that looks like an animation is the weapon firing. I don't have your images so I can't tell you if it's wrong, but you should test it out for yourself.

everything else looks fine as far as I can tell :)
User avatar
Auron1
Posts: 224
Joined: Thu Sep 01, 2016 7:34 pm

Re: Help with weapon

Postby Auron1 » Tue Oct 04, 2016 8:45 pm

My files are named
storm_laser_f14.png
storm_laser_glow_f5.png

The first is the weapon itself, the other is the glow effect. The f14/f5 parts indicate how many frames there are (as you suggested).

The weapon is called "Storm Laser" (short name).
The mod is named storm_laser.ftl

I have noticed there was a \ instead of / in the file folder. I have fixed that.
however, I have noticed that in the animations.xml.append I have used this code line:

Code: Select all

<sheet>chainlaser_1_charge</sheet>

Is it correct? I guess not...

Those are all the informations needed. Is there something I should fix? :?:
BTW, as you surely have noticed, I have added a custom loadout for the Kestrel, but it's not working. :(
Has anyone ever considered a Warhammer 40,000 Mod for this game? It would be awesome!
User avatar
mr_easy_money
Posts: 625
Joined: Fri May 29, 2015 9:05 pm

Re: Help with weapon

Postby mr_easy_money » Tue Oct 04, 2016 11:29 pm

Auron1 wrote:however, I have noticed that in the animations.xml.append I have used this code line:

Code: Select all

<sheet>chainlaser_1_charge</sheet>

Is it correct? I guess not...

yeah you're right it isn't. for the sheet tag you put in the name of the sheet.
Auron1 wrote:Those are all the informations needed. Is there something I should fix? :?:
BTW, as you surely have noticed, I have added a custom loadout for the Kestrel, but it's not working. :(

oh yeah I didn't see that! the problem you have is quite easily fixable. notice that this is the name of your weapon:

Code: Select all

<weaponBlueprint name="STORM_LASER">

and these are the weapons you loaded into the kestrel:

Code: Select all

<shipBlueprint name="PLAYER_SHIP_HARD" layout="kestral" img="kestral">
   ...
   <weaponList count="2" missiles="8">
      <weapon name="storm_laser"/>
      <weapon name="storm_laser"/>
      </weaponList>
   ...
</shipBlueprint>

notice that the weapon names you loaded in are lowercase. instead of

Code: Select all

<weapon name="storm_laser"/>

you need

Code: Select all

<weapon name="STORM_LASER"/>

because that is the name of your weapon ;) . uppercase and lowercase make all the difference!
User avatar
Auron1
Posts: 224
Joined: Thu Sep 01, 2016 7:34 pm

Re: Help with weapon

Postby Auron1 » Wed Oct 05, 2016 7:33 am

I have tested and retested it over and over, but nothing. My Mod simply won't load.
To further explain, I create the .zip file, then rename it with .ftl extension and move it into the /mod folder within SMM.
The program adds my mod (the only selected) then I launch the game.

Since I've written to modify the Kestrel, I would expect to see it different, but what I see is the very standard model. No signs of my mod. :cry:
Another test I have done was to add my mod inside SuperLuminal: the weapon does not appear either, but the program recognizes the .png images.

• • • - - - • • •
Has anyone ever considered a Warhammer 40,000 Mod for this game? It would be awesome!