Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Kyka

2 nublet questions about ACS

Recommended Posts

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. :)

Share this post


Link to post
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.

Share this post


Link to post

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"))

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×