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
rderosier
Beginner


Joined: 25 Sep 2009
Posts: 14

PostPosted: Mon Apr 25, 2011 9:18 pm   

Creating a link?
 
I need a little help here, I have a zone on my mud that every hour or so the entrance moves to a different location, I figured I would just put a trigger in the rooms it can attach to that would fire when the new exit is there, but I cant figure out how to made a trigger create a link to the zone... can someone give me a hand please? Thanks in advance Very Happy
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Mon Apr 25, 2011 10:58 pm   
 
You're looking for the %roomlink function, keep in mind your map must be unlocked for it to work.
Reply with quote
rderosier
Beginner


Joined: 25 Sep 2009
Posts: 14

PostPosted: Wed Apr 27, 2011 1:39 am   
 
Ok, but how exactly do you use that?
something like.. #trigger {Exits: East} {%roomlink(roomnum,E)}?
Thanks
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Wed Apr 27, 2011 2:30 am   
 
Your trigger should work, except you also need to specify the vnum the link will connect to in the roomlink function, like this:
Code:
#CALL %roomlink(fromroom,direction,toroom)

Check out the documentation, it's there for a reason!
Reply with quote
rderosier
Beginner


Joined: 25 Sep 2009
Posts: 14

PostPosted: Wed Apr 27, 2011 4:48 am   Thanks!
 
Thanks for the response, I had read the documentation but I just wasn't understanding it now it makes sense.
But, I cant make the trigger fire as a room script. Work's just fine if I put it in the command prompt, but if I put it as a room script it doesn't fire, is that normal?
In the room script I have:
#TRIGGER {Exits: East} {#CALL %maplocked(0);#CALL %roomlink(8199,E,8900)}
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Apr 27, 2011 5:04 am   
 
What's your procedure for adding room scripts? There's a right way and a wrong way, yet because the settings types and scripting concepts are so varied CMud is basically encouraging you to use the wrong way when it opens the Package Editor window for you. If you are typing in your script in the Enable Script tab of the Room### class folder, you are doing it the wrong way.
_________________
EDIT: I didn't like my old signature
Reply with quote
rderosier
Beginner


Joined: 25 Sep 2009
Posts: 14

PostPosted: Wed Apr 27, 2011 4:17 pm   
 
I click on the room on the map, click on properties, and put the script in the "Room Script" tab. Is there a different way I should be adding room scripts? It seems to work just fine until I tried to do this.
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Apr 27, 2011 5:07 pm   
 
Using the Enable Script tab of the Room### class folder *is* the correct way for most scripts. The exception is scripts that create *other* scripts, like your #trigger command. For those you need to create the trigger itself within the Room### folder. So still use the Properties/Room Script button. That will open the Package Editor and will select the proper Room### folder. But now use the GUI to select New/Trigger to create a trigger within this room folder. Then enter your "Exits: East" pattern and "#CALL %maplocked..." data into the trigger pattern and script fields and save it.

When you enter that room on the map, the Room### folder will be enabled, which will enable the triggers stored within it.

Room scripts themselves should not directly create other scripts, so don't use #trigger, #alias, #button, etc within a Room Script. That's the big change from previous versions of CMUD (and zMUD). Instead of creating and destroying triggers when you enter a room (which was slow), CMUD v3 simply enables and disables the class folder associated with the room.
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