[ZScript] allow modification of bloodtype and bloodcolor

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

[ZScript] allow modification of bloodtype and bloodcolor

Post by Matt »

Why are these even locked?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [ZScript] allow modification of bloodtype and bloodcolor

Post by Graf Zahl »

Bloodcolor is locked because it isn't a color, it's a translation. Simply setting it won't do any good.
Bloodtype is a class property (i.e. cannot be set per actor), otherwise they'd inflate the actor structure by another 24 bytes (there's 3 class pointers here) for a feature that at the time of implementation was not seen as something potentially changeable.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: [ZScript] allow modification of bloodtype and bloodcolor

Post by Matt »

That sounds like a good reason!

Now that I think about it what I'm trying to do could probably be better done by using a custom blood actor that changes its own translation (or sprite) depending on what spawned it.


That said... is there any way for a blood actor spawned by a regular hitscan or ripper (not A_SpawnItemEx) to point to the actor that bled it? Nevermind, found it on the flags wiki page:
[+PUFFGETSOWNER] can also be used on Blood: in that case the actor that is bleeding will be considered the Blood actor's target (by default player is considered any non-friendly actor's target). If A_FaceTarget function is added, the Blood actor will face the bleeding actor.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm

Re: [ZScript] allow modification of bloodtype and bloodcolor

Post by Xaser »

Since blood color is a translation, IMO it makes sense to add the same editing features available for regular actor translations. An A_SetBloodTranslation function would pair well with trnslate.txt, and making the bloodtranslation property writable will enable copying blood translations between actors.
User avatar
Marisa the Magician
Banned User
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

Re: [ZScript] allow modification of bloodtype and bloodcolor

Post by Marisa the Magician »

Considering translation is also a translation and it's not readonly and it can be transferred between actors through a direct assignment, I don't see why the same can't be done with bloodtranslation / bloodcolor.

I currently have to do some hacks to pass it around.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [ZScript] allow modification of bloodtype and bloodcolor

Post by Graf Zahl »

It's trickier. The blood translation needs to carry a color along for colorizing decals and particle blood.

Return to “Feature Suggestions [GZDoom]”