Page 1 of 1

Replacing weapon art/animations help

Posted: Thu Aug 08, 2013 6:18 am
by AssKickerson
I tried replacing the default laser art but it crashes everytime. Apparently its a problem with the animations.
<animSheet name="laser_burst_2" w="330" h="65" fw="22" fh="65">weapons/laser2_strip12.png</animSheet>
<animSheet name="laser_burst_3" w="400" h="75" fw="25" fh="75">weapons/laser3_strip12.png</animSheet>
<animSheet name="beam_fire" w="338" h="55" fw="26" fh="55">weapons/beam_fire_strip10.png</animSheet>
<animSheet name="beam_bio" w="240" h="56" fw="30" fh="56">weapons/beam_bio_strip8.png</animSheet>
<animSheet name="bomb_fire" w="392" h="58" fw="28" fh="58">weapons/bomblauncher_fire_strip17.png</animSheet>
<animSheet name="bomb_ion" w="680" h="58" fw="34" fh="58">weapons/bomblauncher_ion_strip17.png</animSheet>
<animSheet name="bomb_breach" w="620" h="55" fw="31" fh="55">weapons/bomblauncher_breach_strip17.png</animSheet>

<weaponAnim name="laser_burst_2">
<sheet>laser_burst_2</sheet>
<desc length="15" x="0" y="0"/>
<chargedFrame>7</chargedFrame>
<fireFrame>8</fireFrame>
<firePoint x="12" y="14"/>
<mountPoint x="4" y="55"/>
</weaponAnim>

<weaponAnim name="laser_burst_3">
<sheet>laser_burst_3</sheet>
<desc length="16" x="0" y="0"/>
<chargedFrame>6</chargedFrame>
<fireFrame>7</fireFrame>
<firePoint x="14" y="11"/>
<mountPoint x="5" y="65"/>
</weaponAnim>

<weaponAnim name="beam_fire">
<sheet>beam_fire</sheet>
<desc length="13" x="0" y="0"/>
<chargedFrame>7</chargedFrame>
<fireFrame>8</fireFrame>
<firePoint x="13" y="5"/>
<mountPoint x="5" y="46"/>
<chargeImage>weapons/beam_fire_glow.png</chargeImage>
</weaponAnim>

<weaponAnim name="beam_bio">
<sheet>beam_bio</sheet>
<desc length="8" x="0" y="0"/>
<chargedFrame>1</chargedFrame>
<fireFrame>2</fireFrame>
<firePoint x="18" y="32"/>
<mountPoint x="3" y="48"/>
<chargeImage>weapons/beam_bio_glow.png</chargeImage>
</weaponAnim>

<weaponAnim name="bomb_fire">
<sheet>bomb_fire</sheet>
<desc length="14" x="0" y="0"/>
<chargedFrame>9</chargedFrame>
<fireFrame>10</fireFrame>
<firePoint x="15" y="5"/>
<mountPoint x="5" y="51"/>
<delayChargeAnim>0.98</delayChargeAnim>
<chargeImage>weapons/bomblauncher_1_glow.png</chargeImage>
</weaponAnim>

<weaponAnim name="bomb_ion">
<sheet>bomb_ion</sheet>
<desc length="20" x="0" y="0"/>
<chargedFrame>14</chargedFrame>
<fireFrame>15</fireFrame>
<firePoint x="19" y="5"/>
<mountPoint x="5" y="50"/>
<delayChargeAnim>0.98</delayChargeAnim>
<chargeImage>weapons/bomblauncher_1_glow.png</chargeImage>
</weaponAnim>

<weaponAnim name="bomb_breach">
<desc length="20" x="0" y="0"/>
<chargedFrame>11</chargedFrame>
<fireFrame>12</fireFrame>
<firePoint x="17" y="5"/>
<mountPoint x="5" y="45"/>
<chargeImage>weapons/bomblauncher_1_glow.png</chargeImage>
</weaponAnim>
Anyone know why this would make the game crash?

Re: Replacing weapon art/animations help

Posted: Thu Aug 08, 2013 8:53 am
by UltraMantis
Well i don't see a <sheet> or <delayChargeanim> tags in the breach bomb, but a problem could also be elswehere in the animations or blueprints. There arent any <animSheet> tags for the projectiles.

Are you modifying the original files? Or are you trying to append to the original data?

My advice would be to create a clone weapon with a unique name and unique weapon art and projectile names, add it to the weapon list and give it to a ship as a starting weapon. That way you can learn how all the tags and calls work with each other and establish a naming convention. Without this you will kinda be in the dark when crashes occur, because the problem could be anywhere. Also, use comments in your append files so you know what's what.

Here is an example weapon:

blueprints.xml.append - Weapon is listed and defined here. The names of weapon art, projectile and sound effects are set here and must match entries in animations and sounds files. Finally a ship is set to use this weapon.

Code: Select all

<!-- Weapon Blueprint List -->
<blueprintList name="FRSS_WEAPONS">
	<name>FRSS_MESON_CANNON_4</name>
</blueprintList>

<!-- Weapon Blueprint -->
<weaponBlueprint name="FRSS_MESON_CANNON_4">
	<type>LASER</type>
	<title>Heavy Meson Autocannon</title>
	<short>Heavy Meson</short>
	<desc>This enormous weapon tears through armor.</desc>
	<tooltip>Fires 4 quick shots, each doing 2 damage to hull and causing massive wounds to crew.</tooltip>
	<damage>2</damage>
	<persDamage>3</persDamage>
	<shots>4</shots>
	<speed>128</speed> <!-- 128 -->
	<sp>0</sp>
	<fireChance>0</fireChance>
	<breachChance>1</breachChance>
	<cooldown>14</cooldown>
	<power>4</power>
	<cost>1</cost>
	<bp>10</bp>
	<rarity>0</rarity>
	<image>FRSS_meson_cannon_proj</image>
	<launchSounds>
		<sound>FRSS_meson_cannon1</sound>
		<sound>FRSS_meson_cannon2</sound>
		<sound>FRSS_meson_cannon3</sound>
	</launchSounds>
	<hitShipSounds>
		<sound>FRSS_meson_cannonHull1</sound>
		<sound>FRSS_meson_cannonHull2</sound>
		<sound>FRSS_meson_cannonHull3</sound>
	</hitShipSounds>
	<hitShieldSounds>
		<sound>FRSS_meson_cannonShield1</sound>
		<sound>FRSS_meson_cannonShield2</sound>
		<sound>FRSS_meson_cannonShield3</sound>
	</hitShieldSounds>
	<missSounds>
		<sound>FRSS_meson_cannonmiss</sound>
	</missSounds>
	<weaponArt>FRSS_meson_cannon_WA</weaponArt> 
</weaponBlueprint>

<!-- Ship Blueprint -->
<shipBlueprint name=".....snip
	<weaponList count="1" missiles="0">
		<weapon name="FRSS_MESON_CANNON_4"/>
	</weaponList>
	....snip
</shipBlueprint>
animations.xml.append - Animation sheet points to a sprite image with image size and frame size. The animation itself is defined below and tells the engine how many frames to use, at which point and where to spawn projectiles and where to mount the weapon. Projectiles have their own animation.

Code: Select all

<!-- weapon stuff -->
<animSheet name="FRSS_meson_cannon_WA" w="224" h="71" fw="28" fh="71">weapons/FRSS_meson_cannon_4_strip8.png</animSheet>

<!-- Weapon Animation -->
<weaponAnim name="FRSS_meson_cannon_WA">
	<sheet>FRSS_meson_cannon_WA</sheet>
	<desc length="3" x="0" y="0"/>
	<chargedFrame>1</chargedFrame>
	<fireFrame>2</fireFrame>
	<firePoint  x="18" y="10"/>
	<mountPoint x="6" y="45"/>
	<chargeImage>weapons/FRSS_meson_cannon_4_glow.png</chargeImage>
</weaponAnim>

<!-- Projectile -->
<animSheet name="FRSS_meson_cannon_proj" w="120" h="20" fw="30" fh="20">weapons/FRSS_meson_cannon_4_strip4.png</animSheet>

<anim name="FRSS_meson_cannon_proj">
	<sheet>FRSS_meson_cannon_proj</sheet>
	<desc length="4" x="0" y="0"/>
	<time>0.2</time>
</anim>
sounds.xml.append - Pretty straightforward definition of various sfx. The "miss" entry is a bit odd.

Code: Select all

<!-- Weapon Fire -->
<FRSS_meson_cannon1 volume="8">weapons/FRSS_meson_heavy_1.wav</FRSS_meson_cannon1>
<FRSS_meson_cannon2 volume="8">weapons/FRSS_meson_heavy_2.wav</FRSS_meson_cannon2>
<FRSS_meson_cannon3 volume="8">weapons/FRSS_meson_heavy_3.wav</FRSS_meson_cannon3>

<!-- Weapon Hit -->
<FRSS_meson_cannonHull1 volume="7">explosions/FRSS_meson_heavy_hit1.wav</FRSS_meson_cannonHull1>
<FRSS_meson_cannonHull2 volume="7">explosions/FRSS_meson_heavy_hit2.wav</FRSS_meson_cannonHull2>
<FRSS_meson_cannonHull3 volume="7">explosions/FRSS_meson_heavy_hit3.wav</FRSS_meson_cannonHull3>

<FRSS_meson_cannonShield1 volume="9">explosions/FRSS_meson_heavy_shield1.wav</FRSS_meson_cannonShield1>
<FRSS_meson_cannonShield2 volume="9">explosions/FRSS_meson_heavy_shield2.wav</FRSS_meson_cannonShield2>
<FRSS_meson_cannonShield3 volume="9">explosions/FRSS_meson_heavy_shield3.wav</FRSS_meson_cannonShield3>

<!-- Weapon Miss -->
<FRSS_meson_cannonmiss volume="10">weapons/FRSS_meson_heavy_miss.wav</FRSS_meson_cannonmiss>
Any typo in all of this will cause a crash, filenames must match what is written here ofc. It took a lot of chrases to get this to work but subsequent weapons were easy to make. Hope it helps.

As allways, modding one small step at a time helps. Mostly with identifying crashes.

Re: Replacing weapon art/animations help

Posted: Thu Aug 08, 2013 9:33 am
by AssKickerson
I'm appending it. And the only thing I'm changing is the weapon art. Its shows up in game but its just not lined up correctly and I see half a weapon.

And do you know anything about weapons not showing their icon and just looking like a simple laser weapon in game? I am having the roughest time with that. The image is in the ftl file, I am almost certain that I didn't make any typos but it refuses to show up. Its for a separate weapon mod that also only changes the weapon art.

EDIT: I figured out the problem with the second thing where the weapon icon was blank and it shows up as a dual laser. Apparently it has something to do with the blueprints, which makes NO sense unless....does casing matter?

Re: Replacing weapon art/animations help

Posted: Thu Aug 08, 2013 9:42 am
by UltraMantis
FRSS_meson_cannon_4_strip8.png
When you open the .png in MsPaint you can use the cursor to check coordinates or drag a selection to make sure you have the correct frame size. If the weapon doesn't show properly in game, it's either got a bad mount point (or the ship has a bad mountpoint) or there is a typo somewhere. In the above example (just a HL sprite renamed to match the animblueprint) the values match correctly, the origin is the bottom left corner, however check the ship mount point to see if mirroring/flipping is used. MsPaint is your friend when it comes to pixel and coordinate hunting. ;)

I have had some issues with weapons not showing up in the hangar screen, or the wrong frame being used. I suspect there is some behind-the-scenes hardcoding interfering. Animations are especially susceptible to errors and frameskipping even when you do everything correctly.

At least it's not crashing anymore, so you're going forward. I'd triple check tag and filenames if weapons are invisible.

Re: Replacing weapon art/animations help

Posted: Thu Aug 08, 2013 10:16 am
by AssKickerson
OH MY GOD CASING MATTERS THAT IS SO BULLSHIT.

Thanks for the help by the way.

Re: Replacing weapon art/animations help

Posted: Thu Aug 08, 2013 12:14 pm
by speedoflight
When u see the basic default laser instead of your custom weapon icon is because of that, because the game cant find your custom weapon or because your weapon has something wrong and the game is loading a default weapon instead.

The line delaychargedanimation is optional, is used only in bombs, but as i said is optional. That is not the cause of the crash. Usually, a crash when u create weapons is due to something more problematic, u say u can see a default weapon icon istead of yours, so, when the game crashes?? after you click on start? or where?

You can just go 1 weapon by 1, that is easier to find any errors. Just make comments in all the custom weapons you are trying to get into the game, with the exception of just 1, and start from there.. anyways, its probably the missing sheet tag on the bomb will be the cause..

And yes, casing letters matters.. ;)

EDIT. Didnt notice u already solved the problem, well, anyways, there they are my tips dosis... lol.

Re: Replacing weapon art/animations help

Posted: Thu Aug 08, 2013 12:17 pm
by AssKickerson
It crashed on startup right after it finishes loading to the main menu but the problem's already been fixed. Mantis was right, the breach bomb was missing a <sheet> tag and the basic laser without an icon thing was because I did some casing wrong in the blueprints file.

Re: Replacing weapon art/animations help

Posted: Thu Aug 08, 2013 4:09 pm
by UltraMantis
AssKickerson wrote:OH MY GOD CASING MATTERS THAT IS SO BULLSHIT.

Thanks for the help by the way.
You're welcome. :) Good effort on your part sticking through this bullshit. ;)

Re: Replacing weapon art/animations help

Posted: Sat Aug 10, 2013 2:46 pm
by AssKickerson
This isn't related to weapon art or animations but close enough I guess. I was editing around the blueprints file of a ship and now for some reason the "miniship" image in the hangar ship selector doesn't show. Anyone know what would make this happen? I am almost certain its because of something I did in the blueprints file.

Re: Replacing weapon art/animations help

Posted: Sat Aug 10, 2013 4:43 pm
by UltraMantis
You probably changed the img= field and now the filename doesn't match. The filename should be miniship_<???>.png with <???> being whatever you used in the img tag. Try using a consistent name for everything (shield, cloak, interiors), there will be less chance of a typo.