|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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! |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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 |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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! |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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.
|
|
|
|
|
|