It's been a while since I created scripts and I'm a little rusty. Using HeXen format I need to create an elevator that moves up and down perpetually, while stopping at the various floors. Here's what I am trying to set up:
1. An elevator that moves between 4 levels (call them L0, L1, L2, L3)
2. The elevator starts at L0 and automatically starts moving up to L1 upon map start
3. The elevator pauses at L1 before automatically moving up to L2
4. The elevator pauses at L2 before automatically moving up to L3
5. The elevator pauses at L3 before automatically moving down to L2
6. The elevator pauses at L2 before automatically moving down to L1
7. The elevator pauses at L1 before automatically moving down to L0
8. The elevator pauses at L0 before repeating steps 2 to 7
I know how to implement all steps except the part in Step 8, where the process repeats itself. I have looked at the FOR, WHILE, and UNTIL examples in the wiki but I'm obviously missing something.
I'd appreciate any help. Thanks.
How to Set up a "Perpetual" Up/Down Elevator? [HeXen Format]
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!)
-
- Posts: 5043
- Joined: Sun Nov 14, 2010 12:59 am
Re: How to Set up a "Perpetual" Up/Down Elevator? [HeXen Format]
You can setup a while loop like the following to execute a block of code repeatedly:
Code: Select all
while (true)
{
// Looping code goes here.
}
Re: How to Set up a "Perpetual" Up/Down Elevator? [HeXen Format]
@Blue Shadow: Thanks for the guidance. I'm off to implement it.