Author Topic: Recolored hit- and bullet sprites  (Read 3122 times)

Offline Ran

  • Colonel
  • ****
  • Posts: 191
    • View Profile
Recolored hit- and bullet sprites
« on: February 26, 2014, 12:05:16 am »
Could someone provide me with the bullet sprite file?
I have the unpacked smoke.pck from https://ufopaedia.org and already have different colored laser and plasma hits but I need the bullet sprites, pckview won't work for me.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2315
  • Developer
    • View Profile
Re: Recolored hit- and bullet sprites
« Reply #1 on: February 26, 2014, 12:29:17 am »
check your resources folder.

Offline Ran

  • Colonel
  • ****
  • Posts: 191
    • View Profile
Re: Recolored hit- and bullet sprites
« Reply #2 on: February 26, 2014, 04:09:16 am »
Ah right - I knew they were somewhere... :-[

I have recolored Plasma bullet and hit sprites to red, purple and blue and attached a ruleset, seems to work.

Code: [Select]
items:
  - type: STR_WEAPON
    bulletSprite: 11
  - type: STR_AMMO
    hitAnimation: 99
extraSprites:
  - type: Projectiles
    height: 3
    width: 87
    subX: 3
    subY: 3
    files:
      385: Resources/ModFolder/PlasmaBulletSprite_red.png
  - type: SMOKE.PCK
    height: 80
    width: 160
    subX: 32
    subY: 40
    files:
      99: Resources/ModFolder/HitAnimation_Plasma_red.gif

However I don't get the file numbering. It seems the bullet sprite file has to have file nr. 385 (taken from the Magnum ruleset), even though the bullet sprite is numbered as 11. Other numbers render the bullet invisible.
« Last Edit: February 26, 2014, 04:13:41 am by Ran »

Offline Ran

  • Colonel
  • ****
  • Posts: 191
    • View Profile
Re: Recolored hit- and bullet sprites
« Reply #3 on: February 27, 2014, 01:23:56 am »
The laser sprites have been changed to red, green, blue and purple, enjoy your colored lasers :)

For reasons unknown to me the hit sprites do not work yet, they get replaced by the original orange one.
The recolored plasma hit sprites work, I see no difference between them and the laser hit sprites, it's a mystery to me... :-\

Could someone please check what's wrong here?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2315
  • Developer
    • View Profile
Re: Recolored hit- and bullet sprites
« Reply #4 on: February 27, 2014, 10:49:33 am »
there are 35 particles to the projectile

so bulletSprite: 11 refers to the sprite (11 * 35) in the set

ie: 385

this is so you don't get them crossing over each other

Offline Ran

  • Colonel
  • ****
  • Posts: 191
    • View Profile
Re: Recolored hit- and bullet sprites
« Reply #5 on: February 28, 2014, 12:12:17 am »
I see, thanks!

But still, why won't the laser hit sprites work?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2315
  • Developer
    • View Profile
Re: Recolored hit- and bullet sprites
« Reply #6 on: May 17, 2014, 08:25:59 pm »
i've looked into it, the problem is the palettes, you're not using the standard battlescape palette.

if you can, extract it from the existing bulletSprites image and apply it to your images.

Offline Ran

  • Colonel
  • ****
  • Posts: 191
    • View Profile
Re: Recolored hit- and bullet sprites
« Reply #7 on: May 17, 2014, 08:29:16 pm »
Thank you!
I used UFOpalette.act
Is there a specific file for battlescape I can use?

I'll try to extract a palette from the game's bullet sprite file for now.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2315
  • Developer
    • View Profile
Re: Recolored hit- and bullet sprites
« Reply #8 on: May 17, 2014, 08:39:08 pm »
https://dl.dropboxusercontent.com/u/47596892/OXCStuff/pals.rar

i replaced the transparency colour with supergreen (00ff00) to maximize compatibility (OSX doesn't like transparency) but rest assured, any supergreen pixels will render completely invisible in-game.

Offline Ran

  • Colonel
  • ****
  • Posts: 191
    • View Profile
Re: Recolored hit- and bullet sprites
« Reply #9 on: May 17, 2014, 09:33:53 pm »
Awesome, thanks! :D
I had to replace the transparency with supergreen, now it works.

About the numbering:
Does the sprite have to be 105 pixels long or is any multiple of particle size ok?
So the file number is bullet sprite number x sprite length / particle size?
« Last Edit: May 17, 2014, 10:47:05 pm by Ran »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2315
  • Developer
    • View Profile
Re: Recolored hit- and bullet sprites
« Reply #10 on: May 18, 2014, 12:01:32 am »
it doesn't have to be 105 pixels long, no, it can be shorter, not longer, but make sure all added entries start at multiples of 35 or you'll have problems.

file number would be bullet sprite number * 35 regardless.