[ZScript] allow modification of bloodtype and bloodcolor
Moderator: GZDoom Developers
-
- 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
Why are these even locked?
-
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [ZScript] allow modification of bloodtype and bloodcolor
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.
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.
-
- 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
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:
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.
-
-
- Posts: 10774
- Joined: Sun Jul 20, 2003 12:15 pm
Re: [ZScript] allow modification of bloodtype and bloodcolor
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.
-
- 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
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.
I currently have to do some hacks to pass it around.
-
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [ZScript] allow modification of bloodtype and bloodcolor
It's trickier. The blood translation needs to carry a color along for colorizing decals and particle blood.