MasterofJKD Posted June 26, 2012 I was trying to make a yellow key switch and a blue key switch to open 1 door through ACS. Does anyone know how to do this and if so where can I learn the commands to do it. Also as a side note, I was curious if anyone has made an ACS script tutorial like a youtube video or something that you can follow and it would teach you how to do basic and advanced command lines. Any help would be appreciated. Thank you. 0 Share this post Link to post
Krispy Posted June 26, 2012 For acs tutorials, I recommend Chubz on youtube. As for your question, do you mean the player needs both keys at the same time? 0 Share this post Link to post
MasterofJKD Posted June 26, 2012 yes he needs both the blue and the yellow keycard and hit the respective switches for the door to open. And I searched on Youtube, and sadly there was only basic acs commands. 0 Share this post Link to post
ReX Posted June 26, 2012 MasterofJKD said:I was trying to make a yellow key switch and a blue key switch to open 1 door through ACS.One way to make this work is through 3 separate scripts, as follows:int yellowkey; int bluekey; Script 1 (void) //Opens doon when player has both blue & yellow keys {If (yellowkey && bluekey) { Door_Open (tag, speed, lighttag); } else print(s:"You need both the yellow & blue keys."); } Script 2 (void) //When yellow key is picked up { yellowkey == 1; } Script 3 (void) //When blue key is picked up { bluekey == 1; } 1 Share this post Link to post
Gez Posted June 26, 2012 Three scripts is overkill; one is more than enough. The following code assumes the door to open is tagged 7. Replace 7 with any other value you need, as appropriate. I've also numbered that script 1, you can use a different number if you need to. int bothswitches = 0; Script 1 (void) { if (++bothswitches == 2) { Door_Open(7, 64) } } The variable declared outside of the script itself will not be reset when the script is run, so each time the script is called, it will be incremented by one and then compared to 2. The first time it is run, it'll be worth 1 and the test will fail. The second time it is run, it'll be worth 2 and the test will succeed, resulting in a door that opens. Now, let's call that switch. Your blue and your yellow switch will both have the special 83:ACS_LockedExecute. First parameter is the script number, so 1 in this example. Second parameter is the current map, so use 0. Third and fourth parameters are for script arguments, but we don't need them here so leave them as 0. The final parameter is the lock number: use 130 on the blue switch, and 131 on the yellow switch. 0 Share this post Link to post
MasterofJKD Posted June 27, 2012 Thank you guys so much for the scripting, but I still have 1 more question, where did you guys pick up the ACS knowledge. Or better yet how should I get started, I mean I know the basic Door_Open script and the deep water effect, and other simple scripts like floor_lower and such but not this advanced. How would I learn the "if" scripts and the like? Sorry for the wall of text... 0 Share this post Link to post
Gez Posted June 27, 2012 MasterofJKD said:where did you guys pick up the ACS knowledge Here. 0 Share this post Link to post
ReX Posted June 27, 2012 MasterofJKD said:...how should I get started....Here is a link to a scripting primer. It was written a while ago, but the principles are still valid. 0 Share this post Link to post
boris Posted June 27, 2012 Isn't it possible to use CheckInventory? Like if(CheckInventory("YellowCard") && CheckInventory("BlueCard")) Door_Open(7, 64); else print(s:"You need both the yellow & blue keys."); 0 Share this post Link to post
Gez Posted June 27, 2012 If what you want to do is a door that needs two keys to open, the simplest solution is to use LOCKDEFS and use that new lock number. What the OP wanted was a door that opens after two switches have been activated. It just so happens one of the switches is blue-locked, the other yellow-locked. 0 Share this post Link to post
MasterofJKD Posted June 28, 2012 I went through that tutorial a little so I know a few more basics, is there a way to identify the linedef switches, and then have the script check if each switch has been activated before it opens the door. I'm trying to fill in the if(....) statement. 0 Share this post Link to post
Gez Posted June 28, 2012 Use the script I gave you a few posts above. Make the switches not repeatable (they shouldn't be repeatable by default). Foolproof. 0 Share this post Link to post