Weapon Mod not working...

Discuss and distribute tools and methods for modding. Moderator - Grognak
Giscard
Posts: 26
Joined: Sat Aug 02, 2014 7:08 am
Location: Australia

Weapon Mod not working...

Postby Giscard » Fri Aug 08, 2014 9:21 am

Hey, I have just watched a tutorial and also referenced to other mods' files to create an awesome weapon. For me to be able to see if it works, I would have to create a ship with that attached. So I decided to use the 'Include Mod' option in 'Superluminal' (I have used it before to creates custom ships for CE) to find that my custom weapon isn't there in the weapon list. It may be because I have not created the weapon properly.

The file is being hosted at this link: http://www.filedropper.com/customweapon
It will be as an attachment .zip file.

All advice is highly appreciated!
Giscard,
If u want a mod from me email me.
They are not compatible with
AE btw
They are:
Maxed out your face! (This is a mod when all the starting ships are maxed, but so are the enemy ships!)
I also have a few extra ship layouts if you want!
User avatar
kartoFlane
Posts: 1480
Joined: Mon Jan 14, 2013 10:20 pm

Re: Weapon Mod not working...

Postby kartoFlane » Fri Aug 08, 2014 1:22 pm

Well, your blueprints.xml.append is named with an upper-case B, which, IIRC, will cause both editor and FTL to not recognise it. On top of that, your animation file's extension is xm (should be xml).

Also, your autoBlueprints.xml.append file contains just the <name> tag with your weapon's name in it -- these tags should be nested inside <blueprintList> tags (you might want to use SMM's <mod: /> tags to modify blueprintLists without overriding them)

Giscard wrote:So I decided to use the 'Include Mod' option in 'Superluminal'

That makes it sound like you're using the old, pre-AE version of the editor... You might want to get the updated one :)
Superluminal2 - a ship editor for FTL
Giscard
Posts: 26
Joined: Sat Aug 02, 2014 7:08 am
Location: Australia

Re: Weapon Mod not working...

Postby Giscard » Sat Aug 09, 2014 9:04 am

kartoFlane wrote:Well, your blueprints.xml.append is named with an upper-case B, which, IIRC, will cause both editor and FTL to not recognise it. On top of that, your animation file's extension is xm (should be xml).

Okay, how silly of me. I will fix that!

kartoFlane wrote:Also, your autoBlueprints.xml.append file contains just the <name> tag with your weapon's name in it -- these tags should be nested inside <blueprintList> tags...

Could you please allaborate? I do not understand what u mean by -- these tags should be nested inside <blueprintList> tags...

kartoFlane wrote:(you might want to use SMM's <mod: /> tags to modify blueprintLists without overriding them)

Er... I already own SMM if that is what you are referring.

kartoFlane wrote:
Giscard wrote:So I decided to use the 'Include Mod' option in 'Superluminal'

That makes it sound like you're using the old, pre-AE version of the editor... You might want to get the updated one :)
[/quote]
I do not own a copy of AE, so if I was to get the Superluminal AE
A: Can it still just do the stuff that the original does
B: If not, then can I run the editors alongside each other

All replies are appreciated! :D
Giscard,
If u want a mod from me email me.
They are not compatible with
AE btw
They are:
Maxed out your face! (This is a mod when all the starting ships are maxed, but so are the enemy ships!)
I also have a few extra ship layouts if you want!
User avatar
kartoFlane
Posts: 1480
Joined: Mon Jan 14, 2013 10:20 pm

Re: Weapon Mod not working...

Postby kartoFlane » Sat Aug 09, 2014 10:19 am

Giscard wrote:Could you please allaborate? I do not understand what u mean by -- these tags should be nested inside <blueprintList> tags...

Well, by "nested inside <blueprintList> tags", I mean this (I'll use WEAPONS_STANDARD as an example):

Code: Select all

<blueprintList name="WEAPONS_STANDARD">
    <!-- previous entries -->
    <name>GISCARD</name>
</blueprintList>

...however, doing it that way would override the WEAPONS_STANDARD list, thus making your mod incompatible with other mods that override this weapon list. To avoid that, you can use special <mod: /> tags that were introduced by SMM:

Code: Select all

<mod:findName type="blueprintList" name="WEAPONS_STANDARD">
    <mod-append:name>GISCARD</mod-append:name>
</mod:findName>

Doing it that way will allow your mod to play nice with other mods, on top of not requiring you to copy the entire WEAPONS_STANDARD list into your mod.

...however, if the weapon you're adding is only supposed to be usable by the player, then you don't have to mess with these lists at all, and you can omit the autoBlueprints.xml file completely.

Giscard wrote:I do not own a copy of AE, so if I was to get the Superluminal AE

Well, Advanced Edition is a free update available to everyone who owns a copy of FTL, so there's no way you can't have that ;) It's just a matter of updating your game

Giscard wrote:A: Can it still just do the stuff that the original does
B: If not, then can I run the editors alongside each other

A: yes, and it's better at it. It should work with pre-AE FTL, but I haven't tried that (I guess that the old version will simply ignore the tags that it doesn't recognise, but there might be a problem with graphics not lining up, since that was changed in AE)
B: yes
Superluminal2 - a ship editor for FTL
Giscard
Posts: 26
Joined: Sat Aug 02, 2014 7:08 am
Location: Australia

Re: Weapon Mod not working...

Postby Giscard » Sat Aug 09, 2014 11:12 am

kartoFlane wrote:
Giscard wrote:Could you please allaborate? I do not understand what u mean by -- these tags should be nested inside <blueprintList> tags...

Well, by "nested inside <blueprintList> tags", I mean this (I'll use WEAPONS_STANDARD as an example):

Code: Select all

<blueprintList name="WEAPONS_STANDARD">
    <!-- previous entries -->
    <name>GISCARD</name>
</blueprintList>

...however, doing it that way would override the WEAPONS_STANDARD list, thus making your mod incompatible with other mods that override this weapon list. To avoid that, you can use special <mod: /> tags that were introduced by SMM:

Code: Select all

<mod:findName type="blueprintList" name="WEAPONS_STANDARD">
    <mod-append:name>GISCARD</mod-append:name>
</mod:findName>

Doing it that way will allow your mod to play nice with other mods, on top of not requiring you to copy the entire WEAPONS_STANDARD list into your mod.

...however, if the weapon you're adding is only supposed to be usable by the player, then you don't have to mess with these lists at all, and you can omit the autoBlueprints.xml file completely.

Giscard wrote:I do not own a copy of AE, so if I was to get the Superluminal AE

Well, Advanced Edition is a free update available to everyone who owns a copy of FTL, so there's no way you can't have that ;) It's just a matter of updating your game

Giscard wrote:A: Can it still just do the stuff that the original does
B: If not, then can I run the editors alongside each other

A: yes, and it's better at it. It should work with pre-AE FTL, but I haven't tried that (I guess that the old version will simply ignore the tags that it doesn't recognise, but there might be a problem with graphics not lining up, since that was changed in AE)
B: yes

It is just meant to be a cool weapon only usable by the player.
Also, so... can I just paste (what you have written) into one of the files, and if so, where do I paste them? Sorry, I am kinda a noob when it comes to modding weapons and events, however I am experienced with ships etc.
If u want a mod from me email me.
They are not compatible with
AE btw
They are:
Maxed out your face! (This is a mod when all the starting ships are maxed, but so are the enemy ships!)
I also have a few extra ship layouts if you want!
User avatar
NarnKar
Posts: 778
Joined: Thu Jun 19, 2014 4:24 pm
Location: this forum
Contact:

Re: Weapon Mod not working...

Postby NarnKar » Mon Aug 11, 2014 6:10 pm

Setting something to be player only is pretty easy, actually.

You just create a blueprints.xml.append with only your blueprint in it, no blueprint list or anything. (And animations.xml.append, of course.) In your blueprint, you specify the rarity of the item as 0, so it won't appear in any shops. Then, in a separate ship mod or starting beacon mod, you add the new weapon as one of the starting weapons or the event reward.
Giscard
Posts: 26
Joined: Sat Aug 02, 2014 7:08 am
Location: Australia

Re: Weapon Mod not working...

Postby Giscard » Tue Aug 12, 2014 7:20 am

NarnKar wrote:Setting something to be player only is pretty easy, actually.

You just create a blueprints.xml.append with only your blueprint in it, no blueprint list or anything. (And animations.xml.append, of course.) In your blueprint, you specify the rarity of the item as 0, so it won't appear in any shops. Then, in a separate ship mod or starting beacon mod, you add the new weapon as one of the starting weapons or the event reward.


Not meaning to be ungrateful, but I have already done this (don't really care about the shop thing) and I was asking about where do I paste

Code: Select all

the blueprint list stuff
but u said that I don't need it. Then can someone tell me why the bloody weapon looks and sounds soo retarted?! Try it for yourself.
The shiphttp://www.filedropper.com/playershiphard with the weapon on it.
The weaponhttp://www.filedropper.com/customweaponv2 package.
(I suggest patching the weapon first)
If u want a mod from me email me.
They are not compatible with
AE btw
They are:
Maxed out your face! (This is a mod when all the starting ships are maxed, but so are the enemy ships!)
I also have a few extra ship layouts if you want!
User avatar
NarnKar
Posts: 778
Joined: Thu Jun 19, 2014 4:24 pm
Location: this forum
Contact:

Re: Weapon Mod not working...

Postby NarnKar » Tue Aug 12, 2014 4:38 pm

The blueprint list specifies which weapons FTL can use. By putting a blueprint list in your blueprints.xml.append, you override the pre-existing list, meaning that the only weapon anyone can use would be your Giscard. Since the Giscard is player-only, this means that all other opponent ships will call weapons that aren’t on the list, meaning that they won’t have any weapons, and the entire house of cards collapses.

Since we don’t want to do that, we instead add just the blueprint. Adding the blueprint itself to blueprints.xml.append will add it to the existing list within FTL’s blueprints.xml.

But none of this has to do with your weapon errors. The reason your weapon sounds and appears incorrectly is because of problems within the blueprint of the weapon itself. For example,

Code: Select all

<weaponBlueprint name="GISCARD">
   <type>LASER</type>
   <flavorType>Antipersonnel Laser</flavorType>
   <title>Z Pierce</title>
   <short>Z P.</short>
   <desc>This advanced weapon will destroy and disable anything in its path!</desc>
   <tooltip>Fires 3 lasers; does 2 ion; does 3 personal damage; with a chance to breech</tooltip>
   <persDamage>3</persDamage>
   <damage>0</damage>
   <ion>2</ion>
   <shots>3</shots>
   <sp>3</sp>
   <fireChance>0</fireChance>
   <breachChance>3</breachChance>
   <cooldown>10</cooldown>
   <power>2</power>
   <cost>60</cost>
   <bp>2</bp>
   <rarity>2</rarity>
   <image>giscard</image>
   <launchSounds>
      <sound>giscardfire</sound>
   </launchSounds>
   <hitShipSounds>
      <sound>giscardaudio</sound>
   </hitShipSounds>
   <hitShieldSounds>
      <sound>giscardaudio</sound>
   </hitShieldSounds>
   <missSounds>
      <sound>miss</sound>
   </missSounds>
   <weaponArt>giscard</weaponArt>
</weaponBlueprint>

<image>refers to the bullet animation, not the weapon itself.
<weaponArt>giscard refers to your gun animation.
But it appears that in your animations.xml.append, you name the bullet, explosion, and weapon animation sheets all as “giscard”, which means that they override each other. This explains many of your visual errors. I’ll go into further detail below.

First, your weapon itself.
This is what you have:

Code: Select all

 <animSheet name="giscard" w="32" h="80" fw="32" fh="80">weapons/giscard.png</animSheet>
<weaponAnim name="giscard">
   <sheet>giscard</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/giscard_glow.png</chargeImage>
</weaponAnim>

FTL’s coding expects an image called giscard_strip8.png, but your gun image is named giscard.png.
The desclength tag should equal 8, because there’s 8 frames. (Disregard x=0, y=0 for now.)
w, h, fw, and fh should change: these specify width of image, height of image, frame width, and frame height respectively. Your image is 240*60, and each frame is 30*60.

Here, the weaponAnim refers to and summons the animSheet “giscard”, and that animSheet refers to the weapon image itself.
But in your code…

Code: Select all

 <animSheet name="giscard" w="75" h="43" fw="25" fh="43">effects/giscard_explosion.png</animSheet>
<animSheet name="giscard" w="200" h="20" fw="50" fh="20">weapons/laser_light2_strip4.png</animSheet>
<animSheet name="giscard" w="32" h="80" fw="32" fh="80">weapons/giscard.png</animSheet>

All three of your animSheets—bullet, weapon, and explosion—are all named “giscard”. And this is very bad, because when your weaponAnim asks for the “giscard” animSheet, it won’t know which one to call for.

So let’s rename the animSheets when we go forward.

Onto the Explosions! These are actually covered inside the blueprint itself.

Code: Select all

<weaponBlueprint=”giscard”….
….
    <explosion>giscard_explosion</explosion>
    <weaponArt>giscard</weaponart>
</weaponBlueprint>

Now your giscard weaponBlueprint will ask for the explosion art sheet. This should look something like:

Code: Select all

<animSheet name=”giscard_explosion” w=”your dimensions here”….>effects/giscard_explosion.png </animsheet>
<anim name=”giscard_explosion”
    <sheet>giscard_explosion</sheet>
    <desc length=”however many frames you have”…./>
    <time>how long the animation is</time>
</anim>

Here, I’ve renamed the animSheet to “giscard_explosion”, so we don’t get naming conflict errors.

Now, onto the bullet. Here, it looks like you’ve borrowed FTL’s laser_light1 sheet. So you can just reference the laser_light1 sheet, and don’t need to add your own custom animation.

Code: Select all

<weaponBlueprint=”giscard”…

    <image>laser_light1</image>

</weaponBlueprint>


Now, onto the audio!

If your sounds are just copied from the game, then you can just reference a default sound sheet.
Assuming they’re not…

Create a sounds.xml.append for your custom sound. Inside, you create and declare your custom sound:

Code: Select all

 <YOUR SOUND NAME  volume="2">weapons/your_sound_filename.ogg</YOUR SOUND NAME>


And within your weaponBlueprint, you reference your custom sound. It appears that you’ve done that already, so I won’t get into that. Here, your problem was a complete absence of sounds.xml.append

And with these tips, you should be able to assemble a working weapon together.

As for miscellaneous comments…
I recognize the Giscard gun sheet from Captain’s Edition (you use the sheet of the Advanced Phase Ion); please be sure to credit Sleeper Service for the artwork in your mod.
You didn’t actually set the <rarity> tag within the <weaponBlueprint> to 0, which means that you’ll be able to purchase the Giscard at shops.
You don’t need an autoBlueprints.xml.append.
And please don’t call things “retarded”. While I understand your frustration, using that word isn’t very professional.
Giscard
Posts: 26
Joined: Sat Aug 02, 2014 7:08 am
Location: Australia

Re: Weapon Mod not working...

Postby Giscard » Wed Aug 13, 2014 6:49 am

NarnKar wrote:The blueprint list specifies which weapons FTL can use. By putting a blueprint list in your blueprints.xml.append, you override the pre-existing list, meaning that the only weapon anyone can use would be your Giscard. Since the Giscard is player-only, this means that all other opponent ships will call weapons that aren’t on the list, meaning that they won’t have any weapons, and the entire house of cards collapses.

Since we don’t want to do that, we instead add just the blueprint. Adding the blueprint itself to blueprints.xml.append will add it to the existing list within FTL’s blueprints.xml.

But none of this has to do with your weapon errors. The reason your weapon sounds and appears incorrectly is because of problems within the blueprint of the weapon itself. For example,

Code: Select all

<weaponBlueprint name="GISCARD">
   <type>LASER</type>
   <flavorType>Antipersonnel Laser</flavorType>
   <title>Z Pierce</title>
   <short>Z P.</short>
   <desc>This advanced weapon will destroy and disable anything in its path!</desc>
   <tooltip>Fires 3 lasers; does 2 ion; does 3 personal damage; with a chance to breech</tooltip>
   <persDamage>3</persDamage>
   <damage>0</damage>
   <ion>2</ion>
   <shots>3</shots>
   <sp>3</sp>
   <fireChance>0</fireChance>
   <breachChance>3</breachChance>
   <cooldown>10</cooldown>
   <power>2</power>
   <cost>60</cost>
   <bp>2</bp>
   <rarity>2</rarity>
   <image>giscard</image>
   <launchSounds>
      <sound>giscardfire</sound>
   </launchSounds>
   <hitShipSounds>
      <sound>giscardaudio</sound>
   </hitShipSounds>
   <hitShieldSounds>
      <sound>giscardaudio</sound>
   </hitShieldSounds>
   <missSounds>
      <sound>miss</sound>
   </missSounds>
   <weaponArt>giscard</weaponArt>
</weaponBlueprint>

<image>refers to the bullet animation, not the weapon itself.
<weaponArt>giscard refers to your gun animation.
But it appears that in your animations.xml.append, you name the bullet, explosion, and weapon animation sheets all as “giscard”, which means that they override each other. This explains many of your visual errors. I’ll go into further detail below.

First, your weapon itself.
This is what you have:

Code: Select all

 <animSheet name="giscard" w="32" h="80" fw="32" fh="80">weapons/giscard.png</animSheet>
<weaponAnim name="giscard">
   <sheet>giscard</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/giscard_glow.png</chargeImage>
</weaponAnim>

FTL’s coding expects an image called giscard_strip8.png, but your gun image is named giscard.png.
The desclength tag should equal 8, because there’s 8 frames. (Disregard x=0, y=0 for now.)
w, h, fw, and fh should change: these specify width of image, height of image, frame width, and frame height respectively. Your image is 240*60, and each frame is 30*60.

Here, the weaponAnim refers to and summons the animSheet “giscard”, and that animSheet refers to the weapon image itself.
But in your code…

Code: Select all

 <animSheet name="giscard" w="75" h="43" fw="25" fh="43">effects/giscard_explosion.png</animSheet>
<animSheet name="giscard" w="200" h="20" fw="50" fh="20">weapons/laser_light2_strip4.png</animSheet>
<animSheet name="giscard" w="32" h="80" fw="32" fh="80">weapons/giscard.png</animSheet>

All three of your animSheets—bullet, weapon, and explosion—are all named “giscard”. And this is very bad, because when your weaponAnim asks for the “giscard” animSheet, it won’t know which one to call for.

So let’s rename the animSheets when we go forward.

Onto the Explosions! These are actually covered inside the blueprint itself.

Code: Select all

<weaponBlueprint=”giscard”….
….
    <explosion>giscard_explosion</explosion>
    <weaponArt>giscard</weaponart>
</weaponBlueprint>

Now your giscard weaponBlueprint will ask for the explosion art sheet. This should look something like:

Code: Select all

<animSheet name=”giscard_explosion” w=”your dimensions here”….>effects/giscard_explosion.png </animsheet>
<anim name=”giscard_explosion”
    <sheet>giscard_explosion</sheet>
    <desc length=”however many frames you have”…./>
    <time>how long the animation is</time>
</anim>

Here, I’ve renamed the animSheet to “giscard_explosion”, so we don’t get naming conflict errors.

Now, onto the bullet. Here, it looks like you’ve borrowed FTL’s laser_light1 sheet. So you can just reference the laser_light1 sheet, and don’t need to add your own custom animation.

Code: Select all

<weaponBlueprint=”giscard”…

    <image>laser_light1</image>

</weaponBlueprint>


Now, onto the audio!

If your sounds are just copied from the game, then you can just reference a default sound sheet.
Assuming they’re not…

Create a sounds.xml.append for your custom sound. Inside, you create and declare your custom sound:

Code: Select all

 <YOUR SOUND NAME  volume="2">weapons/your_sound_filename.ogg</YOUR SOUND NAME>


And within your weaponBlueprint, you reference your custom sound. It appears that you’ve done that already, so I won’t get into that. Here, your problem was a complete absence of sounds.xml.append

And with these tips, you should be able to assemble a working weapon together.

As for miscellaneous comments…
I recognize the Giscard gun sheet from Captain’s Edition (you use the sheet of the Advanced Phase Ion); please be sure to credit Sleeper Service for the artwork in your mod.
You didn’t actually set the <rarity> tag within the <weaponBlueprint> to 0, which means that you’ll be able to purchase the Giscard at shops.
You don’t need an autoBlueprints.xml.append.
And please don’t call things “retarded”. While I understand your frustration, using that word isn’t very professional.


Okay, this is a lot to take in and respond to.
First. I appreciate all of this help, and I had NO idea that there was so much extra to do. The sound.xml etc. wasn't even mentioned in the tutorial, so thankyou.
Second. This is all very complicated and I do not even understand a couple of the things u r mentioning.
Third. I apologise for using 'retarted'
Fourth. I wasn't even intending to really release/use this in another mod, I just wanted to make this so I have a working template if I wanted to do something similar. (thus I completely forgot to thank Sleeper Survice [I actually got a lot of the stuff that wasn't mentioned in the tutorial from CE's files])
Fifth. I shall try and put it all together, but I will probably stuff something, lol. (Oh and did i mention that i am a 13yr old boy just sayin')

If i have time to edit this post then i will include the details of what i completely don't understand...

EDIT: This seams way to complicated etc. I would appreciate it if you could put all the puzzle pieces together for me, this will help for me in the future, as I will have a working template.
If u want a mod from me email me.
They are not compatible with
AE btw
They are:
Maxed out your face! (This is a mod when all the starting ships are maxed, but so are the enemy ships!)
I also have a few extra ship layouts if you want!
Giscard
Posts: 26
Joined: Sat Aug 02, 2014 7:08 am
Location: Australia

Re: Weapon Mod not working...

Postby Giscard » Fri Aug 22, 2014 10:51 am

I have decided to try a new mod from scrap. It is another weapon mod. I have followed all your instructions and knowledge that I know. And yet, the explosion (that I got from CE from Sleeper Service), and the bullet, and the launch sound, do not work.
All advice is appreciated.
NOTE: This is for AE now, as i own it and the mod is compatible with it so far, even though a few bits r missing. (I havn't tried it on vanilla ftl. Oh, and also on the ship that comes with, don't activate the backup battery. It crashes the game lol)
The new weapon. http://www.filedropper.com/proppercustomweapon
The ship with the weapon on it. http://www.filedropper.com/propperweaponmodship

All the best, Giscard! :D

EDIT: (I edited the sounds.xml and added the bullet file just to make it that much easier. It is here: http://www.filedropper.com/proppercustomweaponv2

Another EDIT: (I edited the animations.xml again, including the explosion 'anim name' stuff etc and an error popped up.
Error: Image
The one with the animations edited (with the patching error): http://www.filedropper.com/proppercustomweaponv3notworking
EDIT: just realised i left out '>' at the end of that line and also i had to change ” to "

NOTE: This is the fixed file that is perfect except for the fact that the bullet animation and the launch sound do not work! Link: http://www.filedropper.com/proppercustomweaponv5
If u want a mod from me email me.
They are not compatible with
AE btw
They are:
Maxed out your face! (This is a mod when all the starting ships are maxed, but so are the enemy ships!)
I also have a few extra ship layouts if you want!

Who is online

Users browsing this forum: No registered users and 47 guests