|
Phazic Novice
Joined: 12 Oct 2000 Posts: 32 Location: USA
|
Posted: Sun Dec 29, 2002 6:38 pm
Room existence querying? |
Is there a function or property that specifies whether or not a room actually exists or not? Ie %map.getroom(-200) where -200 doesn't really exist creates a 'dummy' type room that has an id of -200 and no real discernible means of identifying whether or not it's an actual room without running a direct query on the map db file via ADO.
-Phazic
zMapper 1.15/zMUD 6.40 on WinXP |
|
|
|
The Raven Magician
Joined: 13 Oct 2000 Posts: 463
|
Posted: Mon Jan 06, 2003 1:47 am |
I know it is not aligned with the syntax of most of Zugg's scripting, but this behavior is one of my least favorite aspects of zMud scripting... query functions that double as create/insert functions. EVIL! Especially when you name the function 'get', implying that it is used to GET stuff, not SET.
Grrr, evil... grrr.... growl... |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Mon Jan 06, 2003 12:21 pm |
Use %mapvnum. Granted, it is not a zMapper function, but it does return -1 when the specified room doesn't exist.
Kjata |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Jan 07, 2003 1:07 am |
I'll be modifying the %isnull routine so that it can detect null "COM" objects such as this. Then you can do something like:
#VAR room %map.getroom(-200)
#IF {%isnull(@room)) {whatever}
to detect if a null room is returned. This has nothing to do with the GET/SET issue. It has to do with how COM works on Windows and the fact that GetRoom is returning a COM OBJECT and not just some simple value.
|
|
|
|
|
|