[Sloved] How to cancel an ACS_ExecuteAlways?

Discuss all aspects related to modding Zandronum here.
Post Reply
Samuzero15tlh
Forum Regular
Posts: 260
Joined: Wed Sep 09, 2015 2:21 pm
Location: In home, sweet Home
Clan Tag: <skr>

[Sloved] How to cancel an ACS_ExecuteAlways?

#1

Post by Samuzero15tlh » Sun Nov 29, 2015 1:13 pm

Hmm I want to cancel a script what is called for ACS_ExecuteAlways. I know that it don't stop with terminate, so i want to knew how to stop that.

EDIT: Finally sloved.

Code: Select all

Bool Force_End = False;
Bool InUse = False;

Script 718 (Int Time) // Time Display
{
If(Inuse == False)
{
Inuse = True;
For(int t; Time !=0 && Force_End == False; Time--)
{
   HudMessage(d:Time;HUDMSG_Plain,30,CR_Blue,0.5,0.255,3.0,0.1);
   Delay(35);
}
HudMessage(s:"0";HUDMSG_Plain,30,CR_Red,0.5,0.255,3.0,0.1);
Inuse = False;
Force_End = False;
}
Else
{
Force_End = True;
Delay(1);
Restart;
}
}
Last edited by Samuzero15tlh on Sun Nov 29, 2015 7:51 pm, edited 1 time in total.
Everyone wants happiness without pain, but you cant have a rainbow without a rain.

I'm working in the Shotgun Frenzy Plus mod in my free time.
Yes, I have a pet that helps me to build doom projects, the Pack-O-Daemon, ain't it cute?.

Spoiler: My Other zandro stuff! (Open)


Samuzero15tlh

User avatar
Sean
IRC Operator
Posts: 983
Joined: Thu Jan 16, 2014 9:09 pm
Location: United Kingdom
Clan: Zandronum
Clan Tag: [Za]
Contact:

RE: How to cancel an ACS_ExecuteAlways?

#2

Post by Sean » Sun Nov 29, 2015 1:30 pm

Perhaps have a boolean variable somewhere, and somewhere in your script, do a check of that variable and if it's true, terminate; the script?
<capodecima> i dont say any more word without my loyer jenova

User avatar
Ænima
Addicted to Zandronum
Posts: 3583
Joined: Tue Jun 05, 2012 6:12 pm

RE: How to cancel an ACS_ExecuteAlways?

#3

Post by Ænima » Sun Nov 29, 2015 1:34 pm

Sean wrote: Perhaps have a boolean variable somewhere, and somewhere in your script, do a check of that variable and if it's true, terminate; the script?
Yep do this, this is how I would do it.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

Samuzero15tlh
Forum Regular
Posts: 260
Joined: Wed Sep 09, 2015 2:21 pm
Location: In home, sweet Home
Clan Tag: <skr>

RE: How to cancel an ACS_ExecuteAlways?

#4

Post by Samuzero15tlh » Sun Nov 29, 2015 4:13 pm

Code: Select all

Script 718 (Int EffectType,Int Time) // Time Display
{
Bool Inuse = False;
If(EffectType == 1)
{
If(Inuse == False)
 {
 Inuse = True;
  For(int t; Time !=0; Time--)
  {
  HudMessage(s:"\ccHaste ",d:Time;HUDMSG_Plain,30,CR_Blue,0.5,0.255,3.0,0.1);
  Delay(35);
  }
  HudMessage(s:"Haste 0";HUDMSG_Plain,30,CR_Red,0.5,0.255,3.0,0.1);
 }
 Else
 {
 // The part where it reset the timer.
 }
}
When its activated, the time displays, but when is activated again, the timer resets, so it "Terminates" the past timer and starts the new timer.
Thats what im trying to do.
Last edited by Samuzero15tlh on Sun Nov 29, 2015 4:19 pm, edited 1 time in total.
Everyone wants happiness without pain, but you cant have a rainbow without a rain.

I'm working in the Shotgun Frenzy Plus mod in my free time.
Yes, I have a pet that helps me to build doom projects, the Pack-O-Daemon, ain't it cute?.

Spoiler: My Other zandro stuff! (Open)


Samuzero15tlh

User avatar
Sean
IRC Operator
Posts: 983
Joined: Thu Jan 16, 2014 9:09 pm
Location: United Kingdom
Clan: Zandronum
Clan Tag: [Za]
Contact:

RE: How to cancel an ACS_ExecuteAlways?

#5

Post by Sean » Sun Nov 29, 2015 5:27 pm

[spoiler]
Sean wrote: Perhaps have a boolean variable somewhere, and somewhere in your script, do a check of that variable and if it's true, terminate; the script?
[/spoiler]

I'm sure you'll find a way to add this in somewhere.
<capodecima> i dont say any more word without my loyer jenova

User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

RE: How to cancel an ACS_ExecuteAlways?

#6

Post by ibm5155 » Sun Nov 29, 2015 7:23 pm

break and terminate can do the job, it's just a matter of logic use.
or even some bool logic into the for loop like For(int t; Time !=0 && Force_End == false; Time--)
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

Samuzero15tlh
Forum Regular
Posts: 260
Joined: Wed Sep 09, 2015 2:21 pm
Location: In home, sweet Home
Clan Tag: <skr>

RE: How to cancel an ACS_ExecuteAlways?

#7

Post by Samuzero15tlh » Sun Nov 29, 2015 7:49 pm

It was super effective!!

Code: Select all

Bool Force_End = False;
Bool InUse = False;

Script 718 (Int Time) // Time Display
{
If(Inuse == False)
{
Inuse = True;
For(int t; Time !=0 && Force_End == False; Time--)
{
   HudMessage(d:Time;HUDMSG_Plain,30,CR_Blue,0.5,0.255,3.0,0.1);
   Delay(35);
}
HudMessage(s:"0";HUDMSG_Plain,30,CR_Red,0.5,0.255,3.0,0.1);
Inuse = False;
Force_End = False;
}
Else
{
Force_End = True;
Delay(1);
Restart;
}
}
This worked so good! Thank you guys!
Everyone wants happiness without pain, but you cant have a rainbow without a rain.

I'm working in the Shotgun Frenzy Plus mod in my free time.
Yes, I have a pet that helps me to build doom projects, the Pack-O-Daemon, ain't it cute?.

Spoiler: My Other zandro stuff! (Open)


Samuzero15tlh

Post Reply