Custom Gui not showing up in room?

Started by piraatlife4me, Thu 22/01/2004 19:08:33

Previous topic - Next topic

piraatlife4me

Hey AGSers!
I am having a little problem with a certain GUI not becoming visable in a certain room. When I call the GUIOn function in another room it works fine. The error I am having occurs in this room and everything else works except the GUI showing on the screen:

//In my global script

if (GetGlobalInt(31)==1) {
GUIOn(12);
character[BUSY].room = 70;
character[BUSY].x = 488;
character[BUSY].y = 229;
character[MILL].room = 69;
character[MILL].x = 488;
character[MILL].y = 229;
character[PIAN].room = 60;
character[PIAN].x = 488;
character[PIAN].y = 229;
ObjectOn(1);
Wait(250);
SetButtonPic(12,0,1,1065);
Wait(180);
ReleaseCharacterView(DINE);
GUIOff(12);
ccExecuteCommand(DINE, 35);

The GUI dosen't become visable, is there anything here that would permit the GUIOn function from being run?
I set the X and Y location in the GUI properties box so the problem must be in this scipt.
Thanks
Daniel
Winebarger

Darth Mandarb

My first question (probably a dumb one) is:
Are you sure that GlobalInt(31) actually = 1?

Another idea: Rather than putting that code in the global script, how about putting it in the (after fadein) section for that specific room?

])]V[

strazer

#2
QuoteI set the X and Y location in the GUI properties box so the problem must be in this scipt.

Have you tested if the GUI does show at all? Remember, GUI x/y positions are relative values, so for a 640x480 game, the maximum is x=320 and y=240.

Ishmael

#3
You have most likely:



The "When Interface disabled" option in general settings set to "Turn Off". In this case:

Set the GUI temporarely to "Unchanged by:"

SetGameOption(OPT_WHENGUIDISABLED, 2);

and then back:

SetGameOption(OPT_WHENGUIDISABLED, 3);



If this don't help, or the option is not set to "Turn off",
place a Wait(1); just after the GUIOn().
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

piraatlife4me

Hey! Thanks for responding! Yeah the reason I have to put it in the global script is because I need this event to occur after the player uses a inventory item on another character. If I pu it in the room script I would have to put it under a repeatedly execute function...I think?I guess I could try that. I tested the gui in another room and it worked fine, the room is 500 by 240 and my games resolution is 320 by 240.
Do you think there is someway the gui gets pushed far to the left off the screen. Because the actions are taking place on the right side of the screen of the scrolling room so maybe when I call the command the gui gets pushed? Any idea on that?

Ishmael

From the manual, from the SetGUIPosition function:

QuoteMoves the top-left corner of GUI to the new location (X,Y) on the screen. This allows you to dynamically move GUIs around on the screen while the game is running. The co-ordinates are screen co-ordinates, not room co-ordinates, and use the same scale as in the editor.

Try putting a SetGUIPosition command just after the if line, so that it is on the screen for sure... and put the Wait(1); in there, after GUIOn, just in case.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk