SYNOPSIS

int command( string str)
int command( string str, object ob)

DESCRIPTION

Execute str as a command given directly by the user. Any effects of the command will apply to the current object, or to ob.

Return value is 0 for failure. Otherwise a numeric value is returned which tells the evaluation cost. Bigger number means higher cost. The evaluation cost is approximately the number of LPC machine code instructions executed.

If command(E) is called on another object, it is not possible to call static functions in this way, to give some protection against illegal forces.

Commands are stacked, meaning that after the given command str has finished, the old settings of this_player(E), query_verb(E) etc, are restored.

HISTORY

  • changed (3.2.6) – in native mode, commands are no longer limited to the current object only.
  • changed (3.2.7) – commands are stacked.