OK, this tip is about using evaluation locks. Evaluation locks are locks that call a user-defined function to determine whether something passes or not. They are /extremely/ versitile.

OK, if you don't know the basics of @locks, and how to make a user-defined function then you'll need to learn those first.

Evaluation locks are really extremely simple. You set a user function on the same object that the @lock is going to be on. I usually name them 'LCK.*', but you can use whatever you like. Then you simply @lock object=ATTRIBUTE/VALUE where ATTRIBUTE is the attribute containing the function, and VALUE is the return value to allow to pass.
Example:

&LCK.TEST object = hastype(%#,PLAYER)
@lock/use object=LCK.TEST/1
So if the function in LCK.TEST returns a 1, then they pass the lock, but if it returns anything else, then they fail. In this case, it passes if they are a player.
Back