TTLG|Thief|Bioshock|System Shock|Deus Ex|Mobile
Results 1 to 14 of 14

Thread: RegionMask

  1. #1
    Member
    Registered: Dec 2001

    RegionMask

    When setting a key to match a lock what does RegionMask have to do with it? I Read a tutorial on keys and locks it said that RegionMask could be set to anything from 1-999. If I set it to anything but 1 or 0 it sets itself back to 0. I have already made a locked door and key that work fine with RegionMask set to 1 and LockID set to 1. For my second lock I'm guessing that I have to set it's LockID to 2 or anything else but 1. So what is RegionMask? Also what is MasterBit?

    [ December 18, 2001: Message edited by: age2000 ]


  2. #2
    Member
    Registered: Dec 2001
    Location: Marlboro, MA, USA

    the numbers must start with 1, such as 11 or 12 or 134, but not 2 or 3 or something
    The Keep for Thief 1 and 2 FMs, Shadowdark for Thief 3 and Dark Mod FMs

  3. #3
    Member
    Registered: Dec 2001

    So... What does RegionMask do? Should I bother setting it to something or just leave it at 0?

  4. #4
    Member
    Registered: Dec 2000
    Location: Finland

    The following material is a part of the official tutorial Locks&Doors.Doc. This file is in the t2docsall.zip that can be found in the-Circle. I advice you (and why not everyone) to download that file, because it contains a lot of information about for example building methods and is very helpful in creating your mission.

    The least you need to know (in Thief): If no “Master Bit” is ever set TRUE, then all “Region ID’s” should be set to the same (non-zero) value. To make simple, matching categories of keys and locks, give each set of keys a Lock ID equal to the Lock ID of the matching locks.
    In a mission which includes master keys, or adheres more to the “security codes” model, it is necessary to understand the interpretation of these properties more precisely. A given KeySrc and KeyDst are considered to match according to the following rules, applied in order:
    1. If their Region ID’s have no bits in common, then they do not match.
    2. If the KeySrc Master Bit is TRUE, they match.
    3. If the KeySrc and KeyDst are equal, they match.
    4. They don’t match.
    Example: A mission includes two mansions, the manor of Lord Hatfield and the manor of Lord McCoy. Each mansion has various locks which are opened by different keys. Moreover, there exists a master key to Lord Hatfield’s mansion.
    All locks and keys which pertain to Lord Hatfield’s mansion are given a Region ID of 1. Those for Lord McCoy’s mansion have a Region ID of 2. The Lock ID’s of the keys in each mansion can be assigned independently; neither key can effect a lock in the other mansion because it will fail Rule 1 before it ever gets to try Rule 3. Finally, the master key for Lord Hatfield’s manor is given a Master Bit of TRUE and a Region ID of 1. It will pass Rule 1 and then succeed Rule 2, opening any lock in the manor regardless of their Lock ID’s.
    Note that this notion of “Region” does not have to be interpreted geographically. So, if one found it convenient, one could assign a particular Region to all a mission’s doors, and a different Region to chests

  5. #5
    robert gronemann
    Guest

    I reccommend this approach:

    Required materials
    3 ring binder with separaters
    3 hole punch
    Printer
    Ability to use copy/paste function
    Word98 or something similar
    Access to ttlg forums

    1. Print all t2 docs from the aformentioned loctions.
    2. Open word processor
    3. Access the forum.
    4. Discover or Search for pertinant info
    5. Copy selections and paste them in Word
    6. Label folder separaters with topic headings such as AI, Doors, S&R, etc.
    7. Print Word documents.
    8. Punch documents. Insert documents (including t2docsall) into folder according to subject.
    9. Store folder near computer work station or in the bathroom.

  6. #6
    Member
    Registered: Apr 2001
    Location: Lost in the BSP...

    [quote]Originally posted by BWV1080:
    8. Punch documents. Insert documents (including t2docsall) into folder according to subject.


    Buy 3-hole paper!!

  7. #7
    robert gronemann
    Guest

    DOH!

  8. #8
    Member
    Registered: May 2002
    Location: Texas
    Sorry to resurrect this thread, but I have a question about the master bit. What purpose does it serve on locks and doors?

  9. #9
    Dóttirin klęšist oft móšur möttli
    Registered: Apr 2015
    Basic Tutorial

    MasterBit on a key makes it open all doors than can be opened with a key (with matching RegionID index)
    Code:
    ObjProp "KeySrc"             // type sKeyInfo                  , flags 0x0011 , editor name: "Engine Features: KeySrc"
    {
        "MasterBit" : bool
        "RegionMask" : bitflags
        "LockID" : uint
    }
    
    
    ObjProp "KeyDst"             // type sKeyInfo                  , flags 0x0011 , editor name: "Engine Features: KeyDst"
    {
        "MasterBit" : bool
        "RegionMask" : bitflags
        "LockID" : uint
    }

  10. #10
    Member
    Registered: May 2002
    Location: Texas
    Yes I know about the key's master bit but I was asking about the lock's master bit.

  11. #11
    Dóttirin klęšist oft móšur möttli
    Registered: Apr 2015
    According to this the masterbit flag (KeyDst) has to be set on doors in order to make a master key work. But that's not true. No need to do this. The masterbit flag on the (master)key (KeySrc) is the important setting.

  12. #12
    Member
    Registered: Apr 2011
    I was curious about the answer too, so I've just checked the source code [lockprop.cpp:KeyWorksOnLock()], and Unna is correct.

    When checking if a key works on a lock, only the key/KeySrc's master bit is considered.

    The master bit of the door/KeyDst is never used anywhere. The only reason it even exists is because the KeySrc and KeyDst properties have the same data structure, presumably because the code is simpler that way.

  13. #13
    Member
    Registered: May 2002
    Location: Texas
    Thanks Unna, and thanks vfig. That's what I figured as I read your post even though LGS put a tick box in the KeyDst property window anyway. It might have been used in an older version of dromed we never saw and became redundant.

  14. #14
    Member
    Registered: Jan 2001
    Location: Formby, NW England
    I've updated the entry on the Dromesday Book. I also re-read that section of the original Locks & Doors file. It doesn't say that the checkbox is used by KeyDst, so I think the error arose due to the general idea the keys and locks should match.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •