ZScript: Translations to/from colors?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

ZScript: Translations to/from colors?

Post by Major Cooke »

So, I'm aware that in order to properly transfer BloodColor to a color variable, it requires doing this:

Code: Select all

Color bl = (bloodcolor & 0xffffff);
But this leaves the question, what about translations? And the inverse, going from color to translation?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript: Translations to/from colors?

Post by Graf Zahl »

A color is not the same as a translation so there cannot be a conversion. The main problem with the blood color is that the translation index is stored in the alpha byte so dynamically adding new blood colors is simply not an option.
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: ZScript: Translations to/from colors?

Post by Nash »

So there's really no way to make a spawned Actor match it's Spawner's BloodColor? Damn, what a bummer
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: ZScript: Translations to/from colors?

Post by Major Cooke »

Damn...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript: Translations to/from colors?

Post by Graf Zahl »

Nash wrote:So there's really no way to make a spawned Actor match it's Spawner's BloodColor? Damn, what a bummer
No, not right now, because the relevant parts are subject to rewrite because the imposed limit needs to be removed. Of course, if someone submits a PR with a native function doing the needed work I'd see no reason to reject it.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: ZScript: Translations to/from colors?

Post by Major Cooke »

Out of curiosity, could you describe what would need to be done a bit more thoroughly? Right now it looks like it's well above my skill but I am curious nonetheless.
Locked

Return to “Editing (Archive)”