ACS ExecuteAlways and Terminate

Archive of the old editing forum
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.
Locked
User avatar
Chronos
Posts: 170
Joined: Tue Dec 30, 2008 1:58 pm
Location: Somewhere in your nightmare...

ACS ExecuteAlways and Terminate

Post by Chronos »

We know that ACS_ExecuteAlways can't be terminated via ACS_Terminate but is there any other way?
I maked much of scripts and decorate connected via ACS_Execute and ACS_Terminate and i want this scripts to have support with multiplayer which requires
ACS_ExecuteAlways.Is there any way to terminate such scripts?
User avatar
Enjay
 
 
Posts: 27115
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: ACS ExecuteAlways and Terminate

Post by Enjay »

I don't know if this would work and its suitability would depend on what you are trying to do but how about having the first "execute always" script listen out for a particular variable and terminate itself when the variable is set to a certain value. Then a second script could set the variable appropriately when you want the first one to terminate.
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Re: ACS ExecuteAlways and Terminate

Post by Zippy »

If something has been "ExecuteAlways"'d, you can't terminate it from the outside because you no longer have any definitive way to reference the running script. You would be saying "terminate script 4" but there may be 1, 2, 5, 10, etc. running instances of that script.

The only way such a script will end is if it terminates itself, either by reaching the bottom of the script or by use of the terminate keyword (which immediately ends the current script).
User avatar
Enjay
 
 
Posts: 27115
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: ACS ExecuteAlways and Terminate

Post by Enjay »

So, what I suggested should work, right? If the execute-always script is sitting in a loop waiting for the variable to be set and, when it is, it leaves the loop and goes to a terminate instruction/ the end of the script?
User avatar
Chronos
Posts: 170
Joined: Tue Dec 30, 2008 1:58 pm
Location: Somewhere in your nightmare...

Re: ACS ExecuteAlways and Terminate

Post by Chronos »

Yes it should work i find that in the end of ACS_ExecuteAlways paragrath in wiki.
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Re: ACS ExecuteAlways and Terminate

Post by Zippy »

Enjay wrote:So, what I suggested should work, right? If the execute-always script is sitting in a loop waiting for the variable to be set and, when it is, it leaves the loop and goes to a terminate instruction/ the end of the script?
Provided you structure it so that toggling the variable doesn't end every instance of the script but just the specific one you want (i.e. the one for the desired player).
User avatar
Enjay
 
 
Posts: 27115
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: ACS ExecuteAlways and Terminate

Post by Enjay »

Ah yes. I was forgetting about the possibility of multiple instances of the script which, given that it is being executed by "always" is likely.
Locked

Return to “Editing (Archive)”