another dumb question

Gary Brown
14 May 2005, 21:00
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
15 May 2005, 02:06
When using it in a script command, use #roomname# as you need to pass the actual object name rather than the alias.

Gary Brown
15 May 2005, 02:12
Okay. Thanks.

Gary

Gary Brown
15 May 2005, 02:41
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
15 May 2005, 11:23
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
15 May 2005, 11:26
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
15 May 2005, 15:20
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