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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Sun Jan 27, 2008 7:11 pm   

OnRoomCreate Event problem
 
Just checking to see if this is me. Playing Achaea, using ATCP to get room name information. By using the script debugger, I can verify that Room.Brief is being correctly detected and I use another trigger to assign it to the variable roombrief. Then I'm trying to use the OnRoomCreate event to have the mapper color the room based on the room name like so:

Code:
#SWITCH (@roombrief)
  ("Grasslands") {#CALL %roomcol( , greenyellow)}


and so on and so on.

The problem is, when I create a new room with the room name Grasslands the mapper is not coloring the room. Using the #CALL at the command line works fine, so I believe that part of the script has no problems. The script debugger is telling me that the event is being raised to create the room. Also, I have the variable roombrief set as a literal string value.

Any ideas on why my mapper doesn't automatically color?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Sun Jan 27, 2008 8:52 pm   
 
Try some basic debugging procedures:
Code:
#DEBUG {%concat("onRoomCreate - roombrief = '",@roombrief,"'")}
#SWITCH (@roombrief)
  ("Grasslands") {
   #DEBUG {onRoomCreate - Grassland selected}
   #CALL %roomcol( , greenyellow)
  }
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Sun Jan 27, 2008 10:02 pm   
 
Hmm, this is what the debugger gives for that. Don't know if I used it right. I just had the debugger open and enabled and entered the above into the command line.

Code:
0.0009 | c    Achaea |  [1] Achaea Comline : start :
0.0014 |      Achaea |onRoomCreate - roombrief = 'Grasslands'
0.0003 |      Achaea |onRoomCreate - Grassland selected
0.0007 | d    Achaea |  [1] Achaea Comline : stopped
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Sun Jan 27, 2008 10:25 pm   
 
It is good to know what I posted works correctly at the command line.
Quote:
Then I'm trying to use the OnRoomCreate event to have the mapper color the room based on the room name like so:
Now how about putting it into your OnRoomCreate event to figure out what is going wrong there. Basic debugging procedure is to make sure that the problem line, '#CALL %roomcol...', is indeed getting executed. After that then we can consider either the reasons it wasn't called executed when we expected it to be, or why it didn't work when executed. So far you haven't provided which of those is actually occurring in the event.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Sun Jan 27, 2008 10:43 pm   
 
Vijilante wrote:
It is good to know what I posted works correctly at the command line.
Quote:
Then I'm trying to use the OnRoomCreate event to have the mapper color the room based on the room name like so:
Now how about putting it into your OnRoomCreate event to figure out what is going wrong there. Basic debugging procedure is to make sure that the problem line, '#CALL %roomcol...', is indeed getting executed. After that then we can consider either the reasons it wasn't called executed when we expected it to be, or why it didn't work when executed. So far you haven't provided which of those is actually occurring in the event.


Code:
0.0031 | a    Achaea #Telnet 200: Room.Brief Southern Vashnars
0.0015 | f    Achaea |  Telnet: ^Room.Brief\s+(.*)$ : (%1="Southern Vashnars")
0.0007 | c    Achaea |  exec : Telnet "2" : #VAR roombrief %1 
0.0002 | a    Achaea #Telnet 200: Room.Exits n,ne,e,se,s,sw,w,nw
0.0020 | a    Achaea |3681h, 2682m, 17305e, 11095w ex-
0.3214 | m    Achaea |  Event "onRoomCreate" raised
0.0003 | m    Achaea |  Event "onRoomEnter" raised


So, in the first two lines it finds Southern Vashnars as Room.Brief. In line 3 it assigns it to roombrief. In line 6, the mapper is creating the room and it says it raised the event, but nothing. The first line of the event code is DEBUG {%concat("onRoomCreate - roombrief = '",@roombrief,"'")} as above.
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Mon Jan 28, 2008 9:18 pm   
 
Well, I added my script into the trigger for the roomname, and it worked up until the #call to color the room (of course since the room hadn't been created on the mapper yet). So I'm thinking that even though onRoomCreate is being raised, that it isn't executing. Bug?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Mon Jan 28, 2008 10:00 pm   
 
It looks that way. Double check the spelling of your event name to be sure. It is possible this is related to the last round of scoping changes, and will have to wait for Zugg to actually do the mapper rewrite in order for it to have a proper sense of scope.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Mon Feb 04, 2008 9:19 pm   
 
Eureka! I figured out what was causing the event not to work. I had an event for onRoomEnter, and that despite the fact it didn't mess with the roombrief variable it was preventing onRoomCreate from firing. When I deleted onRoomEnter, onRoomCreate started executing.

EDIT: Tried making a new onRoomEnter event and both events executed properly. Still don't know why neither of them fired before.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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