Question

Basically, I have a script. It needs to do some things. It needs to, when a button is pressed, begin raising a ceiling, when that is done, raise another, and then another. While this is happening, I need it to progressively spawn chaingunners. I can't figure this out. It seems as if I have to have everything happen at once. This is what I have so far, and I don't necessarily want someone to do it for me, but I'd like a walkthrough so I understand and can repeat it. (Thanks!)

 

#include "zcommon.acs"

script 1 (void)
{
    Ceiling_RaiseByValue(1, 1, 120);
    Thing_Spawn(3, T_CHAINGUY, 90);
    
}

Share this post


Link to post

4 answers to this question

  • 3

In addition, I'd recommend checking out https://zdoom.org/wiki/TagWait - this function will cause the script to pause until the tagged sector has stopped moving. Depending on the effect you're trying to achieve, it can be a lot easier to use and lower maintenance.

1 person likes this

Share this post


Link to post
  • 0
 #include "zcommon.acs"

script 1 (void)
{
    Ceiling_RaiseByValue(first one);
    delay (35*needed_seconds);
    Thing_Spawn(first chaingunner);
		delay (35*needed seconds);
    Ceiling_RaiseByValue(second one);
    delay (35*needed_seconds);
    Thing_Spawn(second one);
		delay (35*needed seconds);
    Ceiling_RaiseByValue(third one);
    delay (35*needed_seconds);
    Thing_Spawn(third one);   
} 

35 means "35 tics (read as "1 second"). Some people do 36 instead of 35, because "read the wiki". Anyway, quick maths. 35 * 3 = 3 seconds. 35 * 10 = 10 seconds

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now