Enter, discuss, fix and in any way help each other with room scripts
Forum rules: NO Drama, keep it to the technical issues and you'll live longer in here
User avatar
By Argos-FoS-CA
#7404 The purpose of this script is to have a main picture (place holder) that turns on and turns off the menu. However, the problem is that the doors remain active and will send someone to an unknown destination if you don't turn off the doors

The Place Holder is the same size as the other picture with all the menu parts. However, it only has the top picture so it appears not to move.

Place Holder (to view the pictures you need to log in):
opmenu1gor.png


Full Menu (to view the pictures you need to log in):
opmenu1.png


The first script requires you to put the two pictures on the door, and the following script on it.

Code: Select allMini Menu Door
pic: opmenu1gor.png
pic: opmenu1.png

ON ENTER {
;; this script shows the menu or hides the menu based on OpenPalace or Palace Chat User
   { 1 ME SETSPOTSTATE}  OPENPALACE  IF
   { 0  ME SETSPOTSTATE} PALACECHAT IF
}

ON SELECT {
;I want to toggle between 0 & 1 if the spotstate is the other
; but I cannot figure out how to use the getspotstate to switch the two

;; Globals Declaration
activeDoor GLOBAL

ME Getspotstate tempvar =
{
   0 ME Setspotstate
   0 activeDoor  =

} tempvar 1 == if
{
    1 ME Setspotstate
    1 activeDoor =
} tempvar 0 == if

}

This has 6 additional doors, one for each of the: Video, Gorean Palaces Main Site, Forum, The Drum, Blog and the Events.

Code: Select all//-----------------------------------------------------------------
video link
ON SELECT {
   ;; Globals Declaration
    activeDoor GLOBAL
     {
        "http://goreanpalaces.com/palace04a.php" NETGOTO
     } activeDoor 1 == IF
  }

//-----------------------------------------------------------------
Main Site

ON SELECT {
   ;; Globals Declaration
    activeDoor GLOBAL
     {
         ON SELECT {"http://goreanpalaces.com" NETGOTO}
     } activeDoor 1 == IF
  }


//-----------------------------------------------------------------
Forum Link

ON SELECT {
   ;; Globals Declaration
    activeDoor GLOBAL
     {
        "http://goreanpalaces.com/forum" NETGOTO
     } activeDoor 1 == IF
  }
//-----------------------------------------------------------------
The Drum

ON SELECT {
   ;; Globals Declaration
    activeDoor GLOBAL
     {
        "http://goreanpalaces.com/ezine" NETGOTO
     } activeDoor 1 == IF
  }
//-----------------------------------------------------------------
Blog

ON SELECT {
   ;; Globals Declaration
    activeDoor GLOBAL
     {
        "http://goreanpalaces.com/blog" NETGOTO
     } activeDoor 1 == IF
  }
//-----------------------------------------------------------------
Event Calendar

ON SELECT {
   ;; Globals Declaration
    activeDoor GLOBAL
     {
        "http://calendar.goreanpalaces.com/" NETGOTO
     } activeDoor 1 == IF
  }



So the key to this code is the use of a GLOBAL to take the condition of the main menu. the activeDoor GLOBAL is declared at the start of the first scrip, and then within each of the scripts at the different doors. Declare the GLOBAL first so that the script has full use of it.

Also, learn from one of my mistakes with this script. I originally wrote the flag as:

activeDoor 0 =

Which in fact is backwards. It is telling the script to take the value "activeDoor" and put it in the 0 variable. That does not work. You have to write it like this:

0 activeDoor =

This tells the script to take the 0 and put it in the variable activeDoor - which in fact is exactly what we want to do.

Good scripting.

.
You do not have the required permissions to view the files attached to this post.