Strange Issues with my mod

Discuss and distribute tools and methods for modding. Moderator - Grognak
saobie3
Posts: 24
Joined: Tue Jul 12, 2016 3:03 am

Strange Issues with my mod

Post by saobie3 »

So after getting help with formatting and such so that my experimental weapon is in the game, i got a few rather odd issues. Im not new to creating weapons and these issues have never once come up before. However, its safe to note that the weapon im making is a Burst weapon, with parameters based off the Flak. Its my first attempt at that type of weapon.

Anyways, this is probably unrelated to why it functions odd, but ingame its displayed as a Basic Laser, and does not use the image files i made for it (which are basically recolored copies of the flagship missile weapon).

This next one is particularily odd, i didnt know this would even be a possibility. But ingame after ignoring its odd behavior with imaging, i wanted to see if its mechanics worked. To my surprise, once fully charged (and it takes a while to do so, i didnt hold out well with just this weapon while it charged) it did nothing. Its bar remained full and did not fire, the symbol also did not turn green like a weapon ready to fire does. Im absolutely unsure as to why this happened

Any help is greatly appreciated, i have other ideas for burst style weapons and plan to test the limits, but if i cant even copy the basics i dont stand a chance xD I need to learn where it went wrong
User avatar
Gencool
Posts: 409
Joined: Sun Jun 16, 2013 1:21 pm

Re: Strange Issues with my mod

Post by Gencool »

Ok, so, some things to double check:

Blueprints.xml:
Does the weapon blueprint reference the correct weapon art?

Animations.xml:
Does the animation blueprint reference the correct sheet blueprint?
Does the sheet blueprint reference the correct image file (check the path and filetype are correct)

Assuming that's all correct, there's still a few pitfalls new modders can stumble into, especially with the AE content.
Flak weapons can be particularly tricky.

In the dlcanimations.xml file, find the flak animation blueprint. You should notice that it has a few more strings and dependencies compared to a normal weapon. Make sure your code lines up appropriately.

It's also worth noting that there isn't a way of designating the frame length for each shot's animation. The game attempts to set this up automatically.

For example, say your sheet is 11 frames long, and the weapon has 3 charges.
If the 'charged frame' is 1 (the second image), the game takes the rest of the frames in the sequence (9 in this case) and devides them amongst the charges (so this weapon gets 3 frames for each shot)

As far as I'm aware, the 'fire frame' needs to be within the range of the first loop, otherwise the weapon won't fire. In this case, it should be set to 2, 3 or 4.
In practice, I tend to put the fire frame as the one directly after the charged frame (in this case I'd set it to 2), as this is how all the weapons in the game are coded, and prefer to play cautious.


Good luck!
ImageImageImage
- Gencool (aka Puppetsquid) -- I make weird stuff
saobie3
Posts: 24
Joined: Tue Jul 12, 2016 3:03 am

Re: Strange Issues with my mod

Post by saobie3 »

I had someone else hlp me with making my weapon fire like a shotgun and he appnded the code and gave it back to me, i havnt touched it since then.

This is how my code looks for the weapon animation:

<weaponAnim name="missile_barrage">
<sheet>missile_barrage</sheet>
<desc length="3" x="0" y="0" />
<chargedFrame>1</chargedFrame>
<fireFrame>2</fireFrame>
<firePoint x="16" y="20" />
<mountPoint x="0" y="0" />
<chargeImage>weapons/missile_barrage_glow.png</chargeImage>
</weaponAnim>

And this is Flak 1:

<weaponAnim name="shotgun">
<sheet>shotgun</sheet>
<desc length="8" x="0" y="0"/>
<chargedFrame>1</chargedFrame>
<fireFrame>3</fireFrame>
<firePoint x="12" y="22"/>
<mountPoint x="3" y="33"/>
<chargeImage>weapons/shotgun_glow.png</chargeImage>
</weaponAnim>

I dont see any differences or things lft out. On top of that my animation and blueprint files reference the correct files i made for it. This genuinelly sucks lol
User avatar
Gencool
Posts: 409
Joined: Sun Jun 16, 2013 1:21 pm

Re: Strange Issues with my mod

Post by Gencool »

Ah, sorry, I wrote flak, I meant Charge. I was half asleep when I wrote that, sorry!

How about your <animSheet> and <weaponBlueprint>?
ImageImageImage
- Gencool (aka Puppetsquid) -- I make weird stuff
saobie3
Posts: 24
Joined: Tue Jul 12, 2016 3:03 am

Re: Strange Issues with my mod

Post by saobie3 »

Here, iv got an idea. I could send you the mods dropbox link, could you take a look and try to find whats causing the issue?

https://www.dropbox.com/s/xtgyelk25ueva ... k.zip?dl=0
User avatar
Gencool
Posts: 409
Joined: Sun Jun 16, 2013 1:21 pm

Re: Strange Issues with my mod

Post by Gencool »

Heh, I kinda prefer not fixing mods for people - it's much easier to learn when you figure out the issues yourself - but I had a quick glance over the files and there's a few issues.

1) Double check your folder layout - they should match the game's own directories (your data and img folders are correct, but you need another folder in the img directory - have a look at other mod files if it helps)
2) Check the spelling of your file names, especially the data files (the names should match the original .xml filenames exactly, just with .append added at the end)
3) Try not to have any floating values in your .xml files - for example, in your blueprints.xml.append you shouldn't have any top level tags which aren't <shipBlueprint>, <weaponBlueprint>
ImageImageImage
- Gencool (aka Puppetsquid) -- I make weird stuff
saobie3
Posts: 24
Joined: Tue Jul 12, 2016 3:03 am

Re: Strange Issues with my mod

Post by saobie3 »

1: In other weapon mods iv dissected they have custom audio, and specifically in the img fill they have custom effects. I dont believe iv specified custom effects for min, nor do i intend to make any. Should i just make an empty effects folder? Otherwise i dont really see whats missing.

2: I had help with this issue, as at first the mod wasnt being appended to the game because the files were incorrectly named. Im fairly sure the names are correct... but this suggesting makes me suspicious. Still iv double checkd and cant find anything wrong

3: Im not sure what qualifies as a top level tag. The only tag is the weapon tag. At least thats the only one i discern, as im not entirely sure what dictates being a tag. Cross referenced with a different weapon i made that (sortav) works, nothing stands out
saobie3
Posts: 24
Joined: Tue Jul 12, 2016 3:03 am

Re: Strange Issues with my mod

Post by saobie3 »

Im gunna add that iv added my Thermal Beam custom weapon to the game. It works exactly as planned in every way, shape and form. I follow th same protocol with making weapons, i dont understand why one works and one dosnt...
saobie3
Posts: 24
Joined: Tue Jul 12, 2016 3:03 am

Re: Strange Issues with my mod

Post by saobie3 »

Oy this is a landslide lol

So i tried making my own version of the CnC mods Ion Cannon. I gave min a neat graphic that should look pretty much like chaotic matter building up. The problem is it uses th Ion Cannons animation, despite me prodiving my own and telling it to use them. It also dosnt use the descriptions i put in. It dos however use the stats i provided
User avatar
Gencool
Posts: 409
Joined: Sun Jun 16, 2013 1:21 pm

Re: Strange Issues with my mod

Post by Gencool »

Using the stats and not the descriptions *is* odd.

Ok, so, if you can't actually see the problems, I'll help out a bit more. Bare with me, kay?

-----

This is the directory structure I get when I open the .zip file above:

Code: Select all

Missile Barrage Rack.zip/
> data/
> > animation.xml.append
> > AutoBluprint.xml.append
> > blueprint.xml.append
> img/
> > missile_barrage.png
> > missile_barrage_glow.png
> > missile_barrage_strip.png
So, firstly, let's fix the filenames;
  • animations.xml.append
  • autoBlueprints.xml.append
  • blueprints.xml.append
Currently you're appending files that don't exist in the game's directory.
Sometimes you'll get away with this - the game loads all the files in its directory, so your new xml files will get swept up - but other times the game might search for a string in a specific file. This might be why the stats loaded for your weapon, but not the descriptions - it's specifically calling a string from the 'blueprints.xml' file, but your description is in a 'blueprint.xml' file.

Usually it's best to play safe and follow the existing formatting rules.

-----


Next issue, opening up the animations file:

Code: Select all

<animSheet name="missile_barrage" w="99" h="65" fw="33" fh="65">weapons/missile_barrage_strip3.png</animSheet>

<weaponAnim name="missile_barrage">
	<sheet>missile_barrage</sheet>
	<desc length="3" x="0" y="0" />
	<chargedFrame>1</chargedFrame>
	<fireFrame>2</fireFrame>
	<firePoint x="16" y="20" />
	<mountPoint x="0" y="0" />
	<chargeImage>weapons/missile_barrage_glow.png</chargeImage>
</weaponAnim>

<animSheet name="missile_barrage" w="32" h="80" fw="32" fh="80">weapons/missile_barrage.png</animSheet>
<anim name="missile_barrage">
	<sheet>missile_barrage</sheet>
	<desc length="1" x="0" y="0" />
	<time>1</time>
</anim>
First problem here: notice how all the .png files it's calling for start with "weapons/"
This means the game is looking for "FTLroot/img/weapons/(image name).png"
The problem is, your files are all at "FTLroot/img/(image name).png"

To fix this, you can remove "weapons/" from the image strings, but it's probably better to move the image files into a 'weapons' folder, just for consistency's sake.
To be honest, you could put them in "img/myModName/adamWestsLeftSock/JernSnerNersNuthin/", just so long as the paths match up and the images are nested somewhere in the img folder.

The second problem is a little harder to spot; you're assigning the same name to two different animSheets. You need to differentiate them somehow, adding something like "_weapon" or "_projectile" to one or both of them.

You also need to make sure that these names are properly reflected in the blueprints.xml.append file; currently it contains the lines

Code: Select all

<weaponArt>missiles_barrage</weaponArt> 
...
<projectiles>
      <projectile count="6" fake="false">missile_burst</projectile>
</projectiles>
The first of which is looking for a weaponAnim that doesn't exist, and the second of which is calling the same anim the Swarm Missile uses, rather than the one you made.

-----

Lastly, both of your blueprint xmls have "<name>MISSILES_BARRAGE</name>" as the very first line.
This is what I mean by 'Top Level' - it's not nested in another tag (when I say tag I mean <thingsLikeThis>)

Now, there's no harm in that being there - it isn't going to get called at any time so it shouldn't mess anything up - but it's kinda just floating around, lost, and it's bad practice.

The autoBlueprint file consists solely of that one string. I'm afraid I'm not entirely sure why.


Hopefully that clears some things up.
I know code can be quite daunting - I'm a touch dyslexic and often have to proof read my stuff twenty times before I notice errors.
It gets easier as you learn the system, don't worry.



One more thing: I went through all of this to test it, and the weapon still comes up as a black box.
I think this might be a .png encoding error, but it's currently 2:30am, so hopefully someone else can help with this.

One other one more thing: The missile barrage uses 6 missiles.
I know it fires 6 missiles, but that's a hell of a cost. Every missile weapon in the game costs 1 ammo, even the ones that fire two or three missiles at a time.
At most this thing should cost 2 missiles per volley, especially with the 23-second charge time.
ImageImageImage
- Gencool (aka Puppetsquid) -- I make weird stuff
Post Reply