another dumb question

Gary Brown
Okay. I thought this would be easy, but I was wrong. lol (not unusual).
I wrote a teleport command for admin to use. Worked great untill I tried to reference the room by alias instead of the actual name. The command is:

teleport #@roomname#

then I picked the move a player to another room from qdk and used #@roomname# as the room. I also tried to use the #getobjectname(#@roomname#)$ but that's not working either.

Can somebody tell me what obvious thing I've done wrong here that I'm just not quick enough to catch.

Gary

Alex
When using it in a script command, use #roomname# as you need to pass the actual object name rather than the alias.

Gary Brown
Okay. Thanks.

Gary

Gary Brown
er... another thought.
If I wanted to make a wear command then, and I have 2 objects named jacket1 and jacket2 and one has an alias of coat and the other jacket. If they're different types, (say one is of type mundane, and the other magic) and my wear command is this:

wear #object#

I'm not going to be able to reference the jackets by their alias, or be able to check they're types. Or am I missing something?

Gary

Alex
In your command setup, use #@object#. But when reading properties, don't use the @.

Basically use the @ wherever you want players to use or see the "friendly" version of the name, and don't use it wherever you want Quest to reference the internal code name for your object.

So your wear command ASL might look like:

command <wear #@object#> if property <#object#; wearable> then msg <You put on the #@object#> else msg <You can't wear that!>

Alex
Also a quick note: It's best practice to always use the "@" form in commands referring to objects, even if you're not using aliases. That's because Quest does some things automatically for you if it knows to expect an object variable there.

For example, if the player types in the name of an object that doesn't exist, Quest will automatically tell the player that the object doesn't exist. This avoids you having to code the error message yourself. Players will then be able to use the "oops" command to correct themselves.

Gary Brown
Ah. Okay. Thak you very much. That'll make life a bit easier for me. :P I have to say, Alex, I'm really impressed by the amount of support you give to this software.

Gary

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums