a way for a script to check if another script has happened?

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.

a way for a script to check if another script has happened?

Postby KeaganH » Sun Oct 11, 2020 7:38 am

So what's supposed to happen is that in my map: a sound is suppose to play after you cross over a linedef, but only if another script has happened or else it just tells you to go find the place that executes the required script. I want to know if there is a way to check if another script has happened before executing, I've tried this:
Code: Select allExpand view
script 10 (void)
{
   If (ACS_Execute(11,0,0,0,0))
   AmbientSound("exeitor/laugh",127);
   else
   Setfont("TBIGFONT");
   PrintBold(s:"\c-I need to get the file on Eggman");
}


and

Code: Select allExpand view
script 10 (void)
{
   If (ScriptWait(11))
   AmbientSound("exeitor/laugh",127);
   else
   Setfont("TBIGFONT");
   PrintBold(s:"\c-I need to get the file on Eggman");
}


Thanks,

Keagan H.
KeaganH
 
Joined: 25 Sep 2020

Re: a way for a script to check if another script has happen

Postby Jarewill » Sun Oct 11, 2020 8:15 am

Use map variables for that.
For example:
Code: Select allExpand view
bool event1;

script 10 (void)
{
   If (event1)
   AmbientSound("exeitor/laugh",127);
   else
   
{ //Put this in brackets, otherwise the PrintBold will always execute
   Setfont("TBIGFONT");
   PrintBold(s:"\c-I need to get the file on Eggman");
   }
}

And in the other script put this:
Code: Select allExpand view
event1 = 1;
Jarewill
 
 
 
Joined: 21 Jul 2019


Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests