LucasArts GUI Help Thread (NEW Scumm GUI Available!)

Started by TerranRich, Fri 01/08/2003 06:04:47

Previous topic - Next topic

Petar

I tried with hotspot properties (that was my first idea to define THE hotspots with exits), and it all works fine and dandy, but as I said, its not a problem in changing the cursor, the problem is with reverting it back.

My logic tells me it should work like this (this is not an actual script=)

if mouse_over HOTSPOT X
than
Change cursor graphic (y)
else
SetDefaultCursor,

but unfortunately it doesn't work. I am obviously missing something here as it should be a pretty straightforward thing. Well, I'll try some different approach, or I'll ask Igor Sinkovec as he did what I need in that small demo of his P.D. *the scene with a housekeeper*.

BTW, Proskrito, thanks for the DOTT template, I managed to learn alot about switching characters with different GUI's etc. That works, I only have to figure out the inventory issues.

Petar

Ok, this has now really turned into a mistery to me.

I browsed around and found Gac's tutorial on changing the cursor graphics over an object, and it still doesn't work.
I tried

GetLocationType
GetLocationName
Properties
SetMOuseCursor
ChangeCursorGraphic
SetCursorMode
excerpts from DOTT gui
uhm....

StrComp
and none of them works. Each one of them changes the graphic but it WON'T CHANGE BACK, damnit.

Please, this is not an imperative, but I would REALLY like to know how this thing works.

Thanks.

LeChuckie I am from Zagreb. How did you hook up with AGS. I just found it about a month ago, and I am really enjoying it *except* this small problem.

SSH

Petar: maybe if you post the code you have in your global repeatedly_execute, then we can help...
12

Petar

Ok, here goes....

Hotspot 4 is used on the border of the screen to change the cursor graphic into an arrow (like in MI3)

In Hotspot 4 interactions under (Mouse MOves over hotspot) I runned a script:

SetMouseCursor (4);  --- that doesnt work because it doesn't change the cursor back to the default.

if we go the complicated way this would be the script:

GetLocationName(mouse.x,mouse.y,hotspot 4); //I don't understand the variable name here
if (StrComp(hotspot,"hotspot 4")==0) SetDefaultCursor();
else  
SetMouseCursor(4);  

It always works, it changes the cursor but the when I move the mouse away from the hotspot 4 it stays the same, i.e. it doesn't change back to default cursor.

Do I have to initialize the default cursor at the beggining? hmmm....lemme try it now....nope, doesn't work.

there you have it. if you know how to solve the problem your help would be much appreciated.





SSH

You said that you read the GAC Tutorial on this. I think you missed the line that said:

Quote
Just put the following code in the GLOBAL SCRIPT'S REPEATEDLY EXECUTE function:
12

der Warst

Well, err...

I posted this in the beginners forum since I'm an absolute beginner though I think my question is rather advanced....

I'm studying Art and want to do an AGS game as a project, I want to use a Lucasarts GUI based on the FOA template and wanted to use about two or three Player characters, but since they should be absolutely different i would like to use individual GUIs for each character. Not actually completely different, but some of the Buttons should have different meanings.

e.g. I have one character that should have a "believe in" Button, or another one should have a "lie to" instead of "talk to" and so on .

So, is it possible to customize some parts of the GUI depending on which character is currently played?

Please answer for idiots, I'm just learning to use the script language.

Thanks,

Simon

Scummbuddy

Get the DOTT style gui at the same download site
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

der Warst

Quote from: Scummbuddy on Fri 12/12/2003 01:36:59
Get the DOTT style gui at the same download site

aha...?

and how's that supposed to help me? ???
I allready tried the DOTT style Gui and it looks pretty much the same as the FOA one except for the different look. But what I need is some advice on using different GUIs for different characters (if this is possible).

Thanks anyway,

Simon

Scummbuddy

yes, this one is set up for 3 different guis and inventories for three different main characters.

read the helpfile that comes with it, i think that will answer your questions.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

King Teddy Wogan

Where abouts are all these guis? I've tried all the links around the posts, but it seems the sites have gone down!

Proskrito

#50
Warst: you could do a custom SwitchPlayerCharacter function that, apart from changing the player character, also changed some gui buttons pics to the ones you want, and, in the interface_click function, in those buttons, check who is the player character to see what action is done, ie:
if (button==4){
if (GetPlayerCharacter()==PLAYER1) SetMode("talk to");
else if (GetPlayerCharacter()==PLAYER2)SetMode("lie to");
}
Or you could just do different guis for each character.

Elvis: check this thread: http://www.agsforums.com/yabb/index.php?board=2;action=display;threadid=6642
EDIT: oh, the server seems to give a forbidden access error...

Finer

Quote from: Petar on Sun 07/12/2003 14:52:19
My logic tells me it should work like this (this is not an actual script=)

if mouse_over HOTSPOT X
than
Change cursor graphic (y)
else
SetDefaultCursor,

Try this idea:

Load the room in question. Then, select room interactions button (looks like a dark red lowecase i). Double click 'Repeatedly execute' from the new list. Select 'Run Script' from the drop down options. Then, click on 'Edit Script':

Type the following:
// if mouse over hotspot 2 (your exit), then set cursor graphic to 4 (your arrow).
if (GetHotspotAt(mouse.x,mouse.y)==2) SetMouseCursor(4);
else SetDefaultCursor();

I don't know if you knew about the room repeatedly execute 'loops'. I hope this works.

Petar

Finer, thanks alot . I didn't really think about the room repeatedly execute loop, I thought the script could hold on the Hotspot interactions *since there is an actual mouse over property*. I will try that tommorow since I don't have the project here on this computer.

Again, thanks alot I'll check it out tommorow and report back.

Petar

Finer, it worked like a charm. Thanks alot.

All I have to figure out now is how to interact that hotspot with a double click to call NewRoom function.

Thanks once again.

iamamightypirate

 hi

i downloaded the FOA template from the web and am playing about with it.

i am having a strange problem where i am using some of the hotspots (like the fountain for instance -- if you have the same template you will know what i mean)

and I setup the look and use functions to display different messages

I tested the game but i cannot seem to use "look at" or "use" unless i click on my character when they are standing in front of the object -- if i click somewhere else thats in the hotspot but not on my character it does not work

any clues? thanks in advance

-Steve
   Report to moderator  

Kinoko

#55
I think I'm having that same problem but it's with the MI2 template. I'm actually well into my game at this stage but I haven't changed anything in the global script, and have only changed individual rooms that came with the template.

Whenever I left click on "look" and then click on a hotspot/object/whatever, the character will walk over to the object/whatever, but won't display the text assigned for that hotspot. It works with no problems at all if I right click, when "look" is already highlighted for that object.

The left click has worked -occasionally- and it seems to be when I've already tried it once (or many times!) before and the character is already as close to the thing as possible, or is standing in front of it and I click on the object through the character.

EDIT: After playing with it some more, I've realised that when using the plain left mouse click (clicking on "look" and then on the object) the game will go to the walk-to point assigned to that hotspot/object, but won't display the "look" text.

If I use the right click (with "look" highlighted) it is reacting as if "walk to" was clicked. This means that most of the time, the character walks behind the object in question in response to the position on the object I clicked. It will THEN respond with the proper "look" displayed text. I have walk-to points assigned to all these objects/hotspots and yet they are being ignored.

If I use the left mouse click, I can get the game to recognise the walk to point but no text.
If I use the right mouse click, it ignores the walk-to point but will display the text.

Proskrito

ah yes, there is a bug in those templates that causes what you say, a-v-o told me what was wrong and fixed it.
I'll update the templates tomorrow to fox this and other things, but if you cant wait, just replace the MovePlayerEx function in the global script with this one:
Code: ags

/**/function MovePlayerEx(int x, int y, int direct){
/**/  //Move the player character to x,y coords, waiting until he/she gets there, but allowing to cancel the action
/**/  //by pressing a mouse button.
      int cursorspritenumber=33,
          blankcursorspritenumber=34;
      ChangeCursorGraphic(7,cursorspritenumber);
/**/  GScancelable=0;
/**/  if (direct==0) MoveCharacter(GetPlayerCharacter(),x,y);
/**/  else MoveCharacterDirect(GetPlayerCharacter(),x,y);
/**/  // wait for release of mouse button
/**/  while (character[GetPlayerCharacter()].walking && ((IsButtonDown(LEFT)==1) || (IsButtonDown(RIGHT)==1))) {
/**/    Wait(1);
/**/    RefreshMouse();
/**/    CheckDefaultAction();
/**/  }
/**/  // abort moving on new mouse down
/**/  while (character[GetPlayerCharacter()].walking){
/**/    if (IsButtonDown(LEFT)==1 && (GetGUIAt(mouse.x,mouse.y)<0 || GetInvAt(mouse.x,mouse.y)>=0)) {
/**/      StopMoving(GetPlayerCharacter());
/**/      GScancelable=1; 
/**/    }
/**/    else if (IsButtonDown(RIGHT)==1 && (GetGUIAt(mouse.x,mouse.y)<0 || GetInvAt(mouse.x,mouse.y)>=0)) {
/**/      StopMoving(GetPlayerCharacter());
/**/      GScancelable=2;
/**/    }
/**/    else {
/**/      Wait(1);
/**/      RefreshMouse();
/**/      CheckDefaultAction();
/**/    } 
/**/  }
/**/  ChangeCursorGraphic(7,blankcursorspritenumber); 
/**/  if (GScancelable==0) return 1;
/**/  else return 0;
/**/}

Kinoko

I'm afraid I tried replacing the code with what you gave me there, and it hasn't made any difference. The player character still won't do anything but walk when I use the left mouse click on the 'look' GUI and then on the object.


the_dragon

Hi
Proskrito. I've translated your FOA template in spanish, because I couldn't get it from the direction I got in ADAN's page. I would like to save this template, not "Export GUI",  but I dont know how to do this.
Thanks :D

**(Te lo pongo en ingles pq no encontre tu mail, y por respeto al foro)

SMF spam blocked by CleanTalk