FearNoEvil Posted May 29, 2022 (edited) Basically how do you connect actions but also disable other actions in the same script. Let's say the player presses a button to lower platform 1, platform 1 lowers, but the button for platform 2 is now unusable, and vice versa. I'm reading the wiki but I'm not grasping this. Using switch/case function: Script 1 (void) { switch(Plat_DownByValue(3,6, 0, 17)) { case 1: Plat_DownByValue(3, 6, 0, 17); break; } switch (Plat_DownByValue(4, 6, 0, 17)) { case 1: Plat_DownByValue(4, 6, 0, 17); } Edited May 29, 2022 by FearNoEvil 0 Quote Share this post Link to post
FearNoEvil Posted May 30, 2022 (edited) Ok ok. After some rest and a bit more reading I'm finally getting somewhere. I realize the errors of my ways so I scrapped the above script and made a new one. #include "zcommon.acs" bool platform1Lowered = false; bool platform2Lowered = false; Script 1 (int platformNumber) {// One platform lowers the other gets disabled permanently, vice versa if (platformNumber == 1) { platform1Lowered = true; Plat_DownByValue(1,15,0,17); } else if (platformNumber == 2) { platform2Lowered = false; } if (platformNumber == 2) { platform2Lowered = true; Plat_DownByValue(2,15,0,17); } else if (platformNumber == 2) { platform1Lowered = false; } } It works sorta. The platforms lower after pressing their respective switches, but what I want is after pressing one switch, the other switch for the other platform is disabled permanently, i.e. the other switch doesn't flip and its platform does not lower. Edited May 30, 2022 by FearNoEvil 0 Quote Share this post Link to post
Rifleman Posted May 30, 2022 (edited) How about this? The second switch will still flip, but won't do anything. It would take more tinkering to make it so it doesn't. I just put this together in my head, so hopefully it's correct. #include "zcommon.acs" bool platform1Lowered = false; bool platform2Lowered = false; Script 1 (int platformNumber) { if (platformNumber == 1 && platform1Lowered == false) { platform1Lowered = true; platform2Lowered = true; Plat_DownByValue(1,15,0,17); } else if (platformNumber == 2 && platform2Lowered == false ) { platform1Lowered = true; platform2Lowered = true; Plat_DownByValue(2,15,0,17); } } Edited May 30, 2022 by Rifleman 1 Quote Share this post Link to post
FearNoEvil Posted May 30, 2022 (edited) Ah I see! Yes, that works, thanks! Edited May 30, 2022 by FearNoEvil 1 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.