OpenXcom Forum
Modding => Work In Progress => Topic started by: Ran on May 17, 2014, 08:26:04 pm
-
How are explosion sprites implemented in the ruleset (are they at all)?
I wanted to implement the already existing alternative explosion sprite
https://openxcom.org/forum/index.php?topic=1257.0
but it won't work. The game always displays the original explosion. :(
-
you'd have to replace the frames in https://www.ufopaedia.org/index.php?title=X1.PCK (https://www.ufopaedia.org/index.php?title=X1.PCK)
-
Yes, I know that, but how? :-[
Can this be done in the ruleset section of extra files or only by replacing the original?
I can't even open pck files let alone modify them
-
same way we do all the extraSprites, just replace frames 0-7 of X1.PCK with your own images. something like the following:
extraSprites:
- type: X1.PCK
files:
0: Resources/Explosion/Explode.png
width: 512
height: 128
subX: 128
subY: 64
-
But doesn't that replace all explosions?
I want to make different explosion sprites for some weapons but I can't define explosionAnimation in the weapons section.
And hitAnimation uses SMOKE.pck so it's no help either. :(
EDIT: Actually it's really strange - I defined the new explosion as 1 and a blue version as 0.
What I get is a mixture of yellow explosions with a bit of blue for every weapon.
The same happened with the recolored hit sprites when I tried to create a gun which can take all possible color-forms as ammo.
The bullets work perfectly but the hitsprites are a firework of overlays, all sprites being displayed in the order of filenames, the last one on top.
-
Sounds like you've mismatched sprite numbers. Any sprite form Smoke.pck has 10 frames, not 1, so you need to take that into account when indexing. The first free number is 56, so you should index your first new hit sprite 56, the next 66 etc. Same probably holds true for the explosions, but I haven't tried to modify them myself yet. Try to change the 2nd explosion index from 1 to 8.
-
Ah, that makes sense!
Will try that tomorrow.
I wish those things were documented somewhere. The Ufopaedia ruleset resource is a great introduction but such details are beyond me.
When working on rulesets I sometimes feel like a monkey hammering on a typewriter until Shakespeare's collected works are produced.
There's always a chance it will work out, but it usually takes a looong time... :-\
(https://0-media-cdn.foolz.us/ffuuka/board/a/image/1346/77/1346774155053.jpg)
-
Ok, the hit sprites work now, and weird explosions are also fixed if you space apart the file numbers by 8.
Still you can only replace the original explosion sprite, not create different ones for different weapons.
So my request to all you coding wizards out there - could we pleease have custom explosion sprites? :-[
I mean, the option to define something like:
items:
- type: STR_GRENADE_1
explosionAnimation: 2
- type: STR_GRENADE_2
explosionAnimation: 10
extraSprites:
- type: X1.PCK
width: 512
height: 128
subX: 128
subY: 64
files:
2: Resources/Explosions/Explosion1.png
10: Resources/Explosions/Explosion2.png
-
Custom explosion sprites for different weapons would be really great.