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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Jan 10, 2008 8:50 pm   

[2.18] CMUD and zMapper - A question on COM.
 
Has any one tried had any luck accessing zMapper COM objects in CMUD?

I decided to tackle the project of generating a map based on iMap and run into a problem with that.

Another problem I'm having (which may or may not be related) is determining what the RoomKind for the default room is.



To test this I created an offline session with a map with 2 rooms that are connected. (Note that the map was created in CMUD).


Then I ran the following alias that tries to interrogate some basic data.
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <alias name="test">
    <value>#show %zmap is yes

#VAR zMapper %comcreate("zMUD.zMUDMap")
#echo @zMapper
#var room @zMapper.GetRoom(1)
#echo @room - @zMapper.CurRoomID ^

#var theID @room.ID
#echo ID:@theID</value>
  </alias>
</cmud>


Here is the result
Code:
1 is yes
<COMObject>
<COMObject> - -1 ^
ID:


Now I've never really tried my hand at COM program so it could all be a major cockup. Any ideas suggestions.

On I also get an access violation but once again that could be my fairly poor understand of COM programming.
_________________
Asati di tempari!
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Jan 11, 2008 3:16 am   
 
I don't think your %comcreate is right. Also it is totally unnecessary, use the %map predefined variable. For example: #VAR room {%map.GetRoom(1)}

Also to do the conversion, something I was thinking about writing as well, you shouldn't need zMapper for anything more then setting a one way exit. The #MAKEROOM command should cover most of what you need to do. My current full mapping script actually uses a combination of #MAKEROOM and zMapper when creating rooms. zMapper is only used in room creation when an overlap is detected. This is because #MAKEROOM doesn't ofset the X, Y of the room position when creating a room on top of another; so zMapper gets used to create at a specific position.

I guess the iMap file would likely have some X, Y, Z data somewhere so it may actually make more sense to use that information. From the 1 post I saw of the information in the file there was no such data though.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri Jan 11, 2008 9:23 am   
 
The reason I wanted to use zMapper is to use it (if available) to programmatically make the different room types. I'll give it a shot.
_________________
Asati di tempari!
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Jan 11, 2008 5:50 pm   
 
I think this is a bug in the COM stuff in CMUD. CMUD seems to have trouble passing arguments like (1) to COM functions in some cases. It's on my bug list to look at for the next version.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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