OpenXcom Forum

Modding => Released Mods => Topic started by: Ran on May 18, 2014, 12:31:09 am

Title: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: Ran on May 18, 2014, 12:31:09 am
Here I present recolored Laser and Plasma Bullet and Hit sprites, now finally working. :)

(https://farm6.staticflickr.com/5275/14021380727_c64ffbc1ff_o_d.jpg)
(https://farm6.staticflickr.com/5518/14021339990_75f9bc55c2_o_d.jpg)

(https://farm6.staticflickr.com/5496/14205502082_68edf1acaf_o_d.jpg)
(https://farm3.staticflickr.com/2919/14021339290_e38514d1fc_o_d.jpg)

(https://farm6.staticflickr.com/5232/14207839734_6c1a6d699c_o_d.jpg)
(https://farm3.staticflickr.com/2896/14228131183_6d7a539732_o_d.jpg)

Plasma Bullet and Hit sprites:
Red
Blue
Purple

Laser Bullet and Hit sprites (small, medium and large version for each color):
Red
Green
Blue
Purple

Including sample ruleset which has to be adjusted to your weapon of choice.
As the latest nightly Build now allows BulletSprite to be a function of ammo, you can create several ammo types for one weapon which have different bullet colors.

See attached TestGun Mod and testing savegame for a real life demonstration of that, but keep in mind that this gun is for testing purposes only - it will barely do any damage so you can shoot the aliens in all the colors you want. ::)
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: Warboy1982 on May 18, 2014, 12:46:56 am
ooooh it's like a fireworks display!
nice work, and sorry it took so long to get back to you about the palette thing.
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: civilian on May 18, 2014, 04:41:08 pm
Thanks for the resources!  :)
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: Dioxine on May 18, 2014, 07:24:01 pm
Nice work, I've added some of those to my mod, but I had to brighten them up - blue plasma/laser are the worst offenders, they're way too dark imo. It looks more like a water projectile :)
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: Aldorn on May 21, 2014, 01:49:24 am
I will certainly find an occasion to use this...
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: davide on May 21, 2014, 06:57:06 pm
An idea could be that color is associated to tecnology and size to weapon size

laser is yellow
plasma in blue
gauss is purple

etc

pistol is the small

heavy is the big

Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: Solarius Scorch on May 21, 2014, 11:33:24 pm
laser is yellow
plasma in blue
gauss is purple

Plasma is green! BURN THE HERETIC!!! :P
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: davide on May 23, 2014, 06:03:08 pm
Oh my god ...  :-[

I'm colorblind. :'(

 ;D
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: davide on May 23, 2014, 06:06:26 pm
I need an armour with fire resistance ...

 ???

 ::)

 :o

... new idea ... new armor type with different resistances type !!
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: HotIceHilda on June 15, 2014, 05:38:43 am
Can these sprites be used for the original plasma and laser weapons in the base game? The read me doesn't really explain what to do with the sprites.
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: Ran on June 17, 2014, 12:45:16 am
I'm sorry, I tried to explain what to do as good as I could. :-[
Of course you can use these sprites for any weapon including the original ones.
You'd need to edit the ruleset  by adding all features of your weapon of choice except those already existing in the ruleset.
As example I've attached a ruleset which gives you red Heavy Plasma.
Just install Plasma_recolored from 1st posting and replace the included ruleset with the one attached below.

Blue:
Code: [Select]
bulletSprite:12
hitAnimation: 210

Purple:
Code: [Select]
bulletSprite:13
hitAnimation: 220

EDIT: The ruseset missed some important sections, it works now.
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: Ran on June 17, 2014, 12:55:25 am
I present the Test Gun :P
It lets you load different types of ammo which represent all included laser and plasma hit and bullet sprites.
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: Warboy1982 on June 17, 2014, 12:57:35 am
your ruleset is missing the word "extraSprites:" and a bunch of information for the projectile replacement.

Code: [Select]
items:
  - type: STR_HEAVY_PLASMA
    bulletSprite: 11
  - type: STR_HEAVY_PLASMA_CLIP
    hitAnimation: 200
extraSprites:
  - type: Projectiles
    height: 3
    width: 87
    subX: 3
    subY: 3
    files:
      385: Resources/Plasma_recolored/PlasmaBulletSprite_red.png
      420: Resources/Plasma_recolored/PlasmaBulletSprite_blue.png
      455: Resources/Plasma_recolored/PlasmaBulletSprite_purple.png
  - type: SMOKE.PCK
    height: 80
    width: 160
    subX: 32
    subY: 40
    files:
      200: Resources/Plasma_recolored/HitAnimation_Plasma_red.gif
      210: Resources/Plasma_recolored/HitAnimation_Plasma_blue.gif
      220: Resources/Plasma_recolored/HitAnimation_Plasma_purple.gif
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: Ran on June 17, 2014, 01:06:58 am
But of course! ;D

I just deleted too much from the TestGun Ruleset I had already created some weeks ago, my mistake. All should work now.
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: shadychrctr on September 28, 2014, 12:53:08 am
I'm not able to get this to work. I'm not a modder but since I've custom rebalanced my game, I modify all of the mods I add to my game. I tweaked and tidied this ruleset but when I fire my heavy laser I get no bulletsprite at all and the hit animation does a rainbow of colours. I tried putting my hitanimation gifs into different folders but that hasn't helped. I'd primarily like help with the lack of bullet sprite though. I can live with rainbow laser impacts.
I'm including a copy of my modified ruleset.
I am aware of the fact that the path for the files goes through resources/laser_recoloured but that's because I've renamed that file to match the ruleset, and it's in the proper caps and all.
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: ivandogovich on September 28, 2014, 06:07:36 am
@shadychrctr:  Linux user?  maybe you need these in a sprite sheet?  (I don't know that they aren't, I'm just brainstorming).

Nvm. See Dioxine's excellent observation, below. ;)
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: Dioxine on September 28, 2014, 07:22:54 am
First of all, read your new bible before modding: https://www.ufopaedia.org/index.php?title=Ruleset_Reference_%28OpenXcom%29#Items

Now, what's wrong? Your sprite declarations are all over the place. Bullet sprites are supposed to be put every 35 numbers apart, while explosion sprites - every 10.

you have:

Code: [Select]
  - type: projectiles
    height: 3
    width: 105
    subX: 3
    subY: 3
    files:
      100: Resources/Laser_recolored/SmallLaserBulletSprite_red.png
      101: Resources/Laser_recolored/SmallLaserBulletSprite_purple.png
      102: Resources/Laser_recolored/SmallLaserBulletSprite_blue.png
      103: Resources/Laser_recolored/SmallLaserBulletSprite_green.png
      110: Resources/Laser_recolored/MediumLaserBulletSprite_red.png
      111: Resources/Laser_recolored/MediumLaserBulletSprite_purple.png
      112: Resources/Laser_recolored/MediumLaserBulletSprite_blue.png
      113: Resources/Laser_recolored/MediumLaserBulletSprite_green.png
  - type: SMOKE.PCK
    height: 80
    width: 160
    subX: 32
    subY: 40
    files:
      200: Resources/Laser_recolored/red/HitAnimation_Laser_red.gif
      201: Resources/Laser_recolored/purple/HitAnimation_Laser_purple.gif
      202: Resources/Laser_recolored/blue/HitAnimation_Laser_blue.gif
      203: Resources/Laser_recolored/green/HitAnimation_Laser_green.gif

you should have, for example:

Code: [Select]
  - type: projectiles
    height: 3
    width: 105
    subX: 3
    subY: 3
    files:
      385: Resources/Laser_recolored/SmallLaserBulletSprite_red.png
      420: Resources/Laser_recolored/SmallLaserBulletSprite_purple.png
      455: Resources/Laser_recolored/SmallLaserBulletSprite_blue.png
      490: Resources/Laser_recolored/SmallLaserBulletSprite_green.png
      525: Resources/Laser_recolored/MediumLaserBulletSprite_red.png
      560: Resources/Laser_recolored/MediumLaserBulletSprite_purple.png
      595: Resources/Laser_recolored/MediumLaserBulletSprite_blue.png
      630: Resources/Laser_recolored/MediumLaserBulletSprite_green.png
  - type: SMOKE.PCK
    height: 80
    width: 160
    subX: 32
    subY: 40
    files:
      66: Resources/Laser_recolored/red/HitAnimation_Laser_red.gif
      76: Resources/Laser_recolored/purple/HitAnimation_Laser_purple.gif
      86: Resources/Laser_recolored/blue/HitAnimation_Laser_blue.gif
      96: Resources/Laser_recolored/green/HitAnimation_Laser_green.gif

Also note that while explosions are indexed normally, bullet sprites are indexed 35 to 1. This means that 385 means bulletsprite 11, 420 - bulletsprite 12 etc.
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: shadychrctr on September 29, 2014, 03:44:24 am
Hmmmm, well now the hit anims work, but i'm still not getting any bullet sprites. I've been fiddling with it non stop but I just can't figure out what could be wrong anymore.... i've done what dioxine told me, then after a while I tried putting the bulletsprites into one file but still nothing.
this time I'm including ruleset and a pic of my resource file.
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: shadychrctr on September 29, 2014, 03:58:04 am
Plasma is green! BURN THE HERETIC!!! :P
Although "BURN THE HERETIC!!!" has quite the lilt of a WH40K fan. Blue plasma for life!
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: Dioxine on September 29, 2014, 04:33:29 am
Well, that's my code below - noticed that my Width is different from yours. Maybe that's the problem?

Code: [Select]
  - type: Projectiles
    height: 3
    width: 57
    subX: 3
    subY: 3
    files:
      385: Resources/Piratez/Bullets/BulletMagnum.gif
      420: Resources/Piratez/Bullets/Arrow.gif
      455: Resources/Piratez/Bullets/BulletGaussSmall.gif
      490: Resources/Piratez/Bullets/BulletGaussBig.gif
      525: Resources/Piratez/Bullets/BulletPlasmaBlue.gif
      560: Resources/Piratez/Bullets/BulletLaserBlueMed.png
      595: Resources/Piratez/Bullets/Molotov.gif
      630: Resources/Piratez/Bullets/BulletLaserBlueSmall.png
      665: Resources/Piratez/Bullets/StickGrenade.gif
      700: Resources/Piratez/Bullets/Knife.gif
      735: Resources/Piratez/Bullets/BallPurple.gif
      770: Resources/Piratez/Bullets/CannonBall.gif
      805: Resources/Piratez/Bullets/BulletFlintlock.gif
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: shadychrctr on September 29, 2014, 06:04:31 am
ok, so was either the background colour, (not likely) or i had to capitalize Projectiles.......
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: HotIceHilda on October 04, 2014, 09:10:47 pm
So does this mod still require some personal tweaking to get it to work? It is a great idea for a mod, but some people are not knowledgeable about tweaking OpenXCOM
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: Arthanor on October 05, 2014, 01:07:37 am
From what I downloaded, yes, it does require some tweaking. I think this mod is meant more as a resource for modders than an actual ready to use mod. It is some really simple tweaking and worth looking into. All you have to do is put the pictures in the right folder and pick the colour you want in the ruleset.

Take a look at it, give it a try, and if it doesn't work I can write a ruleset for you.
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: HotIceHilda on October 05, 2014, 06:31:20 am
From what I downloaded, yes, it does require some tweaking. I think this mod is meant more as a resource for modders than an actual ready to use mod. It is some really simple tweaking and worth looking into. All you have to do is put the pictures in the right folder and pick the colour you want in the ruleset.

Take a look at it, give it a try, and if it doesn't work I can write a ruleset for you.
I am guessing I have to put the hit animation and the bullet sprites in some folder. The only folder that I could think of that I should put it in is the bullet sprite folder in the resources folder. If I am please correct me.
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: Arthanor on October 05, 2014, 06:41:28 am
If you open the ".rul" file, you will see a section called "extraSprites"at the bottom. In there are the path to be used to access the new graphics.

Just make sure that those lines in the .rul file match with where you put the files (also the names, the ones in the ruleset are for red plasma, if I remember well).

In general, it is considered best practice to put new files in the Resources folder, within a folder with the name of your mod. It is not necessary, but that's how every modder does it (and how the .rul file for this mod assumes you will do things as well, but you can change it).
Title: Re: [WEAPON] Recolored Laser and Plasma Bullet Sprites
Post by: Ran on October 07, 2014, 12:37:42 am
Sorry I didn't reply sooner, I was sure I had uploaded a complete working demonstration of the replaced colors already. :-[

You'll find the TestGun Mod in the first post now, including an attached savegame. It is basically a magnum with many types of ammo, each one representing a different color form of plasma and laser hit and bullet sprites. It was done some months ago, I hope it still works with the current builds.