ID:161607
 
How would you make verbs only accessible through buttons? Invisibility doesn't really work and setting them to hidden still would allow them to be accessed manually.
There may be a way, but what do you need this for? If you don't want verbs to be available at certain times, you better remove them from the verbs list or otherwise disable them or make them inaccessible.
Also, I may be wrong, but if you don't give your players the command names to type, how are they gonna know what to type (if the command is hidden)?
I didn't think about that. Mine are just set hidden. I guess what you could do is declare it as proc instead of verb, set hidden, then add to client verbs whenever the interface command is enabled. Remove whenever you disable the command on the interface, or change focus to another window, or make the window invisible, etc.

That might help with lag too, like when someone clicks the "kick" button a second time before the net can tell the client to disable it during a cool-down period.
In response to Kaioken
Kaioken wrote:
There may be a way, but what do you need this for? If you don't want verbs to be available at certain times, you better remove them from the verbs list or otherwise disable them or make them inaccessible.
Also, I may be wrong, but if you don't give your players the command names to type, how are they gonna know what to type (if the command is hidden)?


Certain verbs aren't really tangible player actions or commands as much as they are abstract GUI stuff. I guess I'm just not using verbs in a traditional sense.

There should be a way however to make it so some verbs can only be valid if called from an interface element. This is the future of BYOND.
In response to Obs
The future of BYOND is preventing players from typing in a command that they wouldn't know and is more inconvenient than just pressing the button anyway and doesn't show up anywhere so really it doesn't matter?
In response to Garthor
Garthor wrote:
The future of BYOND is preventing players from typing in a command that they wouldn't know and is more inconvenient than just pressing the button anyway and doesn't show up anywhere so really it doesn't matter?

If you open up an rsc file in notepad and look through all the GUI elements you can see the verbs they use. Try to be more malicious.
In response to Obs
Yeah, but still would you know if they selected the control by pressing the mouse button with their index finger and not some other finger, toe, nose, or nearby kitten? So even if a future BYOND version restricts the verb to that control, kittens will suffer!

But seriously... can you give an example of a problem caused by a client commanding a verb some other way than a button when the button and verb are enabled for that client?
In response to Traztx
Traztx wrote:
Yeah, but still would you know if they selected the control by pressing the mouse button with their index finger and not some other finger, toe, nose, or nearby kitten? So even if a future BYOND version restricts the verb to that control, kittens will suffer!

But seriously... can you give an example of a problem caused by a client commanding a verb some other way than a button when the button and verb are enabled for that client?

The button is not enabled.

It seems though the control_freak variable set to 1 would eliminate my problem, since it would probably prevent people from having any way to type any command unless I create a control for that (which i won't)
In response to Obs
Sounds good, but I think you'll still have potential trouble with verbs being accessed unless the server tracks when the button is disabled.

For example:
  • I click the "kick" button.
  • The server tells the client to disable the button.
  • I can't click it now.
  • 10 seconds later: the server tells the client to enable it again.
  • I can click it now.


But insert net lag.
  • I click the "kick" button.
  • The client sends the message to the server but there's net lag.
  • I click the "kick" button again.
  • The client sends the message to the server but there's net lag.
  • The server finally gets the 1st message, performs a kick, and tells the client to disable the button.
  • I click the "kick" button again.
  • The client sends the message to the server but there's net lag.
  • The server finally gets the 2nd message, performs an illegal kick, and tells the client to disable the button.
  • The client finally gets the 1st disable command.
  • I can't click it now.
  • The server finally gets the 3nd message, performs an illegal kick, and tells the client to disable the button.
  • Eventually the client gets the 2 other diable commands which do nothing.
  • 10 seconds later, 3 enable messages arrive at the client.


What a mess!

If only the verb had removed itself from client verbs, or checked a var that remembered the enabled state, then the illegal extra kicking would have been ignored by the server.
In response to Traztx
What is the easiest way to track this.
In response to Obs
You validate the conditions for the verbs on the beginning of them, and return if they're not satisfied. This should actually be done frequently on verbs generally if the conditions/verb are important.
In response to Kaioken
Kaioken wrote:
You validate the conditions for the verbs on the beginning of them, and return if they're not satisfied. This should actually be done frequently on verbs generally if the conditions/verb are important.


There isn't some enabled/disabled setting for a verb that can be modified? Invisibility can't be changed on the fly?
In response to Obs
I don't think so. Why not just remove it from the verbs list?