Hello everyone.
Let's say I have an actor of palette 1, and I want it to drip with blood of palette 1 as well. That blood spawning on bullet impact is always red, no matter what palette my actor has. How would you change its color?
(Speaking of that dripping blood drops, not the blood producing by "spawn BLOOD".)
Please, If you know the clue, tell me the direction. Thx in advance! Or tell me the mod with that feature where I can see how it's made.
(As far as I can see, this blood, unlike "spawn blood" one, spawns it the point of the body that was hit, so I can assume it is spawned by the "hitscan", not by the actor itself.)
Page 1 of 1
EDuke32 blood color
#1 Posted 26 December 2023 - 10:47 AM
#2 Posted 26 December 2023 - 12:00 PM
They are JIBS6 sprites, but they are spawned from hitscan impacts as you said. The game is hardcoded to spawn those on the organic vanilla enemies, and you can add the flag to spawn them on custom enemies. The size and trajectory are different from when that same tile is spawned via the guts command. The spawned sprites can be modified in EVENT_EGS. However, there is a trick to modifying them only selectively based on the type of actor it comes from, so if you want to modify only ones that come from enemies with blue blood (or whatever) then you will need additional information. If you just want to modify all of them, then the wiki entry below is sufficient, unless you have zero scripting knowledge.
https://wiki.eduke32.../wiki/EVENT_EGS
https://wiki.eduke32.../wiki/EVENT_EGS
#3 Posted 26 December 2023 - 02:53 PM
appendevent EVENT_EGS ifactor LIZTROOP spritepal 1 switch sprite[].picnum case JIBS6 // THISACTOR now is that blood drop's id // THISACTOR.owner is a player id // How would you get an id of the actor being hit? Is it even possible for the semi-hardcoded vanilla actors? // I need it for the 'if' statement to determine actor's palette and set JIBS6 palette to that number. setactor[].pal 1 break endswitch endevent
This post has been edited by Mere_Duke: 26 December 2023 - 02:54 PM
#4 Posted 26 December 2023 - 03:37 PM
Is it your intention to also make all LIZTROOP blue when they are spawned into a map?
#5 Posted 26 December 2023 - 04:49 PM
Danukem, on 26 December 2023 - 03:37 PM, said:
Is it your intention to also make all LIZTROOP blue when they are spawned into a map?
Yes, it's just a test code (checked palette inheritance). My intention was to change all blood to the palette of actor it comes from. While bloodpolls and jibs are easy to modify (ifspawnedby command), this type of blood are somewhat obscure.
This post has been edited by Mere_Duke: 26 December 2023 - 04:51 PM
#6 Posted 26 December 2023 - 05:20 PM
Mere_Duke, on 26 December 2023 - 04:49 PM, said:
Yes, it's just a test code (checked palette inheritance). My intention was to change all blood to the palette of actor it comes from. While bloodpolls and jibs are easy to modify (ifspawnedby command), this type of blood are somewhat obscure.
gamevar spritenum 0 0 onevent EVENT_EGS ifactor JIBS6 { ifspawnedby SHOTSPARK1 geta[sprite[].owner].htg_t 8 spritenum else geta[].owner spritenum ifn spritenum -1 seta[].pal sprite[spritenum].pal } endevent
In English what the code says is:
At the moment a sprite spawns, if that sprite is a JIBS6 then do the following:
If the JIBS6 was spawned by a hitscan bullet, then populate the variable "spritenum" with the sprite number of the sprite that the bullet hit (which is equal to the htg_t 8 member of the bullet).
But if the JIBS6 was spawned by anything else, then populate the variable "spritenum" with the sprite number of whatever spawned the JIBS6.
Next, if the value of "spritenum" is valid, set the palette of the JIBS6 to the palette of the sprite referred to by "spritenum"
#7 Posted 26 December 2023 - 05:40 PM
Oh thanks! So this way I should check ifspawnedby ... for all available 'shoot' keywords like KNEE, SHOTGUN etc to cover all cases, shouldn't I?
I was trying to make it as universal as possible, but if some mod would have its own projectile, this case seems to be not covered this way.
I was trying to make it as universal as possible, but if some mod would have its own projectile, this case seems to be not covered this way.
#8 Posted 26 December 2023 - 05:45 PM
JIBS6 presents a complication because of the extra step of going through htg_8 of the SHOTSPARK1 (bullet). But in every other case you could set spawned bloods and other such thing to the pal of their owners. So you started this thread with the only case in which it gets convoluted.
Share this topic:
Page 1 of 1