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.
by Elendir » Wed Feb 17, 2021 3:48 am
Hi everyone,
Seems to be a very easy thing. I have a switch that once fired at should lower two adjacent platforms down. Here's the script:
- Code: Select all • Expand view
script 13 (void)
{
// just lower two platforms in the same time
Plat_DownWaitUpStay (57, 32, 56); // tag, speed, delay
Plat_DownWaitUpStay (58, 32, 56); // tag, speed, delay
}
Only the first platform (tag 57) goes down and then up again. Sector 58 stays intact.
What should I do to move them both in the same time?
-

Elendir
-
- Joined: 15 Jul 2020
- Operating System: Windows 10/8.1/8/201x 64-bit
by Elendir » Wed Feb 17, 2021 4:22 am
OK. I found the culprit!
Both platforms are adjacent to one another. They both have the same action to go down and then up. But only the first one has a clear next adjacent sector that plays the role of the bottom floor to it. So only the first one moves. The other one is simply not moving because it doesn't have a relative floor to itself to move to.
Well, it wasn't that obvious at first.
-

Elendir
-
- Joined: 15 Jul 2020
- Operating System: Windows 10/8.1/8/201x 64-bit
by Enjay » Wed Feb 17, 2021 4:26 am
Are you happy with how your map is behaving now, or do you still want the original setup? There are ways to achieve what you were originally trying to do.
-

Enjay
- Everyone is a moon, and has a dark side which he never shows to anybody. Twain
-

-
- Joined: 15 Jul 2003
- Location: Scotland
by Elendir » Wed Feb 17, 2021 4:35 am
Yes, I'm happy with the current solution. Here's the script the works exactly as I want:
- Code: Select all • Expand view
script 15 (void)
{
int move_speed = 48;
int move_height = 128;
// just lower two platforms in the same time
Floor_LowerByValue(57, move_speed, move_height); // tag, speed, height
Floor_LowerByValue(58, move_speed, move_height);
delay ( 35*5);
Floor_RaiseByValue(57, move_speed, move_height);
Floor_RaiseByValue(58, move_speed, move_height);
}
-

Elendir
-
- Joined: 15 Jul 2020
- Operating System: Windows 10/8.1/8/201x 64-bit
Return to Scripting
Who is online
Users browsing this forum: No registered users and 1 guest