A couple of questions about rooms and GUIs. (What are room properties?)

Started by Lionmonkey, Tue 17/07/2007 00:09:21

Previous topic - Next topic

Lionmonkey

1) Is the button "room properties" in room settings for setting scripts for a room? If yes, then what scripts can be applied and what is required to write in each field?
???
2)how to stop an animated background from looping? I've got an inproduction animation for the main menu, but after showing the last frame the animation starts again. How do I make it stop after one loop?
???
3)How do I hide a GUI invisible for concrete room? I mean, I've made it to be visible always (the "normal" option), but how do I hide it for the start menu?
???
4)How do I make the cursor unable to change by right clicking but just in one room? (the start menu) How to make it have a one special cursor?
  ???
If anyone else has got a question about GUIs or Rooms please post them there, so the good wise helpful guys(TM) wouldn't have to look all over the forum for them.
,

Khris

1) No. It opens the Custom properties window for the room.
To see/add/change room events, click the button with the red i in Room editor -> settings.

2) In the room's interaction "repeatedly execute", put this script:
Code: ags
  if (GetBackgroundFrame()==4) SetBackgroundFrame(4);


3/4) From the menu, select Script -> on_event, then put this inside the function:
Code: ags
  if (event==eEventEnterRoomBeforeFadein) {
    if (player.Room==1) {
      mouse.Mode=eModePointer;
      gGuiname.Visible=false;
    }
    else {
      gGuiname.Visible=true;
      mouse.Mode=eModeWalkto;
  }
(Replace Guiname with the name of your GUI.)

Then look for "function on_mouse_click" (or press Ctrl-W, then select it from the menu).
Look for this part inside the function:
Code: ags
  else {   // right-click, so cycle cursor
    mouse.SelectNextMode();
  }

Now change it to:
Code: ags
  else {   // right-click, so cycle cursor
    if (player.Room!=1) mouse.SelectNextMode();
  }

TheJBurger

I've been wondering about Custom properties for a long time. I've read all there is to read about it in the manual, but I'm afraid I still don't understand what they're there for, or how to use them.

I would appreciate it if someone could explain them to me, and what exactly they're used for, or how you would apply them in a real game.

Khris

They are simply very convenient and can speed up and simplify the designing process greatly.

How to create them using the schema editor is explained in the manual.
There's even an example of what to use them for.

Other examples:
-Walk-to coordinates for objects and characters
-default responses for a multi-verb GUI
-weight of inventory items

Think of any attribute you want to attach to a variety of hotspots or objects, characters or inventory items, even rooms.

In Maniac Mansion Deluxe, two custom properties were used to set the inside and outside lighting for every room (a few rooms were dark and had to be explored using a flashlight).

The only downside is their read-onlyness in-game.

TheJBurger

So my impression after reading your post and re-reading the manual entry is that custom properties are basically structs for hotspots/objects/characters.

Is this correct?

Khris

More or less; they are arrays of bool/int/String constants, to be exact.

Lionmonkey

Quote from: KhrisMUC on Tue 17/07/2007 00:30:33
1) No. It opens the Custom properties window for the room.
To see/add/change room events, click the button with the red i in Room editor -> settings.

2) In the room's interaction "repeatedly execute", put this script:
Code: ags
  if (GetBackgroundFrame()==4) SetBackgroundFrame(4);


3/4) From the menu, select Script -> on_event, then put this inside the function:
Code: ags
  if (event==eEventEnterRoomBeforeFadein) {
    if (player.Room==1) {
      mouse.Mode=eModePointer;
      gGuiname.Visible=false;
    }
    else {
      gGuiname.Visible=true;
      mouse.Mode=eModeWalkto;
  }
(Replace Guiname with the name of your GUI.)

Then look for "function on_mouse_click" (or press Ctrl-W, then select it from the menu).
Look for this part inside the function:
Code: ags
  else {   // right-click, so cycle cursor
    mouse.SelectNextMode();
  }

Now change it to:
Code: ags
  else {   // right-click, so cycle cursor
    if (player.Room!=1) mouse.SelectNextMode();
  }


Thank you very much, this helped alot!

,

SMF spam blocked by CleanTalk