Page 1 of 1

How to translate color of the sprite in ZScript?

Posted: Tue Sep 29, 2020 6:17 pm
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?

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

Posted: Tue Sep 29, 2020 7:17 pm
by Blue Shadow
The same way.

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

Posted: Wed Sep 30, 2020 6:52 am
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"
        }
    }
?

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

Posted: Wed Sep 30, 2020 7:37 am
by Jarewill
Don't forget the semicolon (;) at the end and it should work.

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

Posted: Wed Sep 30, 2020 4:57 pm
by etbasch
Jarewill wrote:Don't forget the semicolon (;) at the end and it should work.
It worked, thank you.