|
Dodgester Wanderer
Joined: 17 Nov 2005 Posts: 65
|
Posted: Mon Dec 15, 2008 2:21 am
Zone Enter/Exit Script Codes |
Is there way to put in scripts for when you enter into a zone then when you exit out of a zone?
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Dec 15, 2008 2:58 pm |
You may want to wait until the current mapper modifications are put into public release, or experiment with the beta version. The mapper rewrite is completely changing how this works, and it should be quite easy to do in the new version.
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Dec 16, 2008 8:26 pm |
The basic idea, unless the mapper incorporates this for you in a future version, will be to use the OnRoomEnter event to compare the zone values for the room you're entering and the one you're leaving. If they don't match, do stuff.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Dec 16, 2008 9:43 pm |
Actually, the new Beta mapper already handles this. When you enter a zone, any class folder with the keyword "ZoneXXX" where XXX is the zone number is enabled. The new "Enable Script" for the class folder is executed. When you leave the zone, the ZoneXXX class is disabled, and the "Disable Script" for the class is executed.
|
|
|
|
Dodgester Wanderer
Joined: 17 Nov 2005 Posts: 65
|
Posted: Sun Dec 28, 2008 8:01 pm |
Thank you for both the current version and the new update information.
|
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Tue Mar 31, 2009 4:33 pm |
Bringing this up because I'm coming across this situation.
Exactly how are the ZoneScripts supposed to work? I've done the Configuration Settings -> Zone -> Always active, but it doesn't seem to make any changes to anything in my package.
What I'm trying to do is limit the number of triggers I have firing all at once. Some things are zone specific, and I feel that being able to disable the triggers I'm not currently using will increase the speed. I currently have 255 zones, and having an additional 255 triggers (or more, depending on the zone itself) fire constantly is not going to improve anything.
So, if possible, can someone provide me some guidance in order to get this in order? Also, what is the easiest way to set up folders for all my zones? I don't want to have to manually type "#CLASS ZoneXXX" 255 times...
Thanks for any input!
Charneus
(by the way, I am using the Beta 3.05 CMUD) |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Mar 31, 2009 8:49 pm |
If you are asking about 3.05 beta, you should be asking in the beta forum. However, the answer is:
Simply create a folder, and put all the scripts specific to one zone in that folder. The folder can be placed anywhere and named anything. In the Package Editor, click on the folder. In the folder description, you should see a field labeled Key:. In this field, type "ZoneXXX" where XXX is the zone number. If you have multiple zones that want to use the same scripts, you can have as many ZoneXXX keys as you want. You can also have it operate for specific rooms, by adding a RoomXXX key. Now, simply set the folder to enabled or disabled, depending on whether you are already in that zone or not. From now on, that folder will automatically become enabled and disabled as you enter and leave the zone. If you want to have a script run as the folder becomes enabled or disabled, you can enter that script under the 'Enable Script' or 'Disable Script' tabs on the class.
Note that this is *completely* different from the way zone scripts are done under version 2 or earlier. |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Mar 31, 2009 11:23 pm |
I should also note that you can have use the same key in multiple classes. For instance, you could have a class for a particular city, and a class for shops, and a class for altars, and if room 1133 was all three, you could put Room1133 in the keys for all three classes, and they would all enable and disable when you entered or left that room.
This is a powerful technique! |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Wed Apr 01, 2009 1:32 am |
Heh. Only reason I put it here was because this was brought up, and Zugg mentioned beta, and I was sidetracked and didn't realize what forum it was actually in. However, I thank you for the answer you provided, as it does exactly what I want it to. Only thing I need to figure out now is how to set it up for 255 zones. *sigh* That will take a long time. *double sigh*
Charneus |
|
|
|
|
|