[Help] Problem with a custom weapon

Discuss and distribute tools and methods for modding. Moderator - Grognak
AquaRegisteel
Posts: 19
Joined: Mon Jul 17, 2017 5:50 pm

[Help] Problem with a custom weapon

Post by AquaRegisteel »

Hi, new modder here :P The inquiries thread is dead so I figured a topic wouldn't hurt.

So I'm having an issue with a weapon that I am trying to make. Basically, I took the BL3 sprites, and gave them a recolour, but I can't get the sprites to appear in the game itself. One of several things happens, mostly that the game defaults to BL2 instead of using my weapon. Sometimes it doesn't appear and is invisible. I'll put the code in here and see if anyone can figure out if the code is wrong or not:

Code: Select all

<weaponBlueprint name="EXPLOSIVE_LASER_3">
   <type>LASER</type>    
   <tip>tip_laser</tip>
   <title>Explosive Laser Mk.III</title>         
   <short>Expl. L III</short>                         
   <desc> High-tech laser that explodes when making contact with ship, high breach and fire chances. Penetrates one shield layer.</desc>                         
   <tooltip>2 shots, 4 damage. High breach/fire chance.</tooltip>         
   <damage>3</damage>
   <shots>2</shots>                 
   <sp>1</sp>                           
   <fireChance>9</fireChance>
   <breachChance>9</breachChance>
   <cooldown>14</cooldown>                      
   <power>4</power>                                    
   <cost>95</cost>                                   
   <rarity>4</rarity>  
   <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>explosive_laser_3</weaponArt>     
</weaponBlueprint>
And here's the animation code too:

Code: Select all

<animSheet name="explosive_laser_mk3" w="300" h="64" fw="25" fh="64">weapons/explosive_laser_3_strip12.png</animSheet>
<weaponAnim name="explosive_laser_3">
    <sheet>explosive_laser_3</sheet>
	<desc length="12" x="0" y="0" />
	<chargedFrame>5</chargedFrame>
	<fireFrame>8</fireFrame>
	<firePoint x="14" y="10" />
	<mountPoint x="6" y="45" />
</weaponAnim>
As a note: the animSheet uses "explosive_laser_mk3", mainly because I've tried it with just "explosive_laser_3" and I've had no luck there, so just imagine I didn't put the "mk" there :P My files for the weapons are all correct, they use the xml.append file type, they're named correctly as "animations.xml.append" and "blueprints.xml.append", so I'm just wondering if I have messed up with the code somewhere.

If anyone could find the issue I'd certainly be grateful, I'm itching to start modding some of my own sprites :D
Image

Repurposed Rebel Hecate II
User avatar
Arfy
Posts: 206
Joined: Mon Apr 11, 2016 4:14 am

Re: [Help] Problem with a custom weapon

Post by Arfy »

This line <animSheet name="explosive_laser_mk3" should be the same as <weaponAnim name="explosive_laser_3"> because then the line "<sheet>explosive_laser_3</sheet>" tries to find the animation sheet of "explosive_laser_3" but cannot find it because the animSheet is different.
Discord: ATLAS#9226
AquaRegisteel
Posts: 19
Joined: Mon Jul 17, 2017 5:50 pm

Re: [Help] Problem with a custom weapon

Post by AquaRegisteel »

Ah, I should have made it more obvious by using it there, but using "explosive_laser_3" in place of "explosive_laser_mk3" seems to still result in issues with the animation. I'll go and check that though, just to make sure :D

EDIT: Yep, using "explosive_laser_3" does result in the weapon becoming invisible.
Last edited by AquaRegisteel on Mon Jul 17, 2017 10:14 pm, edited 1 time in total.
Image

Repurposed Rebel Hecate II
User avatar
Arfy
Posts: 206
Joined: Mon Apr 11, 2016 4:14 am

Re: [Help] Problem with a custom weapon

Post by Arfy »

Also, are you adding in the code into the game's default blueprint.xml and animation.xml? If so, the weapon will not load up, you'll need to make a new FTL File containing blueprints.xml, and animation.xml and the weapons images.
Discord: ATLAS#9226
AquaRegisteel
Posts: 19
Joined: Mon Jul 17, 2017 5:50 pm

Re: [Help] Problem with a custom weapon

Post by AquaRegisteel »

That doesn't seem to be the issue. I've created separate blueprints.xml.append and animations.xml.append files. I've packed all the code files into an FTL file separate from the game's files, I then zip the data and img folders and change the extension to .ftl. It seems SMM finds no issues with me getting it patched into the game too.

Gotta love little mini-headaches, huh?
Image

Repurposed Rebel Hecate II
User avatar
Arfy
Posts: 206
Joined: Mon Apr 11, 2016 4:14 am

Re: [Help] Problem with a custom weapon

Post by Arfy »

Do you have a folder inside of the img folder, called weapons? If not, create one and put your weapon sprite into that folder inside of the img folder.
Discord: ATLAS#9226
AquaRegisteel
Posts: 19
Joined: Mon Jul 17, 2017 5:50 pm

Re: [Help] Problem with a custom weapon

Post by AquaRegisteel »

Yup, I've got that done right. I feel like I've basically done everything right, but there's something I've missed. Is there anything else I can give info on that might help you find the issue?

The Error Checker mod itself finds no issues with my weapon and the code. The image is in the weapons folder inside the img folder.
Image

Repurposed Rebel Hecate II
User avatar
Arfy
Posts: 206
Joined: Mon Apr 11, 2016 4:14 am

Re: [Help] Problem with a custom weapon

Post by Arfy »

Here's a way to check if your weapon is actually in the game, launch Superluminal and load up one of the default ships, and then change the weapon of the ship to your custom weapon.
Discord: ATLAS#9226
AquaRegisteel
Posts: 19
Joined: Mon Jul 17, 2017 5:50 pm

Re: [Help] Problem with a custom weapon

Post by AquaRegisteel »

After quickly grappling with Superliminal, I managed to load the weapon but it shows up as a grey box in the weapon select part, and then it is invisible when it is applied to a ship. I'm not quite sure what is wrong with it :oops:
Image

Repurposed Rebel Hecate II
User avatar
Arfy
Posts: 206
Joined: Mon Apr 11, 2016 4:14 am

Re: [Help] Problem with a custom weapon

Post by Arfy »

Did you correctly put the name of the weapon image in the line <animSheet name="explosive_laser_mk3" w="300" h="64" fw="25" fh="64">weapons/explosive_laser_3_strip12.png</animSheet> ?
Discord: ATLAS#9226
Post Reply