Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Ness

MORE Zdoom Scripint questions.

Recommended Posts

I checked the FAQ's, I checked the Zdoom forums, and I checked our forums.

No Dice.

How in the hell can I get my script to do this:

Player walks in a room
Script checks if he has an item (Certain key) (THis is my problem!)
If he does, he passes (this is easy)
if not, he cannot pass (This isn't really relevant how he is stopped).

Share this post


Link to post

Simple option - make the script a key activated type. If he doesn't have the key, a line in front blocks him, if he does a script runs and unblocks the path.

Alternatively, do a CheckInventory for BlueCard, YellowCard, RedCard, BlueSkull, YellowSkull or the RedSkull.

Share this post


Link to post

Thanks, but with the CheckInventory, how would one set that up?

Is it a boolean? (True false?) do I have to input the number of the item or it's actual name? I tried to look for it on the editing part of zdoom but it's kinda wonky! :)

Share this post


Link to post

OK, I'm not too hot on this kind of scripting, but I think you'd need something like this:

script 1 (void) {
if (CheckInventory("BlueCard") == 1)
        {
        Do stuff
        }
        else
        {
        Do other stuff
        }
}
I think CheckInventory checks how much of the asked item you have. With keys that will be 1 or 0, but with ammo, health etc it could be a wider range. You specify the item by its name (capitalisation is important). To get the correct names of inventory items, start a log file and dump the inventory classes to it.

eg (at the console)

logfile log.txt
dumpclasses inventory

Share this post


Link to post

Thank you SO much! I've some some C++ Programming so the if else statements shouldn't be a problem!

Thank you so much for the help! :D

Ness

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
Sign in to follow this  
×