An idea for locking gates...

lazyink

Valued Member!
Staff member
Just a thought I had about adding locks to gates, but I don't have the knowledge to try implement it.

Basically, we create a selfaction to add a lock to gates. We can restrict this by item ID if nessesary.

I was thinking it would work like so:

Set a new column in the instance_building named 'lockCode'

Use the following 'code':

if (gate) then {
if (!haslock) then {
scrollwheel > Lock Gate?;
_gateID = get gate UID;
_code = get player GUID;
_gateID setVariable {"lockCode", _code};
Flash Message> Gate Locked!;
}
else {
scrollwheel > Unlock?
_gateID = get gate UID;
_key = _gateID getVariable "lockCode";
if { _key = (get playerGUID)} then {Sucess!!} else {Fail!};
}

Would it work? Am I chasing dragons here?
 
I think another person is working on this as well. This would be great to add to a custom built base with one entrance for players to occupy.
 
And I'm in contact with the other person also, but I made this post to see if any of the more code minded folks could figure out the idea I had above. All the work I've seen so far involves adding a keypad for access. I want to make the whole process automatic. I'm just not at all sure if the ideas above are actually feasible!

We have custom bases for donaters, but I want to give all players the option to lock one type of gate, as some of the player bases have been abandoned, and should they be discovered by other players, having the ability to lock the gate using the GUID would be a real bonus.

edit.

Just another thought, if we could also add a 'last access' column in the instance_building row, which would only be updated when the lock is opened/closed. We then could write a 'Break Lock' option which could be set, for example:

3 days no access = 20% chance to break
5 days no access = 50% chance to break
10 days no access = 90% chance to break

and if the Break is successful, we just clear the previous player GUID from the DB and reset the lock option.

Again, I'm just spit-balling here, so if you see problems, please shoot them down!

edit 2.

We would also have to insert a function to limit players Break Lock option to once per hour...
 
Excelsior, yes Lazyink and I have been working on this together, a select few like yourself have received it from me to gather some ideas on how to make it more effective and get some ideas. If you want to share them in open forum or private chat either is fine. :)
 
Back
Top