PalaceTools.com

HOME

COMMUNITY:
» Palace Index
» Coming Events

RESOURCES:
» Manuals
» Tutorials
» Email Lists

TOOLS:
» Client Tools
» Design Tools
» Server Tools

LINKS:
» Web Rings
» Audio
» Graphics
» Scripting
» Hosting
» Other Links

LANGUAGES:
» Français
» Português
» Español
» Dansk
» Deutsch

Add

: TreeSprite's Lock Tutorial

So you say you want a lockable room with more than one door? Never fear, help, and understanding are just a hop skip and a jump away! :+)

Here is what you need to do:

First Create a new room. Now, in that new room create three spots. It doesn't matter what the ID numbers of the spots are, so long as you know what they are for later reference. Make sure to set the State for all the spots as open. Now, set two of the spots as Type: Lockable Door. Set the other as Type: Normal. Make sure to set the State for all the spots as open. Choose the Destination for each of your two doors. The doors are the two spots that you just set as Type: Lockable Door. Now click on the door that you set as normal, and click edit pictures. First add your open lock picture into the edit pictures window, then add your closed lock picture in the edit pictures window. Ok, now you are ready for the scripting portion of the lock.

ON SELECT
{
  { 0 10 SETSPOTSTATE 3 UNLOCK 5 UNLOCK }
  { 1 10 SETSPOTSTATE 3 LOCK  5 LOCK } 3 ISLOCKED IFELSE
}
ON ENTER
{
  3 ISLOCKED 10 SETSPOTSTATE
}

Now for a little clarification:

{ 0 10 SETSPOTSTATE 3 UNLOCK 5 UNLOCK }

This section of the script sets the original state of our lockable doors as unlocked. The number 0 here represents the original state of the spot. ** The 0 state will be represented graphically by the unlocked gif. ** Number 10 refers to the spot ID of the door that you set to normal into which you will be placing the lock script. ** This is also the door that contains your lock gifs. ** Numbers 3 and 5 correspond to the ID of the lockable doors.

** I suppose that this is the spot where you are all asking about the DEST command right? Here's your answer: The Dest command when used in the case of more than one door can cause errors, so specifying the ID of each door to be locked is best.

{ 1 10 SETSPOTSTATE 3 LOCK  5 LOCK } 3 ISLOCKED IFELSE

The section above represents the action state. This is the action for the normal spot 10, which sets the state for doors 3 and 5 as locked. The IFELSE command is used so that we ensure that the door is locked ON SELECT every time the lock is engaged.

ON ENTER
{
  3 ISLOCKED 10 SETSPOTSTATE
}

This portion of the script is necessary for the IFELSE statement to function to properly reset the SPOTSTATE for the lockable doors when anyone enters the room.

Now that you understand what each section of the script does, it's time to replace the example ID's with the ID's of your spots. After you have done that click on the spot that you previously set as normal and paste your revised script into the window.

I'm sure that if you are new to lockable doors that this example is still a bit confusing. However, I'm sure that if you attempt making your own lockable door set by following the instructions that knowledge will "lock" in for you.

Ok, I admit that was bad. :+) So get locking already!

TreeSprite



PalaceTools.com (c) 2000, 2001
PalaceTools.com is a privately funded public service for the community of people who use the Palace Chat software.
contact us  |  disclaimer