Delete <object>

So I want to be able to delete an object in the game as a command. Ideally from any room and not just the room I'm in, though I understand if it won't work like that. So for example I could write Delete Soldier21 and that soldier would just disappear from the game even if I'm in a whole different room. Is that possible? If so, how?


If you want the player to enter the name of the object, msake a command with the pattern delete #text# and the script destroy (text).

If you want the player to enter the alias like they do for other commands, the pattern would be delete #object#, the scope is world, and the script would be destroy (object.name).


It's either Destroy #object# and Destroy (object), or Destroy #text# and Destroy (object).


No, Destroy #text# would overlap existing code.
It's Destroy #object# and Destroy (object).

Pretty sure you're wrong there.

delete #text# as a command pattern allows the player to enter arbitrary text. estroy (text) will destroy the named object, or give an error if it doesn't exist. This works because the parameter to destroy is a string containing an object name.

If you're using destroy #object# the object parameter will be matched against alias, using the parser's normal disambiguation process; which is why you need to use object.name when calling destroy. In this case, you set the scope to world so that it considers all objects regardless of location.


Oh, so that's what that does. Nevermind. That is a bit strange, isn't it?


Log in to post a reply.

Support

Forums