Prevent script from activating if a different script hasn't?
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.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
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.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
-
DoomBoy1999
- Posts: 32
- Joined: Mon Dec 14, 2020 9:51 am
Prevent script from activating if a different script hasn't?
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.
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.
- ramon.dexter
- Posts: 1562
- Joined: Tue Oct 20, 2015 12:50 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Kozolupy, Bohemia
Re: Prevent script from activating if a different script has
Create a variable and use if else statement.
Re: Prevent script from activating if a different script has
Code: Select all
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;
}
-
DoomBoy1999
- Posts: 32
- Joined: Mon Dec 14, 2020 9:51 am
Re: Prevent script from activating if a different script has
Thanks Logan, but is it possible to squeeze a print function in there? I've tried and im clueless 
Re: Prevent script from activating if a different script has
Yes...!?
Post what you've done.
Post what you've done.
-
DoomBoy1999
- Posts: 32
- Joined: Mon Dec 14, 2020 9:51 am
Re: Prevent script from activating if a different script has
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;
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;
- SanyaWaffles
- Posts: 884
- Joined: Thu Apr 25, 2013 12:21 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Windows 11 for the Motorola Powerstack II
- Graphics Processor: nVidia with Vulkan support
- Location: The Corn Fields
- Contact:
Re: Prevent script from activating if a different script has
Put the Print message before the Terminate.
Re: Prevent script from activating if a different script has
lol Dude!
Seriouslly didn't you realize that by your self?
It happens with me all time.
Seriouslly didn't you realize that by your self?
It happens with me all time.
-
DoomBoy1999
- Posts: 32
- Joined: Mon Dec 14, 2020 9:51 am