Charas-Project

Game Creation => Requests => Tutorials => Topic started by: fusiondragon2099@yahoo.ca on January 25, 2005, 04:31:57 PM

Title: Combination Lock Tutorial
Post by: fusiondragon2099@yahoo.ca on January 25, 2005, 04:31:57 PM
Ever wanted to have a combination lock for a door/locker/chest/whatever but didn't know how? Well, now you can.

To start, have a Push-Key event trigger where you want your lock.

Step 1: Have an Input Number command for the first number of your combination. Store this in the variable "Comb1".
Step 2: Have another Input Number command for the second number of your command. Store this in the variable "Comb2".
Step 3: Repeat Step 2 for the last numbers of your combination. Store it in the variable "Comb3", "Comb4", etc.
Step 4: Have a Fork Condition Variable like this:
<>FORK Optn Varbl "Comb1"-x
    <>FORK Optn Varbl "Comb2"-y
        <>FORK Optn Varbl "Comb3"-z
            <>Insert event for locker opening here
        :ELSE CASE
        <>
        :END CASE
        <>
    :ELSE CASE
    <>
    :END CASE
    <>
:ELSE CASE
<>Insert event for failing to open locker here. Don't bother with the other ELSE CASE events; the game doesn't check those.
:END CASE
<>