Adult Types
After you set up your "holding tank" folder for the doors, open Tmog
and clone doors > Door - Wood 2. Name the door adultsonly.iff,
and make sure you identify the door as being a "test door" so you do
not get confused. When you are done cloning, close down Tmog and open up IFF.
With IFF open, bring in your wood door, select the BHAV tab and then look to
your right at all the behaviors that are contained in the door object. There are
quite a few of them, but for our purposes, only ONE behavior will concern us.
So what is our purpose? We're going to take this door and make it to where
only adults can go through.
First, I'd like you to look through the behaviors, and on your own, try to
determine which behavior it is that we need to modify.
Did you determine it was Behavior #4113: "goto other side"? If so,
you are correct. If you noticed, none of the other behaviors (going by their names)
had anything with what we are trying to do: stop all going through the door unless
they are adults.
Double click #4113 now to open it, and then rewrite, so that your IFF screen
looks like this:
Fig. 1.6
The above lines are telling us that the door is checking to see which direction
it has been placed in (Line 0), and then to go to the enter door position, depending
which way the door is facing (Lines 1 and 2). No big deal. This is why we are
working with doors. They are extremely easy to do.
Next, add two new lines. They will be IFF's standard new lines, of course:
Fig. 1.7
The above two lines were created so that we can insert our "Checks"
to see if the person trying to enter is an adult; and, rather than manually writing
code, we're going to use a Global already in the game, that checks to see if the
Sim attempting to use the object in question (in this case the door), is an adult.
|