Door Locks

    Asvarduil

    Builder of Very Small Ships
    Joined
    Apr 17, 2015
    Messages
    272
    Reaction score
    133
    • Community Content - Bronze 1
    • Purchased!
    Right now, you can make a faction-based door lock through a very block-inefficient process

    Code:
    Security Switch -> NOT -> AND <- Door Switch
                               |
                               v
                              NOT
                               |
                               v
                          Door Blocks
    In real life locks don't even take up a 1m x 1m x 1m cube (usually, far less). Of course, 1x1x1 is the dimensions that StarMade deals in, so I'd like to suggest a "Lock Block".

    Code:
    Lock Block
    HP: 50
    Armor: 0%
    
    "Creates a lock for a group of door blocks.  Wire a switch to this block, then this block to a group of door blocks to make the blocks only open if that switch is turned on.  Press R to enable or disable the lock."
    
    How: Switch -> Lock -> Door Blocks
    The "Lock Block" refactors all of that nasty Boolean logic that munchkins and ship-thieves can't be bothered to learn, and puts it in a single, efficient package for securing your stuff against everything that's not missiles or lasers.

    I know spawn sector ship thieves will hate this, but they already are less than fond of the 5-block setup. Why make their lives any easier?
     
    Last edited:

    jayman38

    Precentor-Primus, pro-tempore
    Joined
    Jul 13, 2014
    Messages
    2,518
    Reaction score
    787
    • Purchased!
    • Thinking Positive
    • Legacy Citizen 4
    I'd love if the switch block also had an optional keypad with programmable code.

    Maybe in future versions, it could also interact with specific items, so that you could go on some kind of quest for some kind of key needed to open a certain lock.
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    You should be able to update passwords via logic.
    Some may have different keys for the security officers or crew members or bridge staff.

    If it gets done, make it right, right from the beginning.
     
    • Like
    Reactions: Asvarduil

    Asvarduil

    Builder of Very Small Ships
    Joined
    Apr 17, 2015
    Messages
    272
    Reaction score
    133
    • Community Content - Bronze 1
    • Purchased!
    I think that your password suggestion and my dumb lock idea are two different things, but I think having both is a good idea. Maybe the keypad can be shot out, but the dumb lock is more durable? Vice versa? There are all sorts of ways to do this.
     
    Joined
    Jan 16, 2015
    Messages
    298
    Reaction score
    81
    Lockable doors/ships and better faction permissions are a must, It's annoying the lowest ranked in our factions can still open doors and access storage (and therefore able to loot items) on ships and stations set to higher ranks. Also some like myself wish to keep access to my own ship restricted even to other founders. So some player based options would be great too. e.g my ships in the faction for friendly fire purposes, but the ship ownership and access is set to the player. Kind of similar to how the shop modules work, where by you can add and remove owners.
    Really no need for combination locks or the like, I think that just over complicates things. I mean in large factions you could end up with quite a few key codes to have to memorise. Much easier I think to just have permissions on who can and cannot access things.
    You want to steal my ship and it's stored loot? Blow me up once I am away from faction protection. :p
     
    • Like
    Reactions: Asvarduil

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    Some factions may not have a single founder but an elected council.
    ((or they wanna be slaves a society serving a voting system :D))

    Imagine A wants to grant permission to B,
    B to C and C to A.
    But nobody wants to spend permission the other way around. That isn't possible jet.​

    The faction|player-data of onboard players should be accessible to the entity (for the sake of simplicity code-wise).
    JavaScript:
    "unique"
        .id = dataset // server dependent, used to access the data
        .uniqueID = timestamp + serverID *10...00 // truly unique, used to verify that the data is consistent
    
    "owned" is { unique }
    
        .owner = owner // (user OR group).id
    
    person is { unique }
    
        .keys = { key key ... } // owned keys
        .groups = { group group ... } // person.groups <=> groups.members
    
    group is { unique } // a faction has a default group for it's members
    
        .keys = { key key ... } // key.groups <=> group.keys
        .members = {  } // person.groups <=> groups.members
        .owner = DICTATOR | ELECTED | OLDEST | ...
        .ownerData { /* handled by code */ }
    
    key is { unique owned } // perhaps owned by a group!!!
    
        .groups = { group group ... } // key.groups <=> group.keys
        .entities = { entity entity ... } // key.entities <=> entity.keys
    
    entity is { unique owned } // perhaps owned by a group!!!
    
        .keys = { key key ... } // key.entities <=> entity.keys
    a Person has Keys and access his' Groups Keys
    an Entity knows all allowed Keys and the owner(person|group)

    => P .{K}) _or_ P .{G} .{K} must match any E .{K}

    only the owner can change the Keys. Use the group.isOwner(ID) function. // use function to handle DICTATOR | ELECTED | OLDEST | ...
    the ship locally assigns each key a INTEGER_INDEX to reduce meta-data and handles it's removal, addition.
    All arrays must be checked.​
    JavaScript:
    A
          .Bs { ABcons }
    
    ABcons // connections may reduce computing time for long associative lists, but increase memory usage a little bit (4..8 byte per usage)
          .A
          .B
    
    B
          .As { ABcons }