Kyka Posted September 17, 2009 nublet question 1): What is the proper syntax for checking if the player has a blue key before executing a script, say something like: Script 8 (void) //blue key door UNFINISHED { If PLAYER HAS THE BLUE KEY { Ceiling_RaiseByValueTimes8(38, 4, 2); ACS_Execute(12, 0, 0, 0, 0); ACS_Execute(13, 0, 0, 0, 0); delay(40); ACS_Terminate(12, 0); ACS_Terminate(13, 0); delay(40); Ceiling_RaiseByValueTimes8(38, 8, 3); ACS_Execute(12, 0, 0, 0, 0); ACS_Execute(13, 0, 0, 0, 0); delay(35); ACS_Terminate(12, 0); ACS_Terminate(13, 0); delay(20); Door_Close(38, 96); delay(105); Door_Open(38, 32); delay(25); } else { print(s:"You need a blue key card. Seriously."); } } nublet question 2): what does the chg function do? I have no idea, and I can't find it in DoomBuilders list of commands or on the list of action specials on wiki. (Following code is from Agent_Sporks Ultimate Simplicity, which I have been pulling apart quite a lot recently, and just wondered what it does.) Script 50 (void) { chgChaingun = 1; chgAmmo = 1; } Script 51 (void) { chgYellowCard = 1; } Thanks people. :) 0 Share this post Link to post
alien8 Posted September 17, 2009 In regards to the first question, I'd imagine CheckInventory should get you pointed in the right direction. 0 Share this post Link to post
Jodwin Posted September 17, 2009 Kyka said:nublet question 2): what does the chg function do? I have no idea, and I can't find it in DoomBuilders list of commands or on the list of action specials on wiki. (Following code is from Agent_Sporks Ultimate Simplicity, which I have been pulling apart quite a lot recently, and just wondered what it does.) Script 50 (void) { chgChaingun = 1; chgAmmo = 1; } Script 51 (void) { chgYellowCard = 1; } Thanks people. :) Those aren't functions, they're variables. Functions always have the parentheses with possible arguments ( (...) ) following their names. 0 Share this post Link to post
EarthQuake Posted September 17, 2009 CheckInventory("BlueCard") and CheckInventory("BlueSkull") will both return positive if the player possesses a blue keycard or blueskull, respectively. So to check for a blue keycard:If (CheckInventory("BlueCard")) { // Do something. } Else { Print(s:"You don't have the fucking key, mong."); }Or if you wanted to check for either:If (CheckInventory("BlueCard") || CheckInventory("BlueSkull"))Or if you wanted to check for both:If (CheckInventory("BlueCard") && CheckInventory("BlueSkull")) 0 Share this post Link to post
Kyka Posted September 17, 2009 Thanks for the replies once again everyone. Much appreciated. :) 0 Share this post Link to post