|
Michael Nelson Novice
Joined: 03 Oct 2005 Posts: 36
|
Posted: Thu Oct 05, 2006 4:05 am
Mapper Room Script |
My goal with this script was to have the mapper get my mining permit from my bag if I am in this room and it is not out and when I enter the next room put it away if it isn't away. Here is the script.
#CLASS {RoomKeys|MiningPermitClass}
#ALIAS awayperm {
#IF (@MiningPermit == 1) {
put 'mining permit' bag
MiningPermit = 0
}
}
#ALIAS getperm {
#IF (@MiningPermit == 0) {
get 'mining permit' bag
MiningPermit = 1
}
}
#VAR MiningPermit {0}
#CLASS 0
}
I place the getperm alias in the room script I want it to be out, and the awayperm in the roomscript of the rooms around it.
Well for some reason my MiningPermit Variable gets set to 0 every time I leave room, so it never gets put away. I tried replacing the variable set with an echo to see if it is getting called but it is not. I don't know why the variable keeps resetting itself. just to sum up the MiningPermit is set to 1 by the getpermit command I checked it it works but somewhere inbetween me typing north and me hitting the roomscript awayperm it is getting reset to 0. No idea why. I checked the debugger and tried stepping through with a watch and something is going on when I move but it is just a brief flash even with step. Also, if anyone knows the answer to my passdoor question I just posted the reply just begs more information, I want to be able to have doors in my map but not open the ones that are can be passed with the passdoor spell if I have it engaged.
Thanks in advance |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Oct 05, 2006 10:58 pm |
Is this script written within one of the Room Script sections or is it kept separately in your Settings files? If so, the reason you are having problems is because when you leave the mining room the script is deleted (@MiningPermit no longer exists) and then the room you are entering creates its script (@MiningPermit is set to 0).
To have the script persist across rooms, you'll have to either build a separate, permanent script in the Settings Editor or transfer the two aliases and stuff to the Zone level. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|