How to translate color of the sprite in ZScript?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
etbasch
Posts: 25
Joined: Wed Apr 10, 2019 5:42 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Ukraine

How to translate color of the sprite in ZScript?

Post by etbasch »

In DECORATE, I was using

Code: Select all

Actor TallTorchRed : TallTorchBlue replaces RedTorch
{
translation "192:207=168:184","240:247=185:191" //blue to red
}

Actor TallTorchGreen : TallTorchBlue replaces GreenTorch
{
translation "192:207=112:127","240:247=11:12" //blue to green
}
to change color of the blue torch to green or red if needed, using the same sprite for blue torch.

How do I do the same in ZScript?
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

Re: How to translate color of the sprite in ZScript?

Post by Blue Shadow »

The same way.
User avatar
etbasch
Posts: 25
Joined: Wed Apr 10, 2019 5:42 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Ukraine

Re: How to translate color of the sprite in ZScript?

Post by etbasch »

Blue Shadow wrote:The same way.
Like this:

Code: Select all

Class RedTorchNew: RedTorch replaces RedTorch {
    Default {
        translation "192:207=168:184","240:247=185:191"
        }
    }
?
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: How to translate color of the sprite in ZScript?

Post by Jarewill »

Don't forget the semicolon (;) at the end and it should work.
User avatar
etbasch
Posts: 25
Joined: Wed Apr 10, 2019 5:42 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Ukraine

Re: How to translate color of the sprite in ZScript?

Post by etbasch »

Jarewill wrote:Don't forget the semicolon (;) at the end and it should work.
It worked, thank you.
Post Reply

Return to “Scripting”