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

switches in zdoom

Recommended Posts

Hello
I'd like to make a switch that executes a script if you have a yellow keycard, and print "you need a key" if you don't. So far, so good, but i don't want this switch to "activate" if you don't have the card, just print the message. Can this be done?

Share this post


Link to post

OK, here's an example for you.

We'll have this in your behaviour behavior lump (bloody American spelin):

#include "zcommon.acs"

bool gotkey = false

script 1 (void)
{
gotkey = true
}

script 2 (void)
{
if(gotkey)
{
// Open your door here.
} else {
print(s:"You need a key!");
}
}
I think that would work. Next, you have to make the key execute script 1 when picked up (special 80 - second tab in the thing properties if you're using Doom builder) and make the switch execute script 2.

Tell me how it all goes!

Share this post


Link to post
Nixot said:

We'll have this in your behaviour behavior lump (bloody American spelin):

BEHAVIOUR is nine characters, not eight.

Share this post


Link to post
Gez said:

BEHAVIOUR is nine characters, not eight.


I know. That's why I crossed it out.

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
×