Help with Custom Weapon Art

Discuss and distribute tools and methods for modding. Moderator - Grognak
Post Reply
Durandal
Posts: 5
Joined: Fri Jan 25, 2013 7:28 pm

Help with Custom Weapon Art

Post by Durandal »

Ok, so I've added a new weapon and spent 6 hours today cooking up some art (never done anything like this before, so I was learning Paint.NET as I went). Recreating the Gauss Cannon from Descent 2, if anyone's familiar.

The issue is that when I go in-game, the weapon simply does not show up at all, and I can't figure out what I've done wrong. Here is my stuff:

ANIMATIONS.XML.APPEND

Code: Select all

<animSheet name="gauss_cannon" w="250" h="78" fw="25" fh="78">weapons/gauss_strip10.png</animSheet>
<weaponAnim name="gauss_cannon">
	<sheet>gauss_cannon</sheet>
	<desc length="10" x="0" y="0"/>
	<chargedFrame>5</chargedFrame>
	<fireFrame>7</fireFrame>
	<firePoint  x="16" y="11"/>
	<mountPoint x="3" y="56"/>
</weaponAnim>
gauss_strip10.png
BLUEPRINTS.XML.APPEND

Code: Select all

<weaponBlueprint name="CANNON_GAUSS">
	<type>LASER</type>
	<title>Gauss Cannon</title>
	<short>Gauss</title>
	<desc>Heavy cannon that fires high explosive rounds. 40 percent chance of fire, 20 percent chance of breach.</desc>
	<tooltip>2 shots, 2 damage each. 15 extra crew damage. Med fire chance, low breach chance.</tooltip>
	<damage>2</damage>
	<persDamage>1</persDamage>
	<speed>120</speed>
	<shots>2</shots>
	<sp>0</sp>
	<fireChance>4</fireChance>
	<breachChance>2</breachChance>
	<cooldown>18</cooldown>
	<power>3</power>
	<cost>80</cost>
	<bp>5</bp>
	<rarity>4</rarity>
	<image>gauss_shot</image>
	<explosion>explosion_big1</explosion>
	<launchSounds>
		<sound>gauss_fire</sound>
	</launchSounds>
	<hitShipSounds>
		<sound>gauss_hit</sound>
	</hitShipSounds>
	<hitShieldSounds>
		<sound>hitShield1</sound>
		<sound>hitShield2</sound>
		<sound>hitShield3</sound>
	</hitShieldSounds>
	<missSounds>
		<sound>miss</sound>
	</missSounds>
	<weaponArt>gauss_cannon</weaponArt>
</weaponBlueprint>
Thing is, I tried using it with a no-animation version of the .png, and it worked just fine.
gauss_cannon.png
Guessing it's something with the .png itself or my animations entry, but I've gone over it 8 times now to no avail...

Any assistance would be most appreciated!
UltraMantis
Posts: 2125
Joined: Thu Sep 20, 2012 3:17 pm

Re: Help with Custom Weapon Art

Post by UltraMantis »

I don't quite know... there's a few things missing but then it would not work with a still image either.

What's missing:
- weapon is not listed in blueprintList:

Code: Select all

<!-- Weapon Blueprint List -->
<blueprintList name="MY_WEAPONS">
    <name>CANNON_GAUSS</name>
</blueprintList>
- glow sprite tag is missing:

Code: Select all

<animSheet name="gauss_cannon" w="250" h="78" fw="25" fh="78">weapons/gauss_strip10.png</animSheet>
<weaponAnim name="gauss_cannon">
   <sheet>gauss_cannon</sheet>
   <desc length="10" x="0" y="0"/>
   <chargedFrame>5</chargedFrame>
   <fireFrame>7</fireFrame>
   <firePoint  x="16" y="11"/>
   <mountPoint x="3" y="56"/>

	<chargeImage>weapons/file_name.png</chargeImage>

</weaponAnim>
When a weapon doesn't show up it's usually because of a typo. Possibly in the ship blueprint?
Report spam using the handy Report Button Mod.
UltraMantis
Posts: 2125
Joined: Thu Sep 20, 2012 3:17 pm

Re: Help with Custom Weapon Art

Post by UltraMantis »

Scratch the above, your weapon is working. The problem is the transparency masks. The strip doesnt have any. Open up one of the stock weapons and you should see that each frame is masked to make the rest transparent. This can not be done in 8-bit mode so make sure you use 24 or 32 bit modes.

Attached is the image with a sloppy rectangle mask to confirm the weap is working. Those masks will be a pain in the ass. Have fun. :lol:
gauss_strip10.png
EDIT - Ok, nvm. Here is the finished strip. It was actually very easy. :roll:
gauss_strip10-masked.png
Report spam using the handy Report Button Mod.
Durandal
Posts: 5
Joined: Fri Jan 25, 2013 7:28 pm

Re: Help with Custom Weapon Art

Post by Durandal »

OMG, thank you so much! :D

I did not know that these masks even existed. Is this something I can do in Paint.NET? When comparing the before and after images, Paint.NET doesn't seem to recognize any difference.
UltraMantis
Posts: 2125
Joined: Thu Sep 20, 2012 3:17 pm

Re: Help with Custom Weapon Art

Post by UltraMantis »

I guess not then. The GIMP is far from my favourtite, but it's free and should be able to handle this. What i did was i selected all areas i did not want to keep, then inverted the selection and used it as a transparency mask when saving the image.

I think this can not be done on the background, so you have to duplicate it, then delete the background. Do the selecting and inverting on the duplicated layer, and it should work.

note- i use corel photo paint, probably the worlds shittest photo editor. but it was free in my case so feck it, i;m using it. :D
Report spam using the handy Report Button Mod.
Post Reply