Results 1 to 6 of 6

Thread: Request - Auto Door closing?

  1. #1
    Colony Founder Lonestarcanuck's Avatar
    Join Date
    May 2014
    Location
    Texas
    Posts
    1,649
    Rep Power
    1

    Question Request - Auto Door closing?

    in Rust we had a mod that allows admins to setup:

    - Automatic closing of all doors after XX seconds (3, 5, 15, 30, etc.)
    - close all doors at fixed time like start of night.

    is it possible to do this with 7DTD?

    the scenario I would like:
    -- Close Player doors after XX seconds
    -- Close Trader doors after XX seconds
    -- close all doors at 2158 - right before night or what every time I specify

  2. #2
    Guppycurian Forum Whore Guppycur's Avatar
    Join Date
    Apr 2014
    Location
    Enemy for life
    Posts
    19,182
    Rep Power
    1
    Yes, using SDX to add the new asset (the door with an animation, or the code that closes it).

    - - - Updated - - -

    Yes, using SDX to add the new asset (the door with an animation, or the code that closes it).

    ooh, ooh... you could also have doors degrade onto themselves every 30 seconds, which would replace the open door with a closed door, but 1) Performance suckage, and 2) No control when that timer hits, so if a player opens the door and goes through at second 29, it'll change on them.

  3. #3
    Colony Founder Lonestarcanuck's Avatar
    Join Date
    May 2014
    Location
    Texas
    Posts
    1,649
    Rep Power
    1
    [QUOTE=Guppycur;795362]Yes, using SDX to add the new asset (the door with an animation, or the code that closes it).

    - - - Updated - - -

    Yes, using SDX to add the new asset (the door with an animation, or the code that closes it).

    ooh, ooh... you could also have doors degrade onto themselves every 30 seconds, which would replace the open door with a closed door, but 1) Performance suckage, and 2) No control when that timer hits, so if a player opens the door and goes through at second 29, it'll change on them. [/QUOTE

    LOL that would be funny - I like code idea. I assume every door is enumerated and has properties that can be set. there was little to no performance hit on RUST but that is a diff engine.

  4. #4
    Colony Founder StompyNZ's Avatar
    Join Date
    Apr 2015
    Posts
    3,858
    Rep Power
    1
    Door open/close state is a meta setting.

    In my mod block and blockrpc can set the meta directly, so you can use that and just have your server manager of choice call the command at the set times etc.

    blockrpc scan x y z would tell you the current state of the door at x y z

    blockrpc meta1 x y z /meta=0
    blockrpc meta1 x y z /meta=2

    those would toggle the open close state

    tile unlock x y z
    tile lock x y z

    These would lock and unlock the door

  5. #5
    Guppycurian Forum Whore Guppycur's Avatar
    Join Date
    Apr 2014
    Location
    Enemy for life
    Posts
    19,182
    Rep Power
    1
    Oooh. That would be a nice feature.

    ...how do you update a table whenever a door is placed, so that BCM can read the table and keep 30 second timers on each door?

    Or is that cost prohibitive?

    Maybe just make it so that the timer starts only in active chunks?

  6. #6
    Colony Founder StompyNZ's Avatar
    Join Date
    Apr 2015
    Posts
    3,858
    Rep Power
    1
    You can set a delegate on the OnBlockChanged and scan for doors in the newblockvalue (it's how MBM works) and have it record the door into a list for the world.

    Or, just use tile to scan for doors near a player at the time you want to do the changes if you dont know where the doors are

    tile scan 90 90 /r=13 /type=SecureDoor /forceSync
    That will scan the chunks around cx 90 cz 90 in a radius of 13 chunks

    Result on the medi prefab server:

    Setting radius to +13
    Processing Command synchronously...
    Loading 729 chunks took 0 seconds
    Chunks 77 77 to 103 103
    {"Count":104,"Tiles":{"SecureDoor":[{"Owner":"76561198067088370","Users":[],"HasPassword":false,"IsLocked":true,"Type":"Secur eDoor","Pos":{"x":1243,"y":26,"z":1450}},{"Owner": "76561198067088370","Users":[],"HasPassword":false,"IsLocked":true,"Type":"Secur eDoor","Pos":{"x":1236,"y":52,"z":1447}},

    etc

    (13 chunks is max view distance for players)

    tile command will load chunks as needed too

    the async version (leave /forcesync off) will log the results if using browser, or send the notice to telnet session if using telnet

Posting Permissions

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