Prevent script from activating if a different script hasn't?

Sat Nov 06, 2021 12:24 am

script 5(void) {
Radius_Quake2(0,3,50,0,10,0);
SpawnSpot("Explosion",123);
Floor_MoveToValue(142,2000,888,0);
Floor_MoveToValue(143,2000,1040,0);
Floor_MoveToValue(144,2000,992,0);
}

script 6(void) {
FloorAndCeiling_RaiseByValue(146,10,204);
FloorAndCeiling_RaiseByValue(147,10,204);
Floor_RaiseByValue(148,10,204);
Floor_RaiseByValue(117,10,204);
}

If i wanted to prevent people from activating script 5 before script 6 and flashing a helpful bit of text on the screen, how would i do that? Both are activated via switch.

Re: Prevent script from activating if a different script has

Sat Nov 06, 2021 12:48 am

Create a variable and use if else statement.

Re: Prevent script from activating if a different script has

Sat Nov 06, 2021 6:22 am

Code:
Bool Script6Ok = False;

script 5(void) {

If(!Script6Ok) { Terminate; }

Radius_Quake2(0,3,50,0,10,0);
SpawnSpot("Explosion",123);
Floor_MoveToValue(142,2000,888,0);
Floor_MoveToValue(143,2000,1040,0);
Floor_MoveToValue(144,2000,992,0);
}

script 6(void) {
FloorAndCeiling_RaiseByValue(146,10,204);
FloorAndCeiling_RaiseByValue(147,10,204);
Floor_RaiseByValue(148,10,204);
Floor_RaiseByValue(117,10,204);

Script6Ok = True;
}

Re: Prevent script from activating if a different script has

Sat Nov 06, 2021 9:44 am

Thanks Logan, but is it possible to squeeze a print function in there? I've tried and im clueless :P

Re: Prevent script from activating if a different script has

Sat Nov 06, 2021 10:17 am

Yes...!?
Post what you've done. :roll:

Re: Prevent script from activating if a different script has

Sat Nov 06, 2021 10:42 am

script 5(void) {

If(!Script6Ok) { Terminate; Print(S:"message"); }

Radius_Quake2(0,3,50,0,10,0);
SpawnSpot("Explosion",123);
Floor_MoveToValue(142,2000,888,0);
Floor_MoveToValue(143,2000,1040,0);
Floor_MoveToValue(144,2000,992,0);
}

script 6(void) {
FloorAndCeiling_RaiseByValue(146,10,204);
FloorAndCeiling_RaiseByValue(147,10,204);
Floor_RaiseByValue(148,10,204);
Floor_RaiseByValue(117,10,204);

Script6Ok = True;

Re: Prevent script from activating if a different script has

Sat Nov 06, 2021 11:57 am

Put the Print message before the Terminate.

Re: Prevent script from activating if a different script has

Sat Nov 06, 2021 2:06 pm

lol Dude!
Seriouslly didn't you realize that by your self?
It happens with me all time. :mrgreen:

Re: Prevent script from activating if a different script has

Sat Nov 06, 2021 4:11 pm

:oops: