I created a console and assigned the first of three textures to it. The three textures are from D3 Textures Set and are nearly identical except for some small lights. Using Zscript I can get it to change from TXT1 to TXT2 to TXT3, but then it stops. How do I make it loop back and repeat the script?
script 4 (void) {
SetLineTexture (222, SIDE_FRONT, TEXTURE_BOTTOM, "CPNL3K0");
delay (17);
SetLineTexture (222, SIDE_FRONT, TEXTURE_BOTTOM, "CPNL3K1");
delay (17);
SetLineTexture (222, SIDE_FRONT, TEXTURE_BOTTOM, "CPNL3K2");
delay (17);
What do I need here to make it go back to the beginning of the script and repeat????
}
Alternating Line Textures
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!)
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!)
Re: Alternating Line Textures
You could just add a "while" loop for it
Code: Select all
script 4 (void)
{
while(1) // This will be a permanent loop, there are no conditions for it to stop, ever
{
SetLineTexture (222, SIDE_FRONT, TEXTURE_BOTTOM, "CPNL3K0");
delay (17);
SetLineTexture (222, SIDE_FRONT, TEXTURE_BOTTOM, "CPNL3K1");
delay (17);
SetLineTexture (222, SIDE_FRONT, TEXTURE_BOTTOM, "CPNL3K2");
delay (17);
}
}
Re: Alternating Line Textures
This looks like [wiki]ACS[/wiki], not [wiki]ZScript[/wiki]. You can put a [wiki]restart[/wiki] to have the script go back to its beginning, or put the whole set of instructions inside a [wiki]while[/wiki] (1) loop.
However, you could also remove the script entirely and instead use [wiki]ANIMDEFS[/wiki] to handle the animation cycle automatically.
However, you could also remove the script entirely and instead use [wiki]ANIMDEFS[/wiki] to handle the animation cycle automatically.
Re: Alternating Line Textures
Thanks, Virathas and Gez. The while(1) works like I want it to. I'll have to explore ANIMDEF's for future maps.