I want a ceiling raise effect, only if another ceiling raise has been executed first.
Would it look something like this?
script 111 (void)
{
Ceiling_RaiseByValue (22, 70, 104);
}
script 112 (void)
{Ceiling_RaiseByValue (23, 70, 104);
if script 111 (void);
Terminate;
}
The terminate line I added because I want the second script to work only once. I haven't designed the area yet, I was wondering if someone could tell me if this is right so that when I get to it, I wont get stuck.
Thanks in advance, you guys have been awesome!
A script that activates only if another has been activated.
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
-
- Posts: 340
- Joined: Wed Jan 24, 2007 8:54 pm
Re: A script that activates only if another has been activat
OK and what will activate the script 111? Because if it's not called from for example a [wiki]UsePuzzleItem[/wiki] line then there is no point in using a script consisting of just ONE action special.
terminate is for stopping running processes. It doesn't make sense putting it at the end of a script. It simply won't have any effect.The terminate line I added because I want the second script to work only once.
Code: Select all
bool raised;
script 111 (void)
{
Ceiling_RaiseByValue (22, 70, 104);
tagwait(22);
raised = true;
}
script 112 (void)
{
if(raised)
{
Ceiling_RaiseByValue (23, 70, 104);
tagwait(23);
ClearLinespecial(); // or if it is a thing then: SetThingSpecial(0, 0);
}
else
{
// here could be the groaning sound
}
}
-
- Posts: 340
- Joined: Wed Jan 24, 2007 8:54 pm
Re: A script that activates only if another has been activat
Thanks, I'll try this out soon. 
Is the else line required or will it work without it? I didn't want anything to happen as an alternative.

Is the else line required or will it work without it? I didn't want anything to happen as an alternative.
Re: A script that activates only if another has been activat
Usually if you press the use button in front of a line having no special, then you'll hear a groaning sound. This is the normal behaviour, but it can be strange if there is no sound at all while you are "using" a wall.
Because in this case if you omit the else branch and press use button in front of the line having script 112 and you haven't raised the ceiling tagged 22 yet then simply nothing happens and won't be any sound.
Because in this case if you omit the else branch and press use button in front of the line having script 112 and you haven't raised the ceiling tagged 22 yet then simply nothing happens and won't be any sound.
-
- Posts: 340
- Joined: Wed Jan 24, 2007 8:54 pm
Re: A script that activates only if another has been activat
It's when the player walks over a line that the script is activated, but I don't want the player knowing they're triggering anything, the line will be invisible.
Re: A script that activates only if another has been activat
OK then it can be omitted.
-
- Posts: 340
- Joined: Wed Jan 24, 2007 8:54 pm
Re: A script that activates only if another has been activat
Thanks for the help, the script works like I need it to.