Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Phazic
Novice


Joined: 12 Oct 2000
Posts: 32
Location: USA

PostPosted: Fri Dec 27, 2002 3:08 am   

Mapping via Scripting pt2
 
After reading through the zMapper helpfiles and poking at the COM object scripting, I noticed one thing that seems more of a nuisance. Zmud's automapper functions all seem to rely on the number being specified being the Vnum of the room, whereas Zmapper relies on all numbers being the ObjID of the room or the absolute vnum. Is there a nice function that returns the absolute room vnum given a normal vnum? The only thing I've really come up with is to store 2 lists of data, aligned in paralellel, one with vnums and the other with absolute vnums. I'd try generating such a list from %numrooms, however that isn't accurate because once rooms are deleted %numrooms changes, however the objid that was used for those rooms is 'lost' so %numrooms no longer correlates to the highest objid. So I'd ultimately end up storing vnum data/absolute vnum data when I called the #makeroom in my current code.

Thanks to Vijilante for the swift reply, although when trying out the example code for relocating the Z dir, I found that I needed to reference a variable to %curroom first before being able to change anything. For example: if the room was located at xyz (240,240,0) #VAR %curroom.x 480 would set 240 to 480, needed to do #VAR croom %curroom, then #VAR croom.x 480 to get things to work.



-Phazic
zMapper 1.15/zMUD 6.40 on WinXP
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Dec 27, 2002 10:32 am   
 
Try looking at %mapvnum. Also, mapper functions can accept either an ID or a vnum. Use %roommode to select which one you want to use:
#NOOP %roommode(0)
;Use vnums in mapper functions
#NOOP %roommode(1)
;Use ID's in mapper functions

Kjata
Reply with quote
Phazic
Novice


Joined: 12 Oct 2000
Posts: 32
Location: USA

PostPosted: Fri Dec 27, 2002 8:11 pm   
 
I looked into %mapvnum except that mapvnum seems to only convert absolute to virtual and not the other way around, ie %mapvnum(2) can return 12001 but %mapvnum(12001) can't return 2. Although, imho, one function shouldn't be able to return both without some extra flag specifying which one you want to return. My overall problem is that I know the vnum of the room (from the area file) but I don't know the absolute vnum of the room according to Zmud and Zmapper only uses ObjId (Absolute vnum) for all its calculations, unless there's something like %roommode that works for Zmapper scripting?

-Phazic
zMapper 1.15/zMUD 6.40 on WinXP
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Dec 27, 2002 10:47 pm   
 
Use %roomkey to get the ID the database uses.

I know it doesn't appear in the Function Reference section of the help file. I had to look for it in the Function Wizard under the help menu. I think I'll go over this in the next few days and submit an updated help file to Zugg. He really doesn't have much time to do this.

Kjata
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net