Adventure Game Studio | Forums

AGS Support => Beginners' Technical Questions => Topic started by: TerranRich on 01 Aug 2003, 06:04

Title: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: TerranRich on 01 Aug 2003, 06:04
Okay, three LucasArts GUI questions in a row is a sign.

Please post ALL LucasArts questions here, so that the threads will be easier to see and pick out. We will still continue to look at all remaining LucasArts GUI help threads, however. But after those, please post all questions here.

Thanks. :)

September 30, 2009 Update:
A new Scumm GUI, version 0.9, created by abstauber, is available here: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=38874.0



June 7th, 2006: The download for the 2.71 version is at http://ssh.me.uk/MI2forags271.zip thanks to SSH. It should also be compatable with the current 2.72 beta, but post any problems here.

{September 20th, 2005 Super Edit: The download for the 2.7 version is at http://www.lumpcity.co.uk/~skimbleshanks/templates/MI2v2.7.zip with special thanks to Lazarus}

[Early 2005 Edit]Most GUI questions posted here will be in reference to Proskritos' GUI's which can be downloaded from here: http://www.freewebs.com/skimbleshanks/templatesandmodules.htm
As of July 2005, we suggest using an older version of AGS to go with these templates and GUIs, as they were compiled with an older version of AGS. We suggest 2.62
Title: Re:The LucasArts GUI Help Thread
Post by: Totoro on 04 Aug 2003, 01:44
Hi,
so let's use the officcial LucasArts Gui Thread now  ;D
My problem seems pretty stupid. I got the GUI at http://usuarios.lycos.es/golfapagina/bazura/
and whenever I try to use them as a template, my AGS will tell me, that these templates where made with a newer version of AGS than I have and I cannot use them with my version. But I have 2.55! What is wrong? Sniff  ???
Totoro
Title: Re:The LucasArts GUI Help Thread
Post by: Proskrito on 04 Aug 2003, 07:14
The templates were last edited with a beta version :-\ sorry.
you will need that.
Title: Re:The LucasArts GUI Help Thread
Post by: Red_Armadillo on 22 Aug 2003, 08:48
Hi,

what code would I attach to make a walk to command on a Lucasarts type inventory bar. I already have the icon made.
Title: Re:The LucasArts GUI Help Thread
Post by: on 22 Aug 2003, 12:59
Hi!

The LucasArts GUI I'm using defines the extended buttons with SetGlobalVariable(80), and I'd need to use the "If variable is set to a specific value" conditional to find out what action was used. How do I get the value of the variable in CONDITIONAL-statement of the interactions editor?

I've tried setting the conditional to "if (GetGlobalVariable(80)==4".



Bigcitynerd: Use the SetCursorMode command to set the cursormode 1, the same way its used in the default GUI.
Title: Re:The LucasArts GUI Help Thread
Post by: inFERNo on 23 Aug 2003, 09:27
Reno, this line of code should be exactly what you need.

if (GetGlobalVariable(80)==4) {
  //place code here
  }

to be specific. If that doesn't work you probably have an error elsewhere, either in defining the global var (make sure it's set to 4) or in the rest of the GUI code.
Title: Re:The LucasArts GUI Help Thread
Post by: Red_Armadillo on 23 Aug 2003, 09:49
I used the Lucasarts GUI from AGS, right?  I modified it so you can quit the game and save and all that crap. So is there any way I can fit it to the screen w/o having to change the res.?
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on 23 Aug 2003, 20:20
That is the only way you could make it fit the screen, is by changing the resolution of the images...What, are you trying to make a game in 800 by 600?
Title: Re:The LucasArts GUI Help Thread
Post by: Red_Armadillo on 24 Aug 2003, 01:41
Nope, I'm doing a 640x480 game and I was friggin' stupid and made the objects first!
Title: Re:The LucasArts GUI Help Thread
Post by: on 25 Aug 2003, 13:17
Forgot to mention that for some reason the if (GetGlobalVariable(80)==4) works in script, but not when using the CONDITIONAL from the interactions editor. Technically I could make the entire game by scripting, but I have many actions for each interaction so making it all by scripting would consume a lot more time.

i've tried creating variable by names GlobalInt, GlobalInt(80), GetGlobalInt, and several other names, but the CONDITIONAL doesn't seem to find it.
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on 25 Aug 2003, 16:31
SetGlobalInt
SetGlobalInt (int index, int value);

Sets the global variable INDEX to VALUE. You can then retrieve this value from any other script using GetGlobalInt.
There are 500 available global variables, from index 0 to 499.

Example:

SetGlobalInt(10,1);

will set the Global Integer 10 to 1.
See Also: GetGlobalInt
Title: Re:The LucasArts GUI Help Thread
Post by: Gilbert on 26 Aug 2003, 05:28
Scummbuddy, judging from what he wrote, I think he knew about that already, what he wanted to know was how to refer to variables which are accessible by BOTH text scripting and from Interaction responses.

In fact, I think the interactions can not access GlobalInts currently, instead, you need to use the Graphical Variables (see text script function GetGraphicalVariable(), unfortunately there doesn't seem to be a SetGraphicalVariable(), so you cannot change their values in text scripts at the moment, correct me if I'm wrong)
Title: Re:The LucasArts GUI Help Thread
Post by: on 04 Sep 2003, 16:41
Does anyone know how to do the label in Monkey Island and DOTT type GUIs which says the action you would get if you clicked the mouse?
Title: Re:The LucasArts GUI Help Thread
Post by: on 08 Sep 2003, 08:46
Now I've got all other GUI functions working exept Give, but the greater problem is that I can't use inventory items on each other. How do I do that?
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on 08 Sep 2003, 14:22
Reno:  Interact with inventory
currently, because the Interact mode selects the inventory item, this interaction can only be triggered by manually calling the RunInventoryInteraction text script function (ie. you have to use the Handle Inv Clicks in Script option).

notagoodname:
Did you make your own LucasArts styled GUI? Or are you using Proskritos template?
Title: Re:The LucasArts GUI Help Thread
Post by: on 11 Sep 2003, 14:00
The one that came with the AGS, I don't know if it's Proskritos or not.

Is there a tutorial about how to handle inventory clicks in script somewhere? Or I think I could figure it all out from examples of look/talk and use modes, as soon as I'd get them.

Or, is there a way to handle ONLY the use inv on inv in the script so I could do other interactions normally?
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on 11 Sep 2003, 17:02
Don't use the one that comes with AGS, there are many faults with that one.  I've tried many times before to save it, but it just fails.  Go ahead and use the first post in this thread to get directed to Proskritos' GUIs.  They will be what you want.
Title: Re:The LucasArts GUI Help Thread
Post by: Reno Caspain on 12 Sep 2003, 09:47
Stupid question: How do I use templates? I've got the files downloaded, but I haven't found any instructions for opening them.
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on 12 Sep 2003, 20:25
After you unzip them, you place the files in your ags directory, the one with the agsedit.exe file in it.  then when you start a new game, it will ask you if you want to use a template and it will show up there.
Title: Problem with give command in DOTT temp
Post by: on 13 Sep 2003, 16:05
First off I have to apoligze if my post isn't in the correct place, this is my first post.

My main problem is with the give command in the DOTT template. The GUI runs fine but I can't seem to run any interaction commands. For example let's say I wanted to give an NPC an item and have the NPC run a dialog after recieveing it.Instead of running my commands it just adds the item to the NPC's inventory. If anyone can help me It would be appreciated.
Title: Re:Problem with give command in DOTT temp
Post by: Proskrito on 13 Sep 2003, 16:52
oh yes, i see.  :-\
You could try to find that:

if (GetCursorMode()==4 && GetLocationType(mouse.x,mouse.y)==2 && Mode("give")){

in the LEFT button interaction in the on_mouse_click function in the global script, and then replace it with:

if (GetCursorMode()==4 && GetLocationType(mouse.x,mouse.y)==2 && Mode("give") && GetCharacterAt(mouse.x,mouse.y)<3){

tell me if it worked! :)

EDIT: btw, the unhandled event function is buggy, i think i'll have to redo it. sorry, but there is only a template user that is telling me the errors he is getting, so i cant ensure that it will work just fine.
And maybe this shoud be in the lucasarts interface thread, im not sure  :P
Title: Re:Problem with give command in DOTT temp
Post by: on 13 Sep 2003, 17:37
That fixed it.
Now, the interactions are working again.
Thank you for your help.

I'm not exactly the best user of script but I'll do what I can to look for bugs for you.

Thanks again
Nitz
Title: Re:The LucasArts GUI Help Thread
Post by: Reno Caspain on 15 Sep 2003, 17:15
Still having a problem with the Proskritos template. I've copied the .agt files to the AGS folder, but when starting a new project, it doesn't have any effect. I'm using version 2.52, if that has any effect.
Title: Re:The LucasArts GUI Help Thread
Post by: SSH on 15 Sep 2003, 17:20
Templates require version 2.55 or newer (and require the template to be compiled in an older version than the one you are using), so I suggest downloading the latest version (2.56), backup your game, and move to the latest release.
Title: Re:The LucasArts GUI Help Thread
Post by: on 17 Sep 2003, 13:21
Hi all!

I havent used AGS for about 2 years. I dont remember anything...
Pls help me:
I try to make a game in the lukasArt style. I copied the script for the gui from the demo LukasArts Room (U know, the room in the demo with the house from monkey island) and pasted it in the global script. But it doesnt work. The gui appears in the start screen but it should appear in the screen, where I can move my person.
Can u give me the script, which I must paste in the global script??

Pls help me!
Fabs
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on 17 Sep 2003, 14:56
go ahead and read at least the first post in this thread. it will direct you to different templates of the LucasArts guis.  They are much much more stable than the one given with ags and the one in the demo.
Title: Re:The LucasArts GUI Help Thread
Post by: on 17 Sep 2003, 15:46
Wow! Thats relly cool!
But, how can I import the gui in AGS. It only can import *.gui files but the gui is a *.agt file.

Pls Help!
Fabs
Title: Re:The LucasArts GUI Help Thread
Post by: Ishmael on 17 Sep 2003, 16:00
It's a fraggin' template. The .agt comes from Adventure Game Template. You put the file in the main AGS directory, start AGS, choose "create new game", select the template form the dialog, type in the game folder name, and click the "next" button... And if there's no "next" button in it, I mean the button that ain't "back".

Got it? Someone come poor a bucket of cold water on me so I can cool off a bit... :P
Title: Re:The LucasArts GUI Help Thread
Post by: on 18 Sep 2003, 18:45
There are a Push and Pull Button but how can I use it?
I mean, when I have an object I can make interations with "Look at","Talk to object" but how can use pull on the object. It doesnt exist in the list.

Pls help me
Fabs
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on 18 Sep 2003, 19:21
Have you read the readme file that comes with all the templates he made?

"Since Open, Close, Push and Pull are extended modes that use AGS cursormode 8, they'll also be defined this way."  read on in there to get more info."

then post back here with any more questions you may have
Title: Re:The LucasArts GUI Help Thread
Post by: Mats Berglinn on 20 Sep 2003, 18:02
I can't veiw the read-me file at all because when I open it the test is toatlly screwed up. Can't you just explain how you make commands for push, pull, open, close and give on characters, iventory, objects and hotspots. Please tell so I can come further in my game.
Title: Re:The LucasArts GUI Help Thread
Post by: Ishmael on 21 Sep 2003, 06:55
The LUCASARTS.GUI which comes with AGS has the extented modes explained in a way.... You use a globalint and the 'any click' interaction command for that.
Title: Re:The LucasArts Template Help Thread
Post by: SSH on 25 Sep 2003, 13:12
Can people please, including this thread, please stop referring to templates as GUIs: it really confuses all the n00bs, and some oldbies who come across templates for the first time, too!

Thank you!
Title: Re:The LucasArts GUI Help Thread
Post by: SSH on 21 Nov 2003, 16:26
Can I point out that the unhandled_event thing breaks completely in 2.6betas due to the new function type checking...

pretty please Proskito, can you fix it?
Title: Wondering about a scripting command
Post by: Mats Berglinn on 21 Nov 2003, 18:25
In the SCUMM templates by prosikito I have found this scripting command:

GoToCharacter(MEL,2,0,1);

I have discovered that this command makes the player character walk to that character that is displayed and turns to him but I'm not sure what the numbers are standing for and the command isn't in the help part. Does any know the fully information behind this command?

It would be usefull to know how so that I can make the player-character walk to characters wherever they are and if you want to either face the player character right, left, up or down.
Title: Re:The LucasArts GUI Help Thread
Post by: Proskrito on 22 Nov 2003, 01:09
Quote
Can I point out that the unhandled_event thing breaks completely in 2.6betas due to the new function type checking
yes, tomorrow after work i'll upload the new versions..., now im going to bed :)
Quote
GoToCharacter(MEL,2,0,1);

I have discovered that this command makes the player character walk to that character that is displayed and turns to him but I'm not sure what the numbers are standing for and the command isn't in the help part. Does any know the fully information behind this command?
yes, the commands are:
1)- int CharID >of the character you want to go to;
2)- int direction > at which side of the character the player must go and stay:
0 - the shortest way;
1 -up (behind)
2 -right
3 -down (in front of)
4 -left
3)- int npc faces player > if 1, the npc will face the player character, if 0 he won't
4)- int blocking> 1 blocking, 0 nonblocking
Title: Re:The LucasArts GUI Help Thread
Post by: Kinoko on 03 Dec 2003, 12:39
(Sorry if this should be in the general topics)

I'm having trouble with changing the GUI buttons using the MI2 GUI template. I exported the button graphics into my graphics program and changed them, keeping them at the exact same size as the originals for convenience, then importing them (without checking the "import for 640x400 resolution" box) and that worked fine, meaning that when I viewed them in the GUI tab, they were at the right size.
However, I'm making my game in 640x400 res. so I thought I'd make more detailed buttons. I doubled the size of the button graphics, redrew them and imported them again (this time checking the box) and while the graphics are technically the right size in the GUI, the quality has dropped significantly, as if they were larger graphics at a lower magnification. Is there something I'm doing wrong, or some way past this?

Thanks.
Title: Re:The LucasArts GUI Help Thread
Post by: on 06 Dec 2003, 19:49
Hi. This is my first post on this forum, so I think I should first introduce myself. My name is Petar and I am from Croatia. I found AGS about a month ago and started a small project which combines GUI's from MI3 and DOTT. Everything works except this small problem.

How can I change cursor on HOTSPOTS which define exiting the specific area (MI3 style arrows)?

I managed to that, but the cursor changes permanently, and I would like it to change back to the original graphic.
I tried to be smart, and defined another hotspot around that particular one to change the cursor with SetCursorGraphic, but it doesn't work.

I am using cursors which change their appearance on Hotspots in the Cursors tab.

Thank you.

Another small question

What are the names of the games that have their screenshots on the AGS forums banner. First is Permanent Daylight. What are the names of the second and third picture.

Thanks again.
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on 07 Dec 2003, 07:58
for your last question, hover your mouse over the banner and your question will be answered.

How large of a surrounding hotspot did you use to try and convert the cursor back to? Making it larger should work, but you may also consider looking into regions to see if that will work for you.
Title: Re:The LucasArts GUI Help Thread
Post by: Proskrito on 07 Dec 2003, 14:35
i think you could try to do it with hotspot's properties.
Like, in those hotspots that define the exits, you could make a property called 'exit' or so, and then define the direction (in order to set the correct arrow later).
Then in the repeatedly execute check if the property 'exit' is up, down, left or right, and, if it is, set the cursor image to the corresponding arrow, and if its not, set the default image.
Just an idea, never tried it or anything.
Title: Re:The LucasArts GUI Help Thread
Post by: on 07 Dec 2003, 14:52
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.
Title: Re:The LucasArts GUI Help Thread
Post by: on 11 Dec 2003, 20:14
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.
Title: Re:The LucasArts GUI Help Thread
Post by: SSH on 11 Dec 2003, 20:19
Petar: maybe if you post the code you have in your global repeatedly_execute, then we can help...
Title: Re:The LucasArts GUI Help Thread
Post by: on 11 Dec 2003, 20:59
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.




Title: Re:The LucasArts GUI Help Thread
Post by: SSH on 11 Dec 2003, 21:12
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:
Title: Re:The LucasArts GUI Help Thread
Post by: on 12 Dec 2003, 01:06
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
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on 12 Dec 2003, 01:36
Get the DOTT style gui at the same download site
Title: Re:The LucasArts GUI Help Thread
Post by: on 12 Dec 2003, 02:22
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
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on 12 Dec 2003, 03:33
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.
Title: Re:The LucasArts GUI Help Thread
Post by: King Teddy Wogan on 12 Dec 2003, 09:43
Where abouts are all these guis? I've tried all the links around the posts, but it seems the sites have gone down!
Title: Re:The LucasArts GUI Help Thread
Post by: Proskrito on 12 Dec 2003, 10:36
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...
Title: Re:The LucasArts GUI Help Thread
Post by: Finer on 12 Dec 2003, 21:45
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.
Title: Re:The LucasArts GUI Help Thread
Post by: on 13 Dec 2003, 17:45
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.
Title: Re:The LucasArts GUI Help Thread
Post by: on 14 Dec 2003, 22:32
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.
Title: Re:The LucasArts GUI Help Thread
Post by: on 03 Jan 2004, 04:27
 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  
Title: Re:The LucasArts GUI Help Thread
Post by: Kinoko on 03 Feb 2004, 02:07
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.
Title: Re:The LucasArts GUI Help Thread
Post by: Proskrito on 03 Feb 2004, 09:20
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: [Select]
/**/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;
/**/}
Title: Re:The LucasArts GUI Help Thread
Post by: Kinoko on 04 Feb 2004, 00:24
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.
Title: Re:The LucasArts GUI Help Thread
Post by: Proskrito on 07 Feb 2004, 15:17
try the new ones:
http://www.agsforums.com/yabb/index.php?board=2;action=display;threadid=6642;start=msg122548#msg122548
Title: Re:The LucasArts GUI Help Thread
Post by: on 12 Feb 2004, 00:39
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)
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on 12 Feb 2004, 07:45
Next to File, there is Game. Use that selection, and move down to the second from the bottom.  There is the "make template" selection.
Title: Re:The LucasArts GUI Help Thread
Post by: on 12 Feb 2004, 20:15
lol Thanks scummbuddy, I must be blind.
:D
Title: Re:The LucasArts GUI Help Thread
Post by: IntentInsane on 14 Feb 2004, 15:42
How do you make your inventory display acroos the botom?(Is this the Lucasarts style?) If you culd give me a step by step guide/faq I would much apreciate it!
Title: Re:The LucasArts GUI Help Thread
Post by: Kinoko on 16 Feb 2004, 15:49
I'm using the MI template, but I'd like to stop characters turning to face the player character when I look at them. Is this a part of the MI template or a general AGS function? If it's the template, how do I turn it off?

Thanks
Title: Re:The LucasArts GUI Help Thread
Post by: Proskrito on 16 Feb 2004, 17:36
in the 'GoTo' function, look for this line:
/**/  if (locationtype==2) arrived = GoToCharacter(GetCharacterAt(mouse.x,mouse.y),0,1,blocking);
and change it to
/**/  if (locationtype==2) arrived = GoToCharacter(GetCharacterAt(mouse.x,mouse.y),0,0,blocking);
and see if it works
Title: Re:The LucasArts GUI Help Thread
Post by: Kinoko on 17 Feb 2004, 02:04
It worked, thanks dude! ^_^
Title: Re:The LucasArts GUI Help Thread
Post by: monkey0506 on 20 Feb 2004, 00:57
I'm new to AGS and I downloaded a Monkey Island 2 gui @ http://www.juncmodule.com/juncSource.html, and now, when I try to test my game, or save it, I get an error saying that:

There was an error compiling your script the problem was in 'Main script':

Error (line 65): Undefined token 'SetMode'


I'm new to this type of scripting, and as I didn't write any of it, I have no idea what to do.

here's lines 64 - 74, like I said, I have no clue what I'm doing, but I hope this is enough for some help...
Code: [Select]
/**/  if (interface == MAINGUI) {
    if (button == 0)  SetMode("give");
    if (button == 1)  SetMode("pick up");
    if (button == 2)  SetMode("use");
    if (button == 3)  SetMode("open");
    if (button == 4)  SetMode("look at");
    if (button == 5)  SetMode("push");
    if (button == 6)  SetMode("close");
    if (button == 7)  SetMode("talk to");
    if (button == 8)  SetMode("pull");
/**/    if ((button == 10) && (game.top_inv_item < game.num_inv_items - (game.num_inv_displayed-1)))




EDIT: I checked the site, and according to that site, the gui I'm using IS Proskrito's, however, I still have NO idea what's causing the error. I'm going through the tutorial, and playing around with AGS itself, but unless I can find a scripting tutorial, I don't think I'm going to get anywhere anytime soon...
Title: Re:The LucasArts GUI Help Thread
Post by: Proskrito on 22 Feb 2004, 12:25
did you export the gui from the template and imported it into your game? or deleted something? you need the functions that come with the template for it to work.
Title: Re:The LucasArts GUI Help Thread
Post by: monkey0506 on 22 Feb 2004, 13:30
I did export the gui...  :-[


EDIT: Where can I download the Beta version so I can do anything? I started a new game with the template, and now when I go to test the game, it loads, but I can't walk around or anything like that because I don't have the beta version or whatever, and the Downloads page doesn't have a link for that...  >:(


EDIT: Well, I finally got a program that can open "rar" files, so I now have a copy of the template that works with my version of AGS. However, I have a problem. in my game, if I left click on "Look At" and then on a hotspot, then nothing happens, but if I right click the hotspot it completes the sequence of events. Did I mess something up, or is it the template?


EDIT: Maybe I should go back and look at the old posts. according to some of the previous posts, this is a new problem, however I'm pretty sure I have the newest version of the MI2 template, and it doesn't see to have corrected the problem...
Title: Re:The LucasArts GUI Help Thread
Post by: spud on 22 Feb 2004, 20:40
ive started making my game ive downloaded the monkey island 1 gui by inquisitor but and it is great but ineed help with one thing and i cant seem to find it here

in monkey island when you click on use,talk,look e.t.c the text at the top of the bar says talk to look at object or person
but on my game it just says walk to object all the time

is there a way to get it to work like the original and if there is i would be happy

p.s try and type it as simple as you can because i am still getting to grips with the lingo

cheers spud
Title: Re:The LucasArts GUI Help Thread
Post by: monkey0506 on 22 Feb 2004, 20:52
well, although it's not exactly complete, Proskrito's template is excellent:


http://galeon.com/golfa/otros/nuevos/MI2_template_v13.rar


That's the most recent release. there's a few errors here and there, see previous posts, but as I too am a newbie, that's the best advice I can give.  ;D
Title: Re:The LucasArts GUI Help Thread
Post by: Kinoko on 24 Feb 2004, 05:13
I had that exact problem with the "look at" function not working when used with the left mouse button, and working but ignoring walk-to points when used with the right mouse trigger.

As soon as I got v1.3 of the template and transferred my game over, the "look" function worked fine except for a group of about 5 hotspots in one room. I don't know if that's related and absolutely noone has been able to come up with any ideas or solutions for that problem.

Right now, for seemingly no reason at all, my walk-to points have all decided to stop working completely. I also don't know if this is related to the template or not but I thought I'd just throw it out here in case someone else comes across the problem.
Title: Re:The LucasArts GUI Help Thread
Post by: Proskrito on 24 Feb 2004, 15:32
yes, its because the actions that are able to be cancelled with a mouse click. they dont work properly with hotspots that have a walk to point set.
Dont use them, and it should be ok, just like ags default.
kinoko, with the template, there is a doc file, read it, because i think there are answers to some of the questions you have been posting lately : ) (if you can understand my english ;) )

about the 'look at' problem, i dont know, cos several people have reported that, but it always works fine for me  ???
Title: Re:The LucasArts GUI Help Thread
Post by: Kinoko on 25 Feb 2004, 01:21
I've made so many changes lately, it's hard for me to remember exactly what fixed what, but I've essentially fixed all these problems in the last couple of days.

Proskrito - I had been reading the doc file but since I could never remember every problem addressed in it, when a new problem arose, I would often think "Hmm, didn't see that in the doc" and didn't think to check.

My walk-to points had stopped being recognised because of a REALLY simple thing: I had at some point accidentally unchecked the box regarding them in the general settings tab. Easily fixed.

As I said before, the "look at" problem was fine as soon as I got the new template (so I highly reccommend it!).

The 5 or so hotspots that weren't working REALLY baffled me. I did a few tests with moving them around and taking them off one by one and, although I don't understand WHY this was a problem, I figured out what the problem was. One of my hotspots reached all the way to the top pixel of the background. It was, for some reason, stopping not only itself from working properly, but all the hotspots directly below it. All I did was keep one pixel length line free at the top of the screen and everything works like a charm. If keeping the top line of pixels free is written in the manual somewhere, I never came across it... but it completely baffled me.

The only other fundamental problem I had was the character, after being told to look at something, moving to the object's closest point on his own, and THEN moving to the hotspot. I fixed that by changing the 1 to a 0 in the line: AlwaysGoToHotspots=0;

Easy ^_^ I hope that helps anyone who comes across similar stupid problems!
Title: Re:The LucasArts GUI Help Thread
Post by: monkey0506 on 25 Feb 2004, 19:14
I re-downloaded it, and upon testing your rooms, it worked. I also added a room of my own, and it still worked. however, I have a question now. I connected the rooms, but when I go from one room to the other, Guybrush always starts at the same co-ordinates in EVERY room. how can I change it so I can set up the co-ordinates depending on where he came from?

EDIT: I imported a character of my own, and set him as the player character. I tested the game, and it stopped working. the lookat button not the game. I set the original character back to the player, but now it still won't work. I did this before, imported the character. Is there something wrong with my new character?
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on 25 Feb 2004, 20:25
Use the scripting of NewRoomEx, read up on it in the helpfile/manual

but i also believe its available in just the interactions window, for you to just set up there the location of where they should enter the new room.
Title: Re:The LucasArts GUI Help Thread
Post by: monkey0506 on 01 Mar 2004, 02:17
Well, I got it figured out, but I have two problems:

1. the character doesn't walk to the hotspot before exiting the room

2. I still can't get the buttons to work with my imported character. If I download a fresh copy of the template, and use the provided character, it works, however, if I import my own character it stops working. I will try to just re-import the sprites to a new copy of the template, but I don't know if it will work...

EDIT: Just importing over the previous sprites didn't help. perhaps it's not the character's fault, and I'm doing something else wrong, however, I have no idea what...
Title: Re:The LucasArts GUI Help Thread
Post by: on 02 Mar 2004, 23:15
how can i use the "give" command?
where and what, i have to write in the script for
"give the beer to Cisco" and then run a dialog or another script?

thx

Cisco
Title: Re:The LucasArts GUI Help Thread
Post by: Proskrito on 03 Mar 2004, 22:07
where and what, i have to write in the script for
"give the beer to Cisco" and then run a dialog or another script?
in the 'use inventory item on character' interaction, and you should check if the mode used was 'give', something like:
Code: [Select]
function character_x(){
//use inv on character
if (UsedMode("give")){//if mode was 'give'
  if (character[GetPlayerCharacter()].activeinv==X){ //if beer was used (X -> beer item number)
    LoseInventory(X); // lose the beer
    RunDialog(5);// start dialog #5
  }
}
}
Title: Re:The LucasArts GUI Help Thread
Post by: Mr Flibble on 06 Mar 2004, 14:19
I've got a problem with the rooms. I know this may be a prob for the general but hear me out. ( I using P's template).

Could you tell me;
1) How to make 'open' and 'close' (a door)do just that, not change room?
I had a few goes. He just goes through anyway. I didn't even write script for it. Must be part of the template....
I have a rough idea but I'm sure there's an easier way.
Thanks.
Title: Re:The LucasArts GUI Help Thread
Post by: monkey0506 on 10 Mar 2004, 07:01
well, seeing as I've been ignored, I'm supposing no one has any clue as to what the crap I'm doing wrong. if anyone does have even any ideas, it would be greatly appreciated. else, could I possibly send someone the pictures I want to use for the character and they could try to figure it out???? I'm sorry if I sound angry, I'm not, I'm just frustrated that no one, especially not me, knows what the crap is going on here...... thanks for ANY help...!
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on 10 Mar 2004, 16:12
Mr. Flibble:
Are you using ObjectOn and ObjectOff functions?

monkey_05_06:
Can you step us through what you do when importing sprites over your old character to make your new one? Check your view manager to make sure theyre all there correctly in a view, it should be the previous characters view, but let us know.
I think your first question is answered in the help document that comes with the template.
Title: Re:The LucasArts GUI Help Thread
Post by: Mr Flibble on 10 Mar 2004, 18:55
I'm not sure, I'll check when I get home.
Bigger problem;
The FOA template, whats the deal with the unhandled event thing?
I tried pasting in thr script from MI2 temp but while it solved the first problem, it caused more.

FOA: Wrong number of perameters in (I forget: I check at home

MI2: GS=GetLoctype line. It works fine in original context ie. The MI2 temp but when pasted to Indy major problems.
Sorry if my explainantion is imprecise. I post a better one later.
Title: Re:The LucasArts GUI Help Thread
Post by: monkey0506 on 11 Mar 2004, 15:08
well, I'm pretty sure that I did just paste the new sprites over the old ones and it used the same view or whatever, but I'm not 100% sure. I'm on my mom's laptop right now, so I'll get back to you later. also, as for the first problem, I've scanned through the help documents, and I didn't see it, but I'll look a little more carefully... thanks ahead of time for at least acknowledging my problem though!
Title: Re:The LucasArts GUI Help Thread
Post by: Kinoko on 11 Mar 2004, 15:30
I'm using the MI template. I have a cutscene that starts with an "use" action. The GUI disappears for awhile and then reappears later in the cutscene. The problem is that when the GUI is turned back on, the "use" action is still highlighted in the action bar.

Is there a way I can change the text in the action bar to the standard "walk to" before the GUI reappears? It looks very odd having it reappear so much later with the same old action still written there.
Title: Re:The LucasArts GUI Help Thread
Post by: monkey0506 on 13 Mar 2004, 22:21
okay. I stand corrected. I just typed a very lengthy step-by-step walkthru of what I was doing, except for one difference. this time it worked. I think I may have added more sprites and added more frames to some of the views, and I don't know if that would mess it up, but know it's working! I still have to add my first room to re-test it, but it appears that it's working!!!!!!! THANK YOU! even though in the end I figured this one out on my own... THANK YOU. THANK YOU FOR THIS WONDERFUL GUI!!!!!
Title: Re:The LucasArts GUI Help Thread
Post by: monkey0506 on 14 Mar 2004, 17:58
If you get in the coffin, you can sail around the entire island. I'm not sure what to do cause I don't want to mess anything up (see ALL previous posts) but I will eventually need to use the coffin. thanks
Title: Re:The LucasArts GUI Help Thread
Post by: MarvinS on 17 Mar 2004, 13:02
I'm using Proskrito's FOAlike GUI.

I create a room, and I cant pick up any of the objects.

Thats what I did :

1. Create a new Object
2. Change Image
3. Interaction -> Any Click on the Object -> Run Script
Code: [Select]
if (UsedMode("pick up"))
     {
       AddInventory(3);
       ObjectOff(0);
     }

But when I test the game, and I click on "pick up" then on "my object", nothings happend.

What's wrong ?
Title: Re:The LucasArts GUI Help Thread
Post by: monkey0506 on 25 Mar 2004, 02:37
I know I've complained about this more times than everyone else combined, but for  some reason, I can't get the buttons to work right. I said I got it working, and well I did, but now, I've loaded a new room, and it doesn't work in that room. it works everywhere else. just not that room. I've tried everything I can think of but I can't figure it out. the only difference is that that's the only room of mine that has any "objects" I read up on objects, but couldn't find anything regarding this. yeah. n00b. I'm a n00b. I do hope to one day get this all sorted out, but from the looks of things, we'll be taking 5 minute flights to Pluto before I get this figured out...
Title: Re:The LucasArts GUI Help Thread
Post by: Mr Flibble on 25 Mar 2004, 16:13
How exactly doesn't it work? I mean is it not displayed or not clickable or something?
Title: Re:The LucasArts GUI Help Thread
Post by: monkey0506 on 25 Mar 2004, 22:32
okay, I loaded this new room right? well when I test the game, and I click a function such as "pick up" and then I click on my object, it won't work. it works in every other room still, just not this room. I click but it reacts like it's just a walk to, instead of a pick up. I found out, in reading the documents how to set the default function (the right clickable function), and that works, but left clicking buttons doesn't work right in that room. I simply don't understand it!!! but thanks for your concern.

EDIT: I think this might have to do with the location of my object cause I've put other objects in there and I've noticed that they work fine. Help? n00b... :-[
Title: Re:The LucasArts GUI Help Thread
Post by: Mr Flibble on 26 Mar 2004, 18:32
Did you remember to write the script for interaction with the object?
Title: Re:The LucasArts GUI Help Thread
Post by: monkey0506 on 28 Mar 2004, 16:00
yes. all it says is to remove the object and add the inventory when you pick it up. I CAN right-click on this object, I just can't left-click. I tried adding an invisible, non-interactable object and creating that object again, with a different number, but it still didn't work.
Title: Re:The LucasArts GUI Help Thread
Post by: Proskrito on 29 Mar 2004, 22:48
Marvin:
Have you tried to place it in the 'pick up object' interaction, instead of the 'any click' one?
monkey:
it seems it could be the same problem kinoko had with the 5 hotspots. I have no idea at all of why it happens  ??? : ( it never happens to me, but it happens sometimes to other people : /
(Another thing that might have nothing to do with it but just in case: does the screen scroll while the player is going to that object?)

I cant look at the problems as my computer got broken some time ago. As soon as i get a new one, i'll look to all those problems and see if i can discover why they happen.
Title: Re:The LucasArts GUI Help Thread
Post by: on 01 Apr 2004, 15:25
Problem:
In the FOA gui you see 2*5 inventory slots, each 29*21 and 3 pixel spacing between each.

I modified this GUI made it smaller and want it to have 1*6 inventory slots, each 32*32 and 0 pixel space between them.

Were to change that?
Title: Re:The LucasArts GUI Help Thread
Post by: monkey0506 on 02 Apr 2004, 23:31
yes, well. i'm not sure why, but like I said, i tried creating an invisble object in its place, moving it, and recreating the object on a different object number but it didn't work... I feel so confused...............          ...       ..............                ...........               ................. ....
Title: Re:The LucasArts GUI Help Thread
Post by: MarvinS on 05 Apr 2004, 12:32
Marvin:
Have you tried to place it in the 'pick up object' interaction, instead of the 'any click' one?

Yes, that dont do anything.
It's like Moneky's problem. When I pick up the object, Indy just walk
to the object, and then he does nothing.

My solution was to an interaction with the hotspot, instead of the obect. That's not very friendly, but it works.
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on 05 Apr 2004, 16:10
Problem:
In the FOA gui you see 2*5 inventory slots, each 29*21 and 3 pixel spacing between each.

I modified this GUI made it smaller and want it to have 1*6 inventory slots, each 32*32 and 0 pixel space between them.

Were to change that?

you said you modified it, but then you say how to change it.    have you changed the Gui in the Gui manager? Will this be scrollable?
Title: Re:The LucasArts GUI Help Thread
Post by: faggc on 08 Apr 2004, 11:36
I have another question related to this GUI: Can we release a game with Lucasarts GUI in the internet for free (I know the demo has Monkey2 GUI)? Will Lucasarts go after us until we remove the game for download?
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on 08 Apr 2004, 15:31
you may be better off replacing the elements, or just not using the rooms and characters and objects that are owned by lucasarts, but yes, you can release the game on the net.
go nuts!  ;D
Title: Re:The LucasArts GUI Help Thread
Post by: Mr Flibble on 09 Apr 2004, 18:09
Lucasart's don't really care about fangames anymore. They certainly haven't shut one down since FOMI.

Of course a more likely explaination is that they don't know about them.
Title: Re:The LucasArts GUI Help Thread
Post by: faggc on 10 Apr 2004, 12:00
Lucasart's don't really care about fangames anymore. They certainly haven't shut one down since FOMI.

Of course a more likely explaination is that they don't know about them.

Yes that's true. And now Lucasarts canceled all adventure games (FT2 and Sam&Max2). But that doen't mean that they don't care about old games. The true is that they don't want to release any old game as freeware.

But maybe this year (after the release of Indy:FOA2 - http://amberfisharts.com/)we know Lucasarts position.
Title: Re:The LucasArts GUI Help Thread
Post by: faggc on 19 Apr 2004, 17:45
I have downloaded Proskritos's template? I'm thinking in making a fan game using one of the templates(this is not an an announcement). The template helps a lot, but there's still some things to add. Right now i'm adding to the template functions that show red lines in maps (like in indy4).

I think the template helped me a lot. But how usefull are those templates? Is anyone else making a game using Proskritos's templates?
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on 21 Apr 2004, 18:42
All of the games I'm making use his templates in some form or another. I'm very happy with the work he put in, and hope they are updated. I was making my own LucasArts styled template, but he beat me out the door.
Title: Re:The LucasArts GUI Help Thread
Post by: SillySue on 23 Apr 2004, 18:21
How do you get the gui to work once you've downloaded them. I've tried opening it with AGS, that didn't work, so I opened AGS and tried to import it but it said it wasn't a AGS gui. How do you work it?
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on 23 Apr 2004, 23:30
what version are you using of AGS, when you want to start a new game, it should (newest versions) have you select a template to use.
Title: Re:The LucasArts GUI Help Thread
Post by: on 27 Apr 2004, 00:09
Hello all :) I'm new here so sorry if I am making a mistake

Everyime I try to play the game using the template - I get an error saying:

Error: run_text_script1: error -1 (Runtime error: wrong number of paramters to exported function 'unhandled_event') running function 'unhandled_event'

whenever I click. The game loads ok, but as soon as I click that comes up :(

Any suggestions or help apreciated
Title: Re:The LucasArts GUI Help Thread
Post by: on 27 Apr 2004, 00:24
I did search before but must have missed something I have now found what I needed :)

Sorry about that.
Title: Re:The LucasArts GUI Help Thread
Post by: Kinoko on 27 Apr 2004, 15:55
yes, well. i'm not sure why, but like I said, i tried creating an invisble object in its place, moving it, and recreating the object on a different object number but it didn't work... I feel so confused...............          ...       ..............                ...........               ................. ....

If it is like my problem (and this one REALLY stumped me), have a look at the other hotspots you have in that room, and in particular, which ones are near the object that won't work. Do any of those hotspots/walk behinds etc go all the way to the edge of the room? That was what my problem was. For some reason, the engine just didn't like a hotspot being on any of the pixelks around the very edge of the room. It made everything near it act like a "walk to".

I hope that helps.
Title: Re: The LucasArts GUI Help Thread
Post by: on 03 May 2004, 06:54
I'm working on a Label wich says what do I have under my Cursor. (like monkey Island "Walk to XXX")
The Demo Game Has one, but the problem is that it just works with Hot Spot areas, and It don't return Object and Characters names.
I need some help pleas  ???
Title: Re: The LucasArts GUI Help Thread
Post by: SillySue on 18 May 2004, 19:27
It must just be me, because i have the newest version, and it's never asked me what template I want to use.

I select new game, it asks me what resolution I want, and then nothing.

Can you tell me more...
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 18 May 2004, 20:38
try downloading the newest beta. just curious, what version do you have?
Title: Re: The LucasArts GUI Help Thread
Post by: on 19 May 2004, 02:10
 :-\ I downloaded Proskrito's templates, but when I start a new game in agsedit version 2.60.454.0 they don't show up along with the default blank template.
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 19 May 2004, 04:49
where did you place your downloaded proskritos template .agt files?
Title: Re: The LucasArts GUI Help Thread
Post by: on 19 May 2004, 05:03
 :-\ Oh, they're .rar files in the same folder as the agsedit. Thanks for the prompt reply.
Title: Verb Coin GUI
Post by: Mr Flibble on 27 May 2004, 20:40
I downloaded the Verb Coin template from the now operational Shimbleshanks, but when I use it, I get an error message about plugins.

So my question is this.
Does anyone know what plugins I need to run this template? If it matters, I have the latest version of AGS.
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 27 May 2004, 20:57
did you unzip it into your ags folder, where your agsedit exe is? did you try and create a new game with the editor?
Title: Re: The LucasArts GUI Help Thread
Post by: Mr Flibble on 27 May 2004, 23:38
Yes.

But when the editor opens I get an error message about plugins. I think I am missing one that was used to make the template.
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 28 May 2004, 00:07
is there any documentation [notepad or word docs] along with the download or in the zip?
Title: Re: The LucasArts GUI Help Thread
Post by: Mr Flibble on 28 May 2004, 18:33
Never mind, I downloaded it from the guy who made it's site.
The shimbleshanks one (named Verb Coin in their list) is missing a few files. Some one should tell them.
To get the new download, type "AGS verb coin" without the quotes.

The thing is called OVC (Opensource Verb Coin)
I should point out that it is NOT a CMI template.
Title: Re: The LucasArts GUI Help Thread
Post by: Mr Flibble on 29 May 2004, 19:52
Just a qucikie, how do I make a CMI like inventory, that I can open with a right click, use my left click activated pop-up verb GUI inside, then close by clicking outside the box?

At the moment I have a GUI with an inventory window.
I have buttons around the egdes so I can click on them to close it. When I pick things up they go into the inv, but I can't do anything with them. I want to be able to use my verb coin inside the inventory.

I'm not sure what script (if any) you'd like or need to see to help me out, so tell roughly what script you want and I'll copy it.
At the moment I have this:
Code: [Select]
function on_mouse_click(int button) {
  // called when a mouse button is clicked. button is either LEFT or RIGHT
  if (IsGamePaused() == 1) {
    // Game is paused, so do nothing (ie. don't allow mouse click)
    }
  else if (button==RIGHT) {
    if (GetCursorMode() == 4) SetCursorMode(0); //checks wether you use an inv.
    else InterfaceOn(3);   
To open the inventory.
Title: Re: The LucasArts GUI Help Thread
Post by: Scorpiorus on 30 May 2004, 00:56
Handling clicks over GUIs requires additional script to be added. See Dorcan's tutorial on how to achieve that sort of thing:  http://www.digitalmindstudio.ch/script.php?id=1

I'm not, however, sure that the verb coin would work with the inventory items without an extra code added. What's the complete code of the on_mouse_click() function?
Title: Re: The LucasArts GUI Help Thread
Post by: Mr Flibble on 30 May 2004, 13:16
Something like this.

function on mouse click()
something//we checked if the mouse was clicked
timer >20 (?) //hold the left button for half a second

/////More stuff along those lines


else interfaceoff(2) // the VB
Title: Re: The LucasArts GUI Help Thread
Post by: Scorpiorus on 30 May 2004, 15:13
The exact code would be very helpful. ;)
Title: Re: The LucasArts GUI Help Thread
Post by: Mr Flibble on 05 Jun 2004, 16:50
Code: [Select]
function on_mouse_click(int button) {
  // called when a mouse button is clicked. button is either LEFT or RIGHT
  if (IsGamePaused() == 1) {
    // Game is paused, so do nothing (ie. don't allow mouse click)
    }
  else if (button==RIGHT) {
    if (GetCursorMode() == 4) SetCursorMode(0); //checks wether you use an inv.
    else InterfaceOn(3);   
                       //brings up the usual Sierra inventory..
                       //In the next versions, it'll simulate a CMI-like
                       //inventory...
    }
  else if (button==LEFT) {  // left-clicking code
    if (GetCursorMode() == 4) ProcessClick(mouse.x,mouse.y,4);
    else { //these codes check wether you use an inventory or not..

    clicked = 1; //we trigger the calculating

    mousex = mouse.x; //we set these params to store the exact location of
    mousey = mouse.y; //where you clicked...

    guix = mousex - 25; //and we set the whereabout's for the GUI... and to
    guiy = mousey - 25; //center the GUI, we'll remove 25 (see below)...

    if (guix < 0) guix = 0; if (guix > 269) guix = 269;
    if (guiy < 0) guiy = 0; if (guiy > 149) guiy = 149;
      //Now we'll check these so the verbcoin won't appear to close to
      //the edges. If not altered, it may be impossible to select certain
      //commands! Why these numbers? Well, the GUI is exactly 50x50, which...

      //(NOTATE: the GUI is 50x50, not the graphic. That's why the GUI never will be
      //displayed without some space to the screen edge!!!)

      //...means that to center it by our clicks, it must be set to the mouse
      //coordinates - 25... AND, since AGS first coord. is (0,0), you
      //subtract 1 from the values. Also, as all other things, it spawns from
      //the top-right corner, so in the top and left side, well simply put it
      //close as possible ie. 0. On the other side, well take the largest value
      //(which is 319) and subtract 50 (the size of the GUI) and the equalent
      //from the bottom (199-50)
      }
    }
  }

Where Interface 3 is the inventory and interface 2 (if mentioned) is the verb coin.

In my game, I can pick up items and they appear in the inventory. Fair enough. But I can't interact with in any way. I can't even bring up the interface GUI. I think this might be caused by the interface being popup modal, or the line in the above code which tells the game to ignore clicks when game is paused. (Ie, Popup Modal)
Even if that is that problem, I'm not sure how to fix it.

What I'd like to be able to do, is to either click on an inventory item, have it appear as my cursor, then be able to click off the Inv screen off (already set up with buttons around the edges) and use the item on things in a room.

Either that, or hold the mouse down and have the verb coin appear.
I should probably make it clear I'd like to be able to do both, if possible.

If that doesn't make sense, basically I want a CMI like inv screen, where you could click and have the item as your cursor, or hold and have your verb coin appear.

Sorry for posting this so late. Thanks in advance for any help that anyone could give me.
Title: Re: The LucasArts GUI Help Thread
Post by: Scorpiorus on 10 Jun 2004, 16:02
After Skimbleshanks became unfrozen I downloaded 2ma2's VerbCoin template to look into the implementation. As the author says there is no yet support for verbcoins for the inventory items and that's one of the TODOs for the next version. Unfortunately, due to how the on_mouse_click() event function works it would require to rewrite some parts in order for the inventory verbcoin to become possible.
As for making an item appear as the active one the following modification should do the trick:

1. On the general settings pane tick: Handle inventory clicks in script

2. Put the addition code within the on_mouse_click function:

function on_mouse_click(int button) {
   // called when a mouse button is clicked. button is either LEFT or RIGHT
   if (button==RIGHTINV) RunInventoryInteraction(game.inv_activated, MODE_LOOK);
   else if (button==LEFTINV) SetActiveInventory(game.inv_activated);


   if (IsGamePaused() == 1) {
      // Game is paused, so do nothing (ie. don't allow mouse click)
   }
   else if (button==RIGHT) {
   ...
   ...
   ...
Title: Re:The LucasArts GUI Help Thread
Post by: on 11 Jun 2004, 21:03
yes, well. i'm not sure why, but like I said, i tried creating an invisble object in its place, moving it, and recreating the object on a different object number but it didn't work... I feel so confused...............          ...       ..............                ...........               ................. ....

If it is like my problem (and this one REALLY stumped me), have a look at the other hotspots you have in that room, and in particular, which ones are near the object that won't work. Do any of those hotspots/walk behinds etc go all the way to the edge of the room? That was what my problem was. For some reason, the engine just didn't like a hotspot being on any of the pixelks around the very edge of the room. It made everything near it act like a "walk to".

I hope that helps.

Well, I'm looking at it now... I have 0 hotspots in the room. 1 type of walkable area, all connected, which does touch the edge of the screen. 0 walk-behinds. 0 regions. OOps. Never mind. That is the wrong room. Haha. Yes, I do have 1 hotspot that touches the edge of the screen. WOW. THANK YOU. I know it's been a long time since you posted that message, but that's my fault for not looking. Now all I have to do is learn how to draw. And then I have a great template. And I'm making a Guybrush character using the SOMI Guybrush but putting him in his EMI clothes. That looks cool. THANK YOU!!! I LOVE YOU!!! In a non-sexual non-gay way.
Title: Re: The LucasArts GUI Help Thread
Post by: Mr Flibble on 12 Jun 2004, 19:33
Scorpius, I tried your code.
For what its worth, it worked, now I can pick up inv items under my mouse cursor.
Still 3 problems;
1. I can't use an item with a room or something in it
2. I can't use an item on another inv item
3. I still can't use the verb coin on inv items.

Can anyone fix any of these?
Should I maybe start this as a new thread to reach a wider audience?
Title: Re: The LucasArts GUI Help Thread
Post by: Edwin Xie on 13 Jun 2004, 03:34
First of all, what is a Verb Coin Template?
Title: Re: The LucasArts GUI Help Thread
Post by: Mr Flibble on 13 Jun 2004, 17:06
How simple do you want it?
Let me break it down into small sylable words.

"Verb"
Doing word, like "look" or "use"
"Coin"
Round object

Ergo "Verb Coin"
A small round object with action words on it.
This one is turned on with a mouse click, like the ones in Full Throttle and CMI.

"Template"
Refers to a game that someone has release with editor files as opensource for you to build you rgame around, to save the trouble of building your own, buggy interface.
Title: Re: The LucasArts GUI Help Thread
Post by: Scorpiorus on 15 Jun 2004, 22:04
Still 3 problems;
1. I can't use an item with a room or something in it
2. I can't use an item on another inv item
Ah, yeah, a little modification to the on_mouse_click function:

function on_mouse_click(int button) {
   // called when a mouse button is clicked. button is either LEFT or RIGHT

   if (button==RIGHTINV) RunInventoryInteraction(game.inv_activated, MODE_LOOK);
   else if (button==LEFTINV) {
      if (character[GetPlayerCharacter()].activeinv!=-1) RunInventoryInteraction(game.inv_activated, MODE_USEINV);
      else SetActiveInventory(game.inv_activated);
   }
   else if (button==LEFT) {
      if (character[GetPlayerCharacter()].activeinv!=-1) ProcessClick(mouse.x, mouse.y, MODE_USEINV);
   }
   else if (button==RIGHT) {
      if (character[GetPlayerCharacter()].activeinv!=-1) SetActiveInventory(-1);
   }


   if (IsGamePaused() == 1) {
      // Game is paused, so do nothing (ie. don't allow mouse click)
   }
   else if (button==RIGHT) {
   ...
   ...
   ...


Quote
3. I still can't use the verb coin on inv items.
That one would result in more sagnificant changes around the whole script. Maybe rewriting the whole verbcoin pop up routine.
Title: Re: The LucasArts GUI Help Thread
Post by: Estaog on 17 Jun 2004, 14:28
This is the worst problem that keeps coming up:

(http://www.2dadventure.com/ags/123.jpg)

See how the inventory is crushed in each other and how the last item is pushed out of the screen?

Any help?

Title: Re: The LucasArts GUI Help Thread
Post by: Mr Flibble on 19 Jun 2004, 17:24
Are all of the item sprites the same size?
I, of course, refer to the inventory object's sprite, not the room object.
Title: Re: The LucasArts GUI Help Thread
Post by: Estaog on 21 Jun 2004, 13:15
Never mind i fixed it
Title: Re: The LucasArts GUI Help Thread
Post by: Mr Flibble on 21 Jun 2004, 19:21
So Scorpius, it is possible to use the verb coin on the inventory, just difficult?

I'm gonna go take a crack at it, but in the mean time, does anyone else know how to do this?
Title: Re: The LucasArts GUI Help Thread
Post by: Scorpiorus on 21 Jun 2004, 22:02
So Scorpius, it is possible to use the verb coin on the inventory, just difficult?
It's not difficult but can be of some hassle since the on_mouse_click function isn't invoked on clicking on a GUI. Handling mouse clicks in script option doesn't help much since in that case the on_mouse_click is called after a mouse button was released whereas on standart LEFT and RIGHT events it's triggered when a button is pressed. So, you have to handle mouse clicks either via the repeatedly execute function or also with a help of the on_event's GUI_MDOWN event.

Quote
I'm gonna go take a crack at it, but in the mean time, does anyone else know how to do this?
Take a look in that thread for how a verbcoin working with inventory items can be implemented http://www.agsforums.com/yabb/index.php?topic=5799
Title: Re: The LucasArts GUI Help Thread
Post by: Mr Flibble on 21 Jun 2004, 22:55
Thanks Scorpius.
I'll try that, and hopefully it'll work. If not, I should be able to muddle through.
Title: Re: The LucasArts GUI Help Thread
Post by: on 25 Jun 2004, 04:15
I noticed that, when using the default AGS inventory system, when you click an item, your cursor changes to that item. However, when you draw an inventory box on a custom GUI (not unlike the traditional Lucasarts format), when you click an item, it changes to the inventory cursor (which I never use, and never liked.) How can it I make it so when I click an item in my inventory box, the cursor changes to said item?

--OftenK
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 25 Jun 2004, 18:38
in the general settings pane, on the right side there is a selection for inventory items, with two checkboxes, click the first one accordingly to what you want.
Title: Re: The LucasArts GUI Help Thread
Post by: Mr_Threepwood on 27 Jun 2004, 00:40
I searched around this site and did a glance over on general ags fan sites, trying to find a template for a lucasarts gui, since the coding looks too advanced for me to figure out at the moment.  Unfourtunitly all the links are dead so i cant find a template, does anyone know of a working link where i can get a working lucasarts template?
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 27 Jun 2004, 18:48
yes, that does seem to be a problem, and thank you for letting us know.
get it from here for now. and we'll work on fixing those links.
http://www.freewebs.com/skimbleshanks/templates.htm
Title: Re: The LucasArts GUI Help Thread
Post by: Mr_Threepwood on 28 Jun 2004, 07:14
sorry if I am asking a totally noob question, but how do u get those things to work? they are not gui files they are agt files.
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 28 Jun 2004, 14:03
Quote
does anyone know of a working link where i can get a working lucasarts template?
oh f*ck, my web space provider deleted all my .rar files  :'(

AGT files are templates, just copy them in AGS folder, start a new game, and it should appear besides the default and blank templates.
Title: Re: The LucasArts GUI Help Thread
Post by: on 29 Jun 2004, 18:57
I just found this place a few days ago and must say that I am quite thrilled to find that even I could make a game like the monkey island games of old. However, therein lies the dilema for I am a complete dumb-@$$ when it comes to programming. Not a physical defect as much as it is a mental one. So let's say I start a new game with a lucasarts style GUI, how can I get rid of everything else, like the rooms and the characters and the other unneeded sprites?  ???

Also, would it be cool if someone gave me a place to start with learning to program gui's? The one place i went to, as suggested by the site, doesn't have any of its images intact. ::)

Thank you for your help in advance.
Title: Re: The LucasArts GUI Help Thread
Post by: Mr_Threepwood on 30 Jun 2004, 02:21
I have the exact same problem as darksydeavenger, the mi2 template in on that site is great but it has a gmae already on it, and i dont know what do do.  Am i supposed to learn the programming that is needed and cut and past it to a blank game, or am i supposed to somehow delete the game on there.  I tried exporting the guis but for some reason the guis have no scripting in them so they dont work.  Its all under the global script or something.  Is there an easy way to delete all the stuff except for the guis?
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 30 Jun 2004, 09:17
just replace the things in the game with yours. The 'game' it has is meant to show examples of how the template works.
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 30 Jun 2004, 18:50
make new rooms, and delete the old ones when you are positive it wont make any impact on the game running, or you can just leave them there and not really worry about it.
Title: Re: The LucasArts GUI Help Thread
Post by: Mr_Threepwood on 30 Jun 2004, 21:02
i know how to delete the rooms and replace the char images and stuff, but in the mi2 template isnt there a lot of things in the global script that are only for that specific game.  So can i just delete those or will it mess up how it runs?
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 01 Jul 2004, 03:24
no, the functions in the global script are used by the template, so if you delete them it wont work. You can delete/replace rooms, inventory items,characters...  (an their interactions)
Title: Re: The LucasArts GUI Help Thread
Post by: on 04 Jul 2004, 02:09
I downloaded the verb coin GUI template and went through the beginners guide.  But I find when using any template but the default one, whenever i move my default character, he simply warps to the clicked location instead of walking.  What am I doing wrong here?
Title: Re: The LucasArts GUI Help Thread
Post by: Scorpiorus on 04 Jul 2004, 19:32
I know what you are talking about and must to say that's been happening since Ags2.61 came out(when you load an old game/template). I think it can be considered as a bug. For example, a test game from the snow/rain plugin behaves like that.
Title: Re: The LucasArts GUI Help Thread
Post by: monkey0506 on 07 Jul 2004, 23:09
When the player moves to an object (ie a door) in order to interact with it (ie open/close it), the player moves to the object, then to the cursor, then interacts. I.E. I tell Guybrush to open the door, and then pull the cursor away before he opens it, he walks to the door, to the cursor, and then the door opens. Well, that's about my only problem right now.
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 08 Jul 2004, 09:43
if you are using a scumm template, there is a variable at the top of the global script called "AlwaysGoToHotspots". if it is 1, thecharacter will go to wherever you click, and then do the interaction. If in the interaction you make him go to where the cursor is, then it would do what you say.
If thats your problem, you have 3 solutions:
1- set that variable to 0, and then you'll have to script all the 'go to' actions;
2- remove the script that makes the player character go to the cursor, and let the template do it;
3- if you want only that object to ignore the automatic 'go to' action, put a extension in its name, like the default action ones, but with character $ instead of >, like 'door$o'. This way, the template will act like if the variable 'AlwaysGo...' would be 0 just for this object.
(you can read the documentation that came with the template)
If thats not the problem, tell us more about it. : )
Title: Re: The LucasArts GUI Help Thread
Post by: monkey0506 on 11 Jul 2004, 08:04
I'm using the template, but I didn't add any script telling EGO to go to the cursor. I'll try doing what you said later, but right now it's 2 am and I'm on my mom's laptop, not my computer with my stuff on it. So, I'll get back to you on that one. Thanks! :!
Title: Re: The LucasArts GUI Help Thread
Post by: Melkhiore on 12 Jul 2004, 11:45
Hello there
I'm New here and i could miss it in the earlier posts, but i wanted to ask. What programs and where i can find them to ripp the images and characters from LucasArt games? I know it exist becouse once i had it but i lost it :-\. Thats all. Thank you very much
Melkhiore
Title: Re: The LucasArts GUI Help Thread
Post by: Mr Flibble on 12 Jul 2004, 18:09
You'll want scumm revisited for the bg's, and costume ripper for the sprites.

Get them here (http://scumm.mixnmojo.com/)

Although may I remind you that this thread is for AGS related questions.
Title: Re: The LucasArts GUI Help Thread
Post by: TerranRich on 12 Jul 2004, 18:15
Don't ask in this forum about ripping graphics. Read the rules. I am going to go through this thread now and weed it out.
Title: Re: The LucasArts GUI Help Thread
Post by: Konador on 15 Jul 2004, 17:35
Is there any way to turn AlwaysGoToHotspots=1; off for only a specific object.

My problem is this;
The item is on a "walk behind" object. There is walkable area behind it. When I interact with the object, the character moves to the walkable area behind, as that is closer to the object co-ords that the walkable area in front. I need to set the co-ords manually for only this object, but would like AlwaysGoToHotspots to be enabled for the rest of the objects, hotspots, and characters.

Is this possible?
Title: Re: The LucasArts GUI Help Thread
Post by: Estaog on 19 Jul 2004, 16:06
Hi there, i want to make my gui action like "use" light up when over, say for example, a button.

Thanks.
Title: Re: The LucasArts GUI Help Thread
Post by: Konador on 19 Jul 2004, 17:22
It tells you in the GUI readme. You name the object, for example:

Lever

And you put >(letter) after, with a different letter for a different command.

 >l  "look at"
 >g  "give"
 >p  "pick up"
 >u  "use"
 >o  "open" 
 >s  "push" 
 >c  "close"
 >t  "talk to"
 >y  "pull" 
Title: Re: The LucasArts GUI Help Thread
Post by: Estaog on 19 Jul 2004, 17:53
Actually it didnt say anything in the redme i have. And when i put that next to the name it it just displays it as the name.
Title: Re: The LucasArts GUI Help Thread
Post by: Konador on 19 Jul 2004, 18:33
Ah you must have downloaded a different GUI. I used the MI2 one.
Title: Re: The LucasArts GUI Help Thread
Post by: Estaog on 19 Jul 2004, 18:42
I have the MI 1 one.
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 19 Jul 2004, 20:33
Is there any way to turn AlwaysGoToHotspots=1; off for only a specific object.

My problem is this;
The item is on a "walk behind" object. There is walkable area behind it. When I interact with the object, the character moves to the walkable area behind, as that is closer to the object co-ords that the walkable area in front. I need to set the co-ords manually for only this object, but would like AlwaysGoToHotspots to be enabled for the rest of the objects, hotspots, and characters.

Is this possible?

Yes, instead of putting the extension with the character '>', put it with '$', like lever$x instead lever>x
Title: Re: The LucasArts GUI Help Thread
Post by: Konador on 23 Jul 2004, 17:59
Ahh thanks! I just looked in the script again and realised it tells me to do that, lol. I'm such a n00b!
Title: Re: The LucasArts GUI Help Thread
Post by: Konador on 24 Jul 2004, 01:53
I have another question (sorry!)

When I right click a hotspot, the "look at" command, and all others such as Use, Give, etc, display their correct message. However, when I click "look at" on the GUI and then click a hotspot, nothing happens. It works on some hotspots but not others.

Here is an example of the problem:
http://www.konador.com/aazor.zip

Try right clicking the tree. The message appears.
Try clicking "look at" and then clicking the tree. Aazor walks to the tree but nothing happens.

but

Try right clicking the lava stream. The message appears.
Try clicking "look at" and then clicking the lava strean. Aazor walks to the laza stream and the message appears.

I made these hotspots in the same way as each other.
I've tried each with and without >l and $l.
I've tried the tree hotspot with and without a walkbehind mask.
I've tried recreating the tree hotspots using a different hotspot colour/number.

Nothing seems to correct the problem and I can't think of any logical reason why the lava and volcano work, but the tree and trunk don't.

Does anyone have any idea?  ???

Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 24 Jul 2004, 10:28
Ah i see, thats a problem i never came across, but some people did. When i finish the documentation i'll release the new version of the template, and _hopefully_ it will fix those problems. If you want, you could send me the game and i'll update it to the new version, and see if the problem goes away : ).
Title: Re: The LucasArts GUI Help Thread
Post by: on 02 Aug 2004, 12:50
Well,
I have the same problem, The shortcuts with the right mouse button works fine, but when i use the GUI, it doesnt work, and i read your readme over and over again, but i overlooked it or something. Can you point out what the problem is, maybe i'll can fix it myself.
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 02 Aug 2004, 15:05
try the new template here:
http://www.agsforums.com/yabb/index.php?topic=6642.80#msg191965
and see if it happens with that one.
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 04 Aug 2004, 13:12
http://www.agsforums.com/yabb/index.php?topic=6642.msg193375#msg193375
But better use the new ones, they are less buggy.
Title: Re: The LucasArts GUI Help Thread
Post by: Mats Berglinn on 17 Aug 2004, 18:08
I have encounter a strange error when try the templates and this problem haven't happened before.

While testing them, when I try to click anywhere when the character is suppoused to walk the templates crashes with this message:

An internal error has occured. Please note down the following information.

If the problem persists, contact Chris Jones.

(ACI version 2.61.747)

Error: run_text_script1: error -1(Runtime error: wrong number of parameters to exported function 'unhanded_event') running function 'unhanded_event'

I'm using the 2.61 version. What could be wrong?
Title: Re: The LucasArts GUI Help Thread
Post by: wackojacko on 17 Aug 2004, 18:45
I used the new MI2 template and I really think it's great except for one thing. If I use this command for a character:

function character3_a() {
  // script for character3: Talk to character
if (Go()==1) //Start going to the object and if the player
   {      // does not abort do the following:
   AnimateCharacter(PIRATE, 0, 10, 1);
//Show pick up animation
   AddInventory(2); //add item #
   RunDialog(1);
   }
}

The hero will start walking to the character and if I KEEP MY CURSOR on the character it will Animate and run a dialog. BUT if I do the same and the hero starts walking towards the character and I MOVE MY CURSOR TO SOMETHING ELSE, nothing happens when the hero gets to the character! Do you know what's the problem?

I also have another error. I want to have the hero walk to a path, and when it's at specific coordinates go to an different room, so I write this:

 // script for hotspot2: Walk to hotspot
if (MovePlayerEx(34, 84, 0)==1){
NewRoomEx(4, 194, 51);
}

But if I click on the hotspot the hero will walk to the place I clicked and then he goes to the other room and he doesn't go to the coordinates fist. I tried walkto points, but that also doesn't work.
Help? anyone?
Title: Re: The LucasArts GUI Help Thread
Post by: wackojacko on 19 Aug 2004, 14:13
I have another problem, if I use the exit command for a patch in a hotspot ex:
path>eu (or el, er, ed) the character just goes to the end of the room ignoring all walkable areas! While It's supposed to take a walkable area to the end of the room (in this case the upper side). What's wrong? ???
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 19 Aug 2004, 14:29
ah, i'll try to fix that bug.
If it happens only with one thing, as a temporal walkaround, maybe you could try to not use the auto-walk thing, and script it instead, and see if it happens this way
for the exit thing, you are supposed to set the walkto point of the path hotspot very close to the screen edge where the character should disappear, so the player will go first there, and then out of the screen. It needs to ignore walkable areas in order to go out of the screen.
Title: Re: The LucasArts GUI Help Thread
Post by: wackojacko on 20 Aug 2004, 17:32
  Thanx for the message, the exit room thing now works correctly  8)

But I still have problems with talking to characters here's the problem:
I used this script for the character when you talk to him:

// script for character3: Talk to character
if (GoToCharacter(HIPPY, 2, 0, 0)==1){
ChangeCharacterView(HIPPY, 9);
RunDialog(1);
}

But when you talk to him, the hero will walk to the right of the character and then does nothing. Only when you click again it will start the conversation. So it only works if you already stand on the right of the character. otherwise it will walk to the right and then do nothing. Can you help me?!
 ???
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 20 Aug 2004, 18:04
mmm you are passing 0 as 'blocking', so the command is non-blocking.
try to set it to 2 instead, which is for semi-blocking actions:
if (GoToCharacter(HIPPY, 2, 0, 2)==1){
...
does it work this way?
Title: Re: The LucasArts GUI Help Thread
Post by: wackojacko on 21 Aug 2004, 09:22
Ofcourse! That was a really stupid question  :-\
Thanx a lot!
Title: Re: The LucasArts GUI Help Thread
Post by: on 21 Aug 2004, 19:24
i wanted to use 640x480 with your FOA-Template, but there is a big problem:

when I try to move the inventory window in MAINGUI down or I move the whole GUI down, the scroll-buttons of the inventory don't work anymore. Are there any solutions for this problem??

It happens, when I move the inventory with 320x200, too!!!
 
Title: Re: The LucasArts GUI Help Thread
Post by: wackojacko on 24 Aug 2004, 10:15
Oh yeah, one more thing. The blink views don't work in the SCUMM template, at least not in my version (v2.0c)
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 24 Aug 2004, 20:07
ge_1 , have you tried to change the constant FIRS_INV_SLOT_COORDS to the x and y coordinates of your inventory? its the only thing i can think of.
Wackojacko, for the first thing, look in the GoTo function this line:
if (locationtype==2) arrived = GoToCharacter(GSlocid,0,1,blocking);
and change it to:
if (locationtype==2) arrived = GoToCharacter(GSlocid,0,0,blocking);
this way, npcs wont face the player anymore.
the blinking view is for sierra style speech, i believe.
(but the template wouldnt have any effect on that, though)
Title: Re: The LucasArts GUI Help Thread
Post by: mousemat on 25 Aug 2004, 08:49
how do make a .gui file so i can import my guis into my game ???
sorry if this has been asked alot.
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 25 Aug 2004, 09:37
you export your current guis, and then you can re-import them as .gui files.
Title: Re: The LucasArts GUI Help Thread
Post by: mousemat on 25 Aug 2004, 09:41
it wont let me turn them into .gui files
the only options i have are

bmp
pcx
png
tga
Title: Re: The LucasArts GUI Help Thread
Post by: Gilbert on 25 Aug 2004, 10:17
Did you click the "Export GUIs" button in the GUI screen of teh editor?
Title: Re: The LucasArts GUI Help Thread
Post by: mousemat on 25 Aug 2004, 10:26
it gives me a list of empty files
Title: Re: The LucasArts GUI Help Thread
Post by: Gilbert on 25 Aug 2004, 10:50
What's the problem with empty files? Just type in the filename of GUI to save and save it.
Title: Re: The LucasArts GUI Help Thread
Post by: mousemat on 25 Aug 2004, 11:28
ok thanks
Title: Re: The LucasArts GUI Help Thread
Post by: wackojacko on 27 Aug 2004, 20:29
Hey Proskrito Thankx for the answer ;D

I still have another question: If you run a dialog topic and you can choose an option to say, ALL the animations in the room (including the background) freeze! And after you choose an option the animations continue again. Is there anyway not to freeze the animations?  ???

(I know this has nothing to do with the template, but since nobody else had an answer to my question I just try it here)

(I thought I already posted this message, but I couldn't find it anymore)
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 27 Aug 2004, 20:40
glad it helped : )
to the second question, its not related to the lucasarts gui, and you already started a thread about that : /
maybe you posted it here, and a moderator deleted it.
no need to post it twice, if its anwered, it will be in the appropiate thread more likely than here.
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 28 Aug 2004, 01:10
hmm, i merged his second posting with his old thread, so he didnt have to repost, just re-bring up an old thread, but i dont know why its not in that thread anymore, so...

and no, i dont think you can run people animations in the background while you are deciding what word to say, but theres a point to that, its as if life pauses when you are deciding what response to say, so whats your reason to wanting the animations? is it like a torch that should be flickering, i could see the wanting for that.
Title: Re: The LucasArts GUI Help Thread
Post by: wackojacko on 30 Aug 2004, 16:09
Ok Sorry for the second post, I think I have to life with that freezing thing  ;)
But has anyone an idea how to scroll in a dialog topic between the options? Like in the Monkey Island series? Like if there where too many choices you could scroll beween the choices with arrows at the left of the choices.
I used proskrito's dialog GUI but hat GUI doesn't show any scroll arrows when there are to many choices.
I hope I'm clear :D

P.s. Is there a way to change the space between the choices and the color of the text?
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 30 Aug 2004, 18:15
if you searched the forums, you would have found that that feature is not available yet, but it is hopefully coming soon
Title: Re: The LucasArts GUI Help Thread
Post by: wackojacko on 31 Aug 2004, 15:56
ok thanx

b.t.w. I did searched the forums, but i couldn't find anything, so don't think wrong about me ok :)
Title: Re: The LucasArts GUI Help Thread
Post by: He-Man on 31 Aug 2004, 16:35
hi.

I'm using Proskrito's template.

In one of my rooms I have a mirror.
The scripting uses the same method as described in this thread:

http://www.agsforums.com/yabb/index.php?topic=14370.0

The mirror effect works fine when the player character is moving around in the room. But the second the player interact with something in the room the mirror does not move along.
I been trying several things in the script and I know it's caused by the MovePlayer function, but I can't figure out the solution...
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 31 Aug 2004, 18:07
try putting the code in the function 'repeatedly_execute_always()' instead of in 'repeatedly_execute()' and see if it helps : )
EDIT: im assuming you use the second method in that thread, the first one probably wont work without more trouble
Title: Re: The LucasArts GUI Help Thread
Post by: He-Man on 01 Sep 2004, 12:47
Thanks!
It's now working and I get the newest version of AGS!
Title: Re: The LucasArts GUI Help Thread
Post by: on 18 Nov 2004, 03:22
I am using the mi 2 template by Proskrito, and I want to make a button on the title screen to load a saved game...so I drew it on the background and made a hotspot to click on. then I made it call the load game GUI.

the problem is that it loads the GUI, but not the list of saved games.
sorry if i'm too much of a newbie to figure it out...but any help would be appreciated.
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 19 Nov 2004, 09:09
first, you have to import a function, so you'll write at the top of the script of that room:

import function GetLucasSavegameListBox(int gui,int object) ;

(thats the name IIRC)
then, in the any click interaction of the hotspot, you have to write:

GetLucasSavegameListBox(RESTORE,X);//fills the lisbox X in gui RESTORE
GUIOn(RESTORE); //show the restore game gui

changing X to the listbox object number in the gui RESTORE. (i cant remember its number right now)
hope it helps : )
Title: Re: The LucasArts GUI Help Thread
Post by: on 20 Nov 2004, 22:37
Thanks, That works great.

I just replaced X with 1, and it is working fine.

Thank you for you help!
Title: Re: The LucasArts GUI Help Thread
Post by: monkey0506 on 21 Nov 2004, 15:07
Proskrito, as I've probably already mentioned 1 or 2 (thousand) times, I'm in the process of making a similar GUI for my game. But I'm having some trouble with the maps. How did you change the view while the character was on a map. I've looked at your script, but I can't find it. It doesn't say anything about it in your StartMapRoomEx function, your StartMapFunction, the room "Set Player View" option, or repeatedly execute (or from what I can see, anywhere else???). Please, enlighten me.
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 22 Nov 2004, 00:20
i did it the lazy way: i just set a low sacaling level in the walkable areas of map rooms : )
Title: Re: The LucasArts GUI Help Thread
Post by: monkey0506 on 22 Nov 2004, 02:16
You did what??? Sheesh. Lasy ... person... How am I supposed to get an idea to figure out what I'm trying to figure out how to do if you didn't previously figure it out? I'm actually using this GUI for a game I'm making, and I looked at "your" method. It wouldn't work. Oh well, I guess this is something I'll have to do for myself. (Not that I've been able to copy a lot from you, but you did help me out, without knowing it, a lot with the SAVE and LOAD GUIs). But don't worry, you'll be in the credits. One of those "And additional thanks to:" guys... =P
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 22 Nov 2004, 20:34
Proskrito didn't change Guybrush's view. He just made the walkable area have a very small percentage of a scale size. Is that what you mean?
Title: Re: The LucasArts GUI Help Thread
Post by: monkey0506 on 23 Nov 2004, 23:20
Thank you for stating the obvious...

Yeah, I knew what he meant, I just couldn't believe the sheer laziness of that method. Now I have to figure out how to set the view of any character in a room that's a map...
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 24 Nov 2004, 02:25
Still stating the obvious, then:
in the interactions menu: before room loads -> setcharView
Title: Re: The LucasArts GUI Help Thread
Post by: monkey0506 on 24 Nov 2004, 16:36
Yes, I've read the help file on that. But, would I then have to call SetCharacterView for every character in the room? Because I want to have a lot of characters in the room at the same time, like in SOMI...

Ok, nevermind. Apparently:

SetCharacterView(StringToInt(character), 4);

works... I didn't figure it would. But now for some reason I can't get Guybrush to walk around. I set up walkable areas, and for a while it was working, but then I changed something and it quit. I'll get it figured out eventually... I just never figured that the variable character would help me out like this...
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 25 Nov 2004, 14:02
im happy the templates helped you : )
If you dont like the small scale method, then the only way to do it is what scummbuddy said, im afraid.
That thing you did doesnt seem to make much sense, and it could lead to problems. StringToInt needs a string as parameter, and 'character' is one of the most used ags arrays, so if you declared a string called 'character', you could have problems later with that array, and if you didnt, you are passing an array to that function, not a string (i hope i made sense). So i think you'd rather remove that thing and follow scummbuddy advice. (who, btw, im sure wrote setcharview to abbreviate).
If you have to change several views in different places, you could make a custom function to avoid repeating code and wasting time.
Title: Re: The LucasArts GUI Help Thread
Post by: monkey0506 on 25 Nov 2004, 17:16
I'm using the array because I need for every character in the room to  be set to the same view... I initially tried SetCharacterView(character, 4), but that produced a compiling error: "String with non-string", so i just made it into an integer. It works in any case. That's all that matters. If I have to change it later I'll find a different method when that time comes.  :P And I did have it to where the characters could walk around, but I somehow managed to mess that up... And I know that he's on a walkable area, I even used a MoveToWalkableArea(... wait... I wonder... Nevermind. I think....

EDIT: Ok, now my maps work 100%. For some reason I had the label GUI for my maps set as a Popup Modal GUI, which paused the game. But I fixed that. Now then... Where was I?
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 26 Nov 2004, 14:24
well, its your game after all, but 'character' is an array, not a string, and its called with an index (like character[INDEX].room). I know nothing about scripting but seems like a wrong thing to do.
You call SetCharacterView once, and it changes the views of many characters? seems so strange. And StringToInt is for translating a string of numbers into a int, so all that does not make any sense.
i think something that would do the same that you want would be:

int i=0;
while (i < MAX_CHARS){
 SetCharacterView(i,4);
 i++;
}
and it would change the views for every character from #1 to #MAX_CHARS (change it to the last character # whose view must be changed)

but, well, its your game after all, and you always can do whatever you want.
Title: Re: The LucasArts GUI Help Thread
Post by: monkey0506 on 11 Dec 2004, 13:47
Ok... The last time I tried to explain what I think is happening, I got logged out before I finished. So, let's try this again:

I think (yes, that could be the problem), that the reason StringToInt(character) appeared to be working (which it does not), is this. character is an array, and because it's possible values are strings which relate to integer values, "character" would export string values. i.e. SetCharacterView(character[EGO], 4) would return something like "SetCharacterView(EGO, 4)", but the first parameter is a integer, not a string, so I used StringToInt. StringToInt would then convert EGO (which has a numerical value of "0") to "0". Then, it would set the character view. *Then, it would continue running the character names [EGO, GBRUSH, CHAR, ETC] through this same statement until it had changed the views of all the characters.* *Or, perhaps, since there was no value defined for character it ran it as character[0] [EDIT: That looks strange, it should be "character [ 0 ]" without the spaces...] (but would that produce a string?)* In any case, the code was faulty which I realized when I tried to put a NPC in the map room. Proskrito's code works, and although I don't like the fact that I have to manually store the maximum number of characters, but, it works...

EDIT: Just to clarify, I do know that had I used the actual values, i.e. character[EGO], it would have compiled and run correctly, and it is only because I didn't specify a character that it either ran character[ 0 ] or ran all of them and produced the integer 0.
Title: Re: The LucasArts GUI Help Thread
Post by: Scorpiorus on 15 Dec 2004, 17:49
Proskrito's code works, and although I don't like the fact that I have to manually store the maximum number of characters, but, it works...
Btw, AGS 2.62 introduced a way to get the number of characters. See a GetGameParameter function in the manual for more info.
Title: Re: The LucasArts GUI Help Thread
Post by: monkey0506 on 18 Dec 2004, 05:10
Ah... Thanks! Now I don't have to worry about updating that variable every time I make a new character!  ;D
Title: Re: The LucasArts GUI Help Thread
Post by: on 17 Jan 2005, 17:06
I have encounter a strange error when try the templates and this problem haven't happened before.

While testing them, when I try to click anywhere when the character is suppoused to walk the templates crashes with this message:

An internal error has occured. Please note down the following information.

If the problem persists, contact Chris Jones.

(ACI version 2.61.747)

Error: run_text_script1: error -1(Runtime error: wrong number of parameters to exported function 'unhanded_event') running function 'unhanded_event'

I'm using the 2.61 version. What could be wrong?

I'we got the same probleme, anyone know what i have to do ? Thx
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 17 Jan 2005, 19:17
use the new templates here: http://usuarios.lycos.es/golfapagina/templates/
Title: Re: The LucasArts GUI Help Thread
Post by: on 18 Jan 2005, 04:18
Not sure if this is QUITE the right place for this (new guy - duh!), but I'm working on a Lucas-like AG - thing is, I want it to work JUST LIKE the desktop adventures (Indiana Jones and his Desktop Adventures and/or Yoda Stories).  I've found NUMEROUS AG editors (and have been working with a few), but they're all having me work in a sideview format and I'm wanting the topview like the Lucas games.  I KNOW a desktop Adventures Editor exists, but cannot find it ANYWHERE.  If ANYONE can help - it would be SOOOO appreciated!!

Thanx!
David
Title: Re: The LucasArts GUI Help Thread
Post by: Gilbert on 18 Jan 2005, 07:14
I've never played the desktop adventures, nor do I know how they're like, but judging from what you had mentioned, they're top view with tiled backgrounds like the console RPGs right?
In that case, I think most engines capable of making such kind of RPGs should do it (like RPG Maker, or Verge (http://www.verge-rpg.com/), etc.).


That doesn't mean you can't make it with AGS with some effort though...
Title: Re: The LucasArts GUI Help Thread
Post by: Nick Dangerous on 16 Feb 2005, 11:54
It's surely possible to do this via AGS. But you'd have to program all the controls and interaction handling. For this purpose, I'd take a look at RM2k or other versions of the RPGMaker. It's intended for RPGs but fits this purpose better.
Title: Re: The LucasArts GUI Help Thread
Post by: on 29 Mar 2005, 01:15
I am using Proskito's DOTT tempelate and it works fine while I am using the program the first time, but as soon as I load my game I get a slew of scripting errors all of which seem to be undefined symbols. This renders all of my work on the game useless if I ever have to quit. Any one else have this problem? Any way to fix it?
(Sorry if this has already been asked I went through a few pages and didn't see it anywhere.)
Title: Re: The LucasArts GUI Help Thread
Post by: monkey0506 on 13 Apr 2005, 16:42
It's probable that it was compiled with an older version of AGS which is causing the problem, but you'll have to ask Proskrito on this...
Title: Re: The LucasArts GUI Help Thread
Post by: on 14 Apr 2005, 23:39
Alright thanks.
Title: Re: The LucasArts GUI Help Thread
Post by: storycatchermike on 15 Apr 2005, 20:11
Can someone possibly give me the entire code for making a lucasarts inventory? I've tried to do it, and I can't figure it out at all. Anyone think they can do that for me?
Title: Re: The LucasArts GUI Help Thread
Post by: storycatchermike on 17 Apr 2005, 02:36
Umm...since no one said anything to my last one, I'm gonna post something else. Can anyone help me with my inventory window? I got it to load up and stuff, but it is loading up on startup. How do I stop that? Also, how do I get it so you can look at and grab items? Whenever I click on an item in look or get mode, it just changes the icon. What am I doing wrong?
Title: Re: The LucasArts GUI Help Thread
Post by: Ashen on 17 Apr 2005, 02:54
I think your last question was a bit vague, which is why no-one answered. Read the GUI section of the BFAQ (http://bfaq.xylot.com/#guis), and maybe Darth mandarbs Custom Inventory thread (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=10946.0), for some pointers, then ask back if there's something specific you don't undersatnd.

1. To stop it appearing on start up, got to the GUI window, and set the 'Visible' property to 'Popup Modal'. OR, leave it set to 'Normal', and add a GUIOff() command to the game_start function, or in the Player enters screen (before fade-in) of the first room. Then, you'll need to have something (e.g. akey press, or a button on another GUI) that turns it on when you want it.

2. You probably need to set up the interactions for the different modes for each inventory item, on the Inventory' window of the editor. By default, 'Use'ing the item will set it as active, and changes the cursor graphic to reflect that.
Title: Re: The LucasArts GUI Help Thread
Post by: storycatchermike on 18 Apr 2005, 03:44
Actually, I figured out what all was wrong. Now I have another question. I'm trying to make a custom "quit" screen, but whenever I put in the script, the custom quit screen comes up anytime I push a button on the Options GUI. Anyone think they can help with that? Does anyone have a script that can keep that from happening?
Title: Re: The LucasArts GUI Help Thread
Post by: strazer on 18 Apr 2005, 04:30
Quote
Actually, I figured out what all was wrong.

Care to tell us what was wrong?

As for the quit screen, in addition to the GUI a control was clicked on, you also have to check which control it was, hence your interface_click function should look something like this:

Code: [Select]
function interface_click(int interface, int control) {

  if (interface == YOURGUI) { // if any control on that GUI was clicked
    if (control == 2) { // if control no. 2 was clicked (quit button)
      QuitGame(0); // quit game without asking
    }
  }

}

Note I have used "control" as the variable name instead of the default "button" since I like that term better.

And please, if you have basic questions such as this that are not directly related to the subject of the thread, please open a new thread in the Beginner's Forum instead of posting to the sticky threads. Thanks.
Title: Re: The LucasArts GUI Help Thread
Post by: storycatchermike on 18 Apr 2005, 16:03
Quote
Actually, I figured out what all was wrong.

Care to tell us what was wrong?

As for the quit screen, in addition to the GUI a control was clicked on, you also have to check which control it was, hence your interface_click function should look something like this:

Code: [Select]
function interface_click(int interface, int control) {

  if (interface == YOURGUI) { // if any control on that GUI was clicked
    if (control == 2) { // if control no. 2 was clicked (quit button)
      QuitGame(0); // quit game without asking
    }
  }

}

Note I have used "control" as the variable name instead of the default "button" since I like that term better.

And please, if you have basic questions such as this that are not directly related to the subject of the thread, please open a new thread in the Beginner's Forum instead of posting to the sticky threads. Thanks.

The problem that I had was that I had it set to "normal" instead of "popup Model" I do that sometimes.

Also, I dunno if that'll work, because that is extremely similar to the code I used.  What I'm trying to get it to do is come up with the main character asking if the player is sure if they want to quit or not, and then go to the GUI which has the "quit" and "play" buttons. I can't get it to switch, though, without the GUI popping up whenever I click any of the buttons. It should only come up when I click the quit button, but it comes up when I hit any of the buttons, except for restart.
Title: Re: The LucasArts GUI Help Thread
Post by: monkey0506 on 18 Apr 2005, 18:39
It sounds to me like perhaps you code wasn't just like strazers... Maybe you were trying to do something like

Code: [Select]
if (interface == GUINAME) {
  if (control == 2) {
    gGuiname.Visible = false;
    QuitGame(0);
    }
  }

But you forgot a set of braces, i.e.:

Code: [Select]
if (interface == GUINAME) {
  if (control == 2)
    gGuiname.Visible = false;
    QuitGame(0);
  }

Which would turn off the GUINAME GUI when you click on control 2, but would run QuitGame(0) no matter which control you click on...Perhaps...Or, you could try posting the code that you're actually using so we can see what's going on...
Title: Re: The LucasArts GUI Help Thread
Post by: storycatchermike on 20 Apr 2005, 16:52
I hate to say it...but that made no sense...
Code: [Select]
   if (interface == OPTIONS) {
    if (button == 5) SetGameSpeed(GetSliderValue(2,5));
    if (button == 13) SetMusicMasterVolume(GetSliderValue(2,13));
    if (button == 10) SetSpeechVolume(GetSliderValue(2,10));
    if (button == 4) SetSoundVolume(GetSliderValue(2,4));
    if (button == 0) SaveGameDialog();
    if (button == 1) RestoreGameDialog();
    if (button == 2) RestartGame();
    if (button == 3) QuitGame(1);
    if (button == 8) Display("Game by Knights Creations with use of AGS. AGS copyright of Chris Jones.");
    if (button == 9) {
      GUIOn(1);
      GUIOff(2);
    }
    if (button == 3) DisplaySpeech(EGO, "Art thou shure thou wishes to quit?"; {
      GUIOn(5);
      GUIOff(2);
       }
    }
That's my entire options menu.
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 20 Apr 2005, 22:09
You do have a problem with braces here, and a missing closing parentheses:
 
 Â  if (button == 3)
   { DisplaySpeech(EGO, "Art thou shure thou wishes to quit?");
      GUIOn(5);
      GUIOff(2);
       }
Title: Re: The LucasArts GUI Help Thread
Post by: monkey0506 on 20 Apr 2005, 22:16
You do have a problem with braces here, and a missing closing parentheses:
 
   if (button == 3)
   { DisplaySpeech(EGO, "Art thou shure thou wishes to quit?");
      GUIOn(5);
      GUIOff(2);
       }


Edit:  Thank you for saying exactly what I just said, only with using his script instead of the pseudo code...

Edit:  Oh...I just realized I wrote my pseudo code in 2.7 syntax instead of the old-style code.  Which would be why it made no sense to him...My mistake mike, the code I used utilizes the syntax of the yet to be released (still in BETA) AGS 2.7...
Title: Re: The LucasArts GUI Help Thread
Post by: storycatchermike on 23 Apr 2005, 22:32
oops...forgot to put that in when I typed it out...it still isn't working v.v
Title: Re: The LucasArts GUI Help Thread
Post by: =The=Brat= on 26 Apr 2005, 10:36
look im gonna be laisy. has anyone talked about a CMI styled GUI and if there has been talk on this then wat was the final result.

sorry, to many pages to look through
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 26 Apr 2005, 17:11
I hope browsing this link isnt too much of an inconvienence for you. http://www.freewebs.com/skimbleshanks/templatesandmodules.htm

Seriously, If you are too lazy to use our search function, what makes you think you are willing to code, and why should we help you?
Title: Re: The LucasArts GUI Help Thread
Post by: =The=Brat= on 27 Apr 2005, 08:49
sorry i forgot all about the search function
Title: Re: The LucasArts GUI Help Thread
Post by: Gilbert on 27 Apr 2005, 11:06
At least the search function is disabled for the time being. :=
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 27 Apr 2005, 15:26
you win this round, brat. but ill get you. you and your little brat-dog too.
Title: Re: The LucasArts GUI Help Thread
Post by: on 06 May 2005, 09:40
Hey there.

I got a very specific problem with one of Proskritos (btw: fantastic) templates, the FOA template. I modified a lot, and it all worked out well, but now there is one thing I don't get.

Whenever I you use the "Close"-Button it will work for one time, displaying "SchlieàŸe (whatever)" in the Action Bar and the default Message. But only for one time.

I replaced the standard font with a font that features German characters, so that's not the problem. I just don't get why it works just one time, and then does not display the Mode in the action bar anymore, no matter how often you klick it. All other modes work fine.

Is it something about the cursor modes? I messed around a bit with them, I still haven't gotten behind, why "Close, Open, Push, Pull" have got the same cursor mode. Can somebody explain that to me?

Thanks in advance, I would have browsed the forums for an answer, but the search was disabled.
Title: Re: The LucasArts GUI Help Thread
Post by: Mats Berglinn on 21 May 2005, 07:33
I've started to play around with the templates in the 2.7 version of AGS but when I try to test them I get this message:

There was an error compiling your script. The problem was:
In: 'Global script'

Error (line 221): 'gui' is a global var; cannot use as name for local.

This happens in both MI2 template and FOA template. What's actually wrong? How do I fix this? Does somebody know?

EDIT: The problem IS the same in the DOTT template too.
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 21 May 2005, 22:36
youll need to find and replace all those names which are now reserved for the engine with another, such as gooey, or something similar as for you to understand what you mean it to be.

These templates are not updated to work with the recent version of AGS 2.7, so using them is not suggested, with that version. Feel free to use them with the version they were compiled with, since I believe I have read that Proskrito has done all the updating he wishes to do with those templates. If I ever get any free time, I was considering doing an overhaul on them to work with the recent release, but don't wait up for me.
Title: Re: The LucasArts GUI Help Thread
Post by: RickJ on 22 May 2005, 22:30
I'm in the process updating the demo to be V2.7 compliant.  I am about to begin work on the LEC GUI room and I wonder if it would be better to abandon the previous LEC gui example in favor of a template?  Rui has recommended any of Proskritos templates for this purpose.   What do you guy over here think?
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 22 May 2005, 22:47
the only one with a well rounded working template would be monkey_05_06, and if I remember right, he won't be releasing it until after his game is released.

Perhaps just a simple room with the GUI would be nice, a way to get people into thinking in that GUI way, but perhaps just leave the real GUI to a template, either one that I, Proskrito, or monkey0506 creates in the future. Or LucasFan may have one that we could use.
Title: Re: The LucasArts GUI Help Thread
Post by: monkey0506 on 23 May 2005, 01:54
The idea of making the template has been dropped due to harassment, but in this case I may pick it back up.  The main difference between my template that I was working on and Proskrito's template was that mine was in SOMI-style and his was in LCR-style.  And mine was/will have a dialog system (which will utilized the SM I'm working on, DlgScroll) but there is a lot of problems with trying to get the dialog system working at the moment.  Basically trying to provide multiline option support is causing me a lot of grief with:

1.  Highlighting the correct dialog option (completely).
2.  Running the correct scripts when a multiline option is chosen.
3.  Scrolling multiline options correctly (line-by-line instead of option-by-option, i.e., showing the second half of an option if you scrolled up past the first...).

Other than that I could have released the SM already and begun converting my template (which I will now release) to 2.7 OO scripting.
Title: Re: The LucasArts GUI Help Thread
Post by: RickJ on 23 May 2005, 03:10
I'm implementing the GUI and Arcade examples as  mini-games.  That is they are one room stand-alone games that are called from the main demo using RunAGSGame() in conjunction with the, not yet released, MiniGame script module.   One of the unused doors in the "Hall of Guis" now has a control panel that lists  any mini-game GUI examples in the demo's Compiled folder and named _DQGxxx-V000.exe (xxx=name, 000=version number). 

It's fairly easy to add additional examples, just import the MiniGame module and add a custom ExitGame() function consisting of about 10 lines of script, give it the proper name (i.e. _DQGxxx-V000.exe) and copy it t the DemoQuest compiled folder.  So, monkey, when you're ready I can show you what to do. 

In the mean time I may try out one of Proskrito's templates to  and see  if I can get the DQ example room to work with it.  If not I'll just strip out the old DQII LEC GUI  and use that.
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on 25 May 2005, 09:56
if you need any help with the template or could i help with anything, just tell me : )
Title: Re: The LucasArts GUI Help Thread
Post by: RickJ on 30 May 2005, 04:14
Proskrito,

Thanks for your kind offer but you have already helped me ;).  I used the fonts and graphics from your DoTT template to remake the old DemoQuest Lec example.   I couldn't use the DoTT template because it used 16 bit color.   I dumped your GUI sprtes, reduced their color depth, and reincarnated them into a simple mini game example.  You can get it here.

DQGLEC-V000-B01.ZIP (http://www.gaia-spa.com/project/ags/games/DQGLEC-V000-B01.ZIP)

Please feel free to review or make any impovements you wish and I will be happy to include those in with the new DemoQuest version.

Cheers
Title: GUI Inventory: Left click on inventory item to use it with
Post by: on 07 Jun 2005, 08:16
      I want to make one LEFT CLICK on INVENTORY ITEM to getcursor appareance of this item and use it with. My inventory is on SCUMM alike guide.

      I've tried on scripts sections "on_mouse_click" in several ways but doesn't work. I suppose I did it wrong. I will be all-granted if anyone puts here the entire code for this. Thank U!!
Title: coin
Post by: Theme on 07 Jun 2005, 23:23
How do i make a coin appear then to get the option like in moneky island 3 or fullthrottle?
im noob in ags

o/
Title: Re: The LucasArts GUI Help Thread
Post by: monkey0506 on 09 Jun 2005, 19:28
I believe that the new demo game has a verb coin example.  If it doesn't then if you look at Rui's website, I'm sure he has some VC templates.

Edit:  Kachicho, if you're using 2.62, try:

if (button == LEFTINV) {
  int invAt = GetInvAt(mouse.x, mouse.y);
  if (invAt != -1) {
    ChangeCursorGraphic(MODE_INVPIC, GetInvGraphic(invAt));
    SetMouseCursor(MODE_INVPIC);
    }
  }

Or for 2.7 it would be:

if (button == eMouseLeftInv) {
  Inventory* invAt = Inventory.GetAtScreen(mouse.x, mouse.y);
  if (invAt != null) {
    mouse.ChangeModeGraphic(eModeInvpic, invAt.Graphic);
    mouse.UseModeGraphic(eModeInvpic);
    }
  }

Just create a new cursor called INVPIC, and the code should work.  Alternately I believe there is a checkbox in the game editor under Game settings -> Inventory that says "Don't use inventory graphics as cursors".  If that's not checked then it should do the same thing without having to create a new cursor.
Title: Re: The LucasArts GUI Help Thread
Post by: strazer on 17 Jun 2005, 13:18
I believe that the new demo game has a verb coin example.  If it doesn't then if you look at Rui's website, I'm sure he has some VC templates.

That website is here (http://www.freewebs.com/skimbleshanks/), btw.
Title: Re: The LucasArts GUI Help Thread
Post by: Theme on 17 Jun 2005, 15:07
i made my coin already
it works fine
here the code:


// main global script file

int lock =0, lock2 = 0, guicoinmouseclickx = 0, guicoinmouseclicky = 0;
int lockguibuttonlook = 0, lockguibuttonuse = 0, lockguibuttontalk = 0;

#sectionstart repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute()
  {
  // put anything you want to happen every game cycle here     
  if(mouse.IsButtonDown(eMouseRight)==1)
     {      
     if(GUIControl.GetAtScreenXY(mouse.x, mouse.y)==GUIButtonLook)   
      {
      if(lockguibuttonlook==0) GUIButtonLook.Animate(3,0,5,eOnce);
      lockguibuttonlook=1;
      }
     else { GUIButtonLook.NormalGraphic = 6;   lockguibuttonlook=0; }
      
     if(GUIControl.GetAtScreenXY(mouse.x, mouse.y)==GUIButtonUse)
      {
      if(lockguibuttonuse==0) GUIButtonUse.Animate(5,0,5,eOnce);
      lockguibuttonuse=1;
      }
     else { GUIButtonUse.NormalGraphic = 12; lockguibuttonuse=0; }
         
     if(GUIControl.GetAtScreenXY(mouse.x, mouse.y)==GUIButtonTalk)
      {
      if(lockguibuttontalk==0) GUIButtonTalk.Animate(4,0,5,eOnce);
      lockguibuttontalk=1;
      }
     else { GUIButtonTalk.NormalGraphic = 9; lockguibuttontalk=0; }
    
    if(lock2==0)
      {
      lock2=1; 
      if((Character.GetAtScreenXY(mouse.x,mouse.y)!=null || Object.GetAtScreenXY(mouse.x,mouse.y)!=null || Hotspot.GetAtScreenXY(mouse.x,mouse.y)!=hotspot[0]))
     {
    guicoinmouseclickx = mouse.x;
    guicoinmouseclicky = mouse.y;
      if(lock==0)
      {
      PlaySound(0); 
      Wait(10);
      gCoingui.Visible = true;      
    if(mouse.x <= 160 && mouse.y <= 120) gCoingui.SetPosition(mouse.x,mouse.y);
    if(mouse.x <= 160 && mouse.y > 120) gCoingui.SetPosition(mouse.x,mouse.y-40);
    if(mouse.x > 160 && mouse.y <= 120) gCoingui.SetPosition(mouse.x-40,mouse.y);
    if(mouse.x > 160 && mouse.y > 120) gCoingui.SetPosition(mouse.x-40,mouse.y-40);
    lock=1;
    }
       
    }

      }
       
    }
   else
   {
   if(GUIControl.GetAtScreenXY(mouse.x, mouse.y)==GUIButtonLook)   mouse.Mode = eModeLookat;
   //GUIButtonLook.NormalGraphic = 6;
   if(GUIControl.GetAtScreenXY(mouse.x, mouse.y)==GUIButtonUse) mouse.Mode = eModeInteract;
   //GUIButtonUse.NormalGraphic = 12;
   if(GUIControl.GetAtScreenXY(mouse.x, mouse.y)==GUIButtonTalk) mouse.Mode = eModeTalkto;
   //GUIButtonTalk.NormalGraphic = 9;
   
   gCoingui.Visible = false;   
   if(lock==1 && mouse.Mode != eModeWalkto) ProcessClick(guicoinmouseclickx,guicoinmouseclicky,mouse.Mode);
   lock = 0;
   lock2 = 0;
   mouse.Mode = 0;
   }      

  }
#sectionend repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE




if u wanna use it, u just have to adjust the code for your gui and etc
in my game u cant change the mouse mode so u have mouse setted to walk all the time



#sectionstart on_mouse_click  // DO NOT EDIT OR REMOVE THIS LINE
function on_mouse_click(MouseButton button) // called when a mouse button is clicked. button is either LEFT or RIGHT
  {
  if (IsGamePaused() == 1) // Game is paused, so do nothing (ie. don't allow mouse click)
    {
    }
  else if (button == eMouseLeft)
    {
    ProcessClick(mouse.x,mouse.y, mouse.Mode);
    }
  else // right-click, so cycle cursor
    {
      
    }
  }
#sectionend on_mouse_click  // DO NOT EDIT OR REMOVE THIS LINE



thats it, im to lazy to make //coments

o/
Title: Re: The LucasArts GUI Help Thread
Post by: Mats Berglinn on 17 Jun 2005, 21:11
I hope that the new verb coins do have inventory screens which can be interacted by the verb coin unlike the MI3 Verb Coin that is on Rui's page (plus that it's statusline shows the names of the inventory items which doesn't appear in the MI3 Verb Coin as well).

I've got a question about the the SCUMM templates (the Verb boxes not the Verb Coin): Whenever you look at, talk to or using other commandos on a character, they always turn around to face the character. How do you make so that they don't turn around to face the player character (it's pretty useless in situations were characters doesn't bother to look at you when you look at them or when you're suppoused to not to be seen by them)?
Title: Re: The LucasArts GUI Help Thread
Post by: Theme on 17 Jun 2005, 22:54
here the thing i read at the help file:

GetAtScreenXY (inventory)
(Formerly known as global function GetInvAt, which is now obsolete)

static InventoryItem* InventoryItem.GetAtScreenXY(int x, int y)

Returns the inventory item at SCREEN co-ordinates (X,Y). Note that this only detects inventory items on custom Inventory windows (that are switched on when this function is called), and is intended to allow you to do Verb Coin style GUIs and so on.


so if u put that in my script u can do like monkey island in fact ill going to add that later

o/
Title: Re: The LucasArts GUI Help Thread
Post by: on 20 Jun 2005, 09:04
This will sound a stupid question, but I downloaded AGS recently, and immediately found the Sierra interface was the default.   I would prefer the Monkey Island/Day of the Tentacle interface.   I followed the link at the start of this thread to try and get the GUI needed.   I was surprised, when I got through to what appeared to be the right page - I recieved a 'You are not authorized to view this page type message'.   Unfazed, I shot back a directory or two, and found the site to be written in what I presume to be German?   

Does anyone know of somewhere I can get the LucasArts Gui for AGS - with the site in english?  I havent yet found one in google, and I am too new to this to have the experience to know if im looking at the right things.   I'll post back here if I solve my dilemma before I get a response.

Many thanks.
Title: Re: The LucasArts GUI Help Thread
Post by: strazer on 20 Jun 2005, 11:04
http://www.freewebs.com/skimbleshanks/
Title: Re: The LucasArts GUI Help Thread
Post by: Lazarus on 01 Jul 2005, 11:16
Hi i'm having problems with the Proskrito's MI2 templatev2.0c working with ags version 2.7, i've renamed the gui,objects and hotspots which is ok.

The problem i have is now with line 445:
Function declaration has wrong number of arguments to prototype.

"function GoToCharacterEx(int charidwhogoes, int charidtogo, int direction, int xoffset, int yoffset, int NPCfacesplayer, int blocking){"

following Gilbot V7000a advice i found in the script header it was referring to

46: import function GoToCharacterEx(int charid, int direction, int xoffset, int yoffset, int NPCfacesplayer, int blocking);
47: import function GoToCharacter(int charid, int direction, int NPCfacesplayer, int blocking);

Any help would be grateful
Thanks in advance

Ps My first post i placed in the wrong thread by mistake as i had both opened
Title: Re: The LucasArts GUI Help Thread
Post by: Gilbert on 04 Jul 2005, 02:37
Yeah, after counting you'll see in the function's declaration line there're 7 parameters, but the one in the header has only 6, so just change the header one to:
import function GoToCharacterEx(int charid, int chartofollow, int direction, int xoffset, int yoffset, int NPCfacesplayer, int blocking);

Also, the original posting is here (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=6642.msg263695#msg263695).
Title: Re: The LucasArts GUI Help Thread
Post by: Lazarus on 04 Jul 2005, 08:36
Many many thanks the template works a treat. ;D

What i'd like to know is how "int chartofollow" works as there is no direct reference in the function?

Thanks again
Title: Re: The LucasArts GUI Help Thread
Post by: Gilbert on 04 Jul 2005, 08:51
If it's really not used, you can safely remove it in all the appearances of this function, just make sure you do this to all of them so their numbers of parameters match.

I'm too lazy to download the template to check with their original codes, but I guess it's possibly codes copied from other functions that they somehow forgot to remove it in some of the places (also it's possible that it was made for earlier versions of AGS, which didn't check this kind of errors, but if you put in in V2.7 these flaws will be revealed).
Title: Re: The LucasArts GUI Help Thread
Post by: Lazarus on 08 Jul 2005, 12:12
I had another look at the global script for the "int chartofollow" and i didn't find any other reference,
but what i did notice was that in the function there was "int charidtogo"

and i was wondering if placing this in the script header instead, as this was missing?


function GoToCharacterEx(int charidwhogoes, int charidtogo, int direction, int xoffset, int yoffset, int NPCfacesplayer, int blocking){
  //Goes to a character staying at the side defined by 'direction': 1 up, 2 right, 3 down, 4 left
  //and it stays at xoffset or yofsset from the character. NPCfacesplayer self-explained. ;)
  // blocking: 0=non-blocking; 1=blocking; 2=semi-blocking.
  // returns 1 if player arrived.
  int playerchar,charidx,charidy,playerx,playery;
  if (charidwhogoes!=GetPlayerCharacter() && blocking==2) blocking=0;//npcs cant perform semi-blocking actions
  playerchar=charidwhogoes;
  charidx=character[charidtogo].x;
  charidy=character[charidtogo].y;
  playerx=character[playerchar].x;
  playery=character[playerchar].y;
      int arrived = 1;
      if ((Offset (playerx, charidx) > xoffset) || (Offset (playery, charidy) > yoffset)){
        if (direction==0){ // shortest way.
          if (Offset(charidx,playerx)>=Offset(charidy,playery)){ // left or right
            if (playerx>=charidx) direction=2; //right
            else direction=4; //left
          }
          else{
            if (playery>=charidy) direction=3; //down
            else direction=1;
          }
        }
        // calculate target position
        if (direction==1) charidy-=yoffset;
        else if (direction==2) charidx+=xoffset;
        else if (direction==3) charidy+=yoffset;
        else if (direction==4) charidx-=xoffset;
        // move character
        if (blocking==0){
          MoveCharacter(playerchar,charidx,charidy);
          arrived = 0;
        }
        else if (blocking==1){
          MoveCharacterBlocking(playerchar,charidx,charidy,0);
          arrived = 1;
        }
        else if (blocking==2) arrived = MovePlayer(charidx,charidy);
      }
      if (arrived > 0){
        // characters only face each other after the moving character arrived at the target point
        if (NPCfacesplayer==1)  FaceCharacter(charidtogo, playerchar);
        FaceCharacter(playerchar, charidtogo);
      }
      return arrived;
}


Title: Re: The LucasArts GUI Help Thread
Post by: Gilbert on 09 Jul 2005, 02:49
Actually, judging from the position of the parameter, chartofollow is just chartogo in the function's declaration. Since it's used in the body of the function you can't remove it.
The names of the parameters used in "import functio(...)" are not important, as long as the number of parameters and their types match, you can even leave out the variable names for the "import" line in the header (no, I meant header only, you must provide names for the variables in the function code), like this:

import function GoToCharacterEx(int, int, int, int, int, int, int);

But then the code would be quite hard to read, you can of course change the parameter names in the header import line to match the one used in the function itself for more readibility, like for example:

import function GoToCharacterEx(int charidwhogoes, int charidtogo, int direction, int xoffset, int yoffset, int NPCfacesplayer, int blocking);

But that's not mandatory.
Title: Re: The LucasArts GUI Help Thread
Post by: Mats Berglinn on 11 Jul 2005, 14:06
For Caribbean Mysteries I'm using the MI2 SCUMM Template and I've encountered a strange problem:

At one point you'll need to steal a pendlum from an old man when he doesn't see that. You can trick him by putting a coin on the ground, calling the man's attention to the coin and meanwhile you take the pendlum. About ten sceonds later he will pick up the coin and return to his place.
The thing does work but there's something wrong too:

When I use the coin with the old man, the main character goes to him, the old man turns to him, then he goes to the spot where he drops the coin, stay at that spot and gets the guy's attention.

What the main character is suppoused to do is: 1) Go to the spot to drop a coin 2) Go to next to where the old man is. 3) Calling the old guy's attention toward the coin 4) Therefore the old guy turns toward the coin and walk to it. 5) The rest of the coin thing.

Code: [Select]
  // script for character14: Use inventory on character
MoveCharacter(EGO,600,265);
FaceLocation(EGO,600,265);
ObjectOn(3);
Wait(100);
MoveCharacter(EGO,815,265);
FaceLocation(EGO,600,265);
Wait(80);
DisplaySpeech(EGO,"Say, isn't that a coin lying on the ground?");
DisplaySpeech(HYP,"A coin? Where?");
FaceLocation(HYP,798,265);
DisplaySpeech(HYP,"Ah, there!");
MoveCharacter(HYP,798,260);
FaceLocation(HYP,600,260);
Wait(40);
int timer=0;
distract = 1;
SetTimer(1,400);

  // script for room: Repeatedly execute

if (IsTimerExpired(1)==1){
distract = 0;
ObjectOff(3);
DisplaySpeech(HYP,"Must be my lucky day."); 
MoveCharacter(HYP,900,280);

if (GetGlobalInt(11) ==1){
MoveCharacter(HYP,930,280);
Wait(40);
DisplaySpeech(HYP,"Hey, where did my pendlum go?");
}
}

Does someone know what's the problem? How do I solve this? Please help!

EDIT: Never mind, I've found the answer.
Title: Re: The LucasArts GUI Help Thread
Post by: Lazarus on 14 Jul 2005, 08:49
I'm not sure if i should be posting this here so feel free to move if not.  ;D

I can script all the buttons on the inventry (MI2 Template) ie Push, Pull etc..

The problem i have is that say i have 1 hotspot (say a rock) and 1 object (say a stick) in a room, what i would like to happen is that the player has to push the hotspot(rock) then displaying "the rock has moved abit " then allowing the player to pickup the object(stick) is this possible?

And if it is possible, then could you please help

I'm using ags version 2.7

thanks inadvance.
Title: Re: The LucasArts GUI Help Thread
Post by: BernieLaraemie on 20 Jul 2005, 07:11
I think your best bet is Global Ints and some if statements.

In game start, type:

SetGlobalInt (1, 0);

And in the rock's interaction editor, set "push" to run script, which will say:

Display("The rock has moved a bit.");
SetGlobalInt (1, 1);

ANd for the interaction editor for "pick up stick" set "run script" and type

if (getglobalint(1) == 0) display("Sorry, you can't get that!");
else [give player inventory]

I hope that works :)

~~Bernie
Title: Re: The LucasArts GUI Help Thread
Post by: Lazarus on 20 Jul 2005, 08:50
Thanks for the reply I will certainly have ago that.

My other problem i've got is that using MI2 template I have, is that when I select another chacter on screen and the "Talk To" is highlighted and I use either the GUI button or using the right button to activate the conversation is that it doesn't work first time, I've got to press the buttons acouple of times before it works.

Any help or ideas would be grateful
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 21 Jul 2005, 14:14
To be honest, I've had that problem to with my game, Pester Quest. It isn't all that noticable, I hope, and I don't really know where the problem stems from. It doesn't happen all the time, but it may have to do with that character in the middle of an idle animation, but I'm not so sure.
-----------
And while I'm here, I think that Proskritos templates should not just be for download to anyone, but to only users of 2.62, or whatever the last version they were compiled with, since with the newer ags updates, there are conversion problems.

Until I, or others can make a template for the newest versions of ags, I would suggest to everyone to not upgrade their ags, and use an older version.
Title: Re: The LucasArts GUI Help Thread
Post by: Lazarus on 22 Jul 2005, 09:55
I've seem to have found away around my problem, in that by using ">td" (talk don't go) at the end of the characters name in the main character profile.
eg... guybrush>td

and then if I want to talk to the character I manually put move player command to the character in question before talking to them and so far it works every time with no problems.

I think the problem is with "always goto hotspot" and "clickable chacters" in the global script, but I could be wrong tho.

but by using the >td command the problem goes, and using the ">td" doesn't show up in the game if this is any help
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 22 Jul 2005, 18:48
Thanks for fiddling with it, and finding a possible solution. I will also give it a try and let you know. I appreciate the work you did.
Title: Re: The LucasArts GUI Help Thread
Post by: on 26 Jul 2005, 20:45
ok can anyone give me a link for a lucasarts monkey island 2 GUI that actually works as most links around here are 404. Also can i have a link fora tutorial or read me on installing the thing.
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on 26 Jul 2005, 22:53
http://www.freewebs.com/skimbleshanks/templatesandmodules.htm

Just unzip the file, and place it all in your ags directory. When you create a new game, the new template choice should appear.
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: on 27 Jul 2005, 00:18
hmmm
when i go to the GUI bit then click import the extension on the end of the mi2 is .agt and not .gui
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: Ashen on 27 Jul 2005, 00:24
That's because it's a game template, not a GUI. You'll have to start a new game using that template (as Scummy just said) to get at the GUI - you can always export it from there if you want to use it in a game you've already started, but keep in mind there's probably some related scripting you'll need to copy over as well.
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: on 27 Jul 2005, 01:29
o my, the MI2 gui is in german, i would like an english one if its possible
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: Scummbuddy on 27 Jul 2005, 03:06
Download a different one from that site.
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: Mats Berglinn on 27 Jul 2005, 14:03
I'm trying to make some doors like in Secret of Monkey Island and Day of the Tentacle by using a hotspot area for the open door and a object for the closed one. The problem is that if you use the Any click commando it will affect the other commands, like if you try to use close the door Hotspot then it doesn't only close the door but it will transport to other room as well. That's not suppoused to happen. I'll show an example of that:

Code: [Select]
  // script for hotspot1: Any click on hotspot
NewRoomEx(4,74, 115); 

if (UsedMode(CLOSE)){
   if (GetPlayerCharacter() == BERN){
     MoveCharacterToObject(BERN,1);
     }
   if (GetPlayerCharacter() == LAVE){
     MoveCharacterToObject(LAVE,1);
     }
   if (GetPlayerCharacter() == HOAG){
     MoveCharacterToObject(HOAG,1);
     }
PlaySound(30);
ObjectOn(1); 
DisableHotspot(1);
}
if (UsedMode(OPEN)) Display("It's already open."); 

Does somebody know what's wrong and how to deal with it?
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: Ashen on 27 Jul 2005, 15:16
You need to limit the NewRoom commands to running when a mode other OPEN or CLOSE is used. Try:
Code: [Select]
if (UsedMode(CLOSE)){
   if (GetPlayerCharacter() == BERN){
     MoveCharacterToObject(BERN,1);
     }
   if (GetPlayerCharacter() == LAVE){
     MoveCharacterToObject(LAVE,1);
     }
   if (GetPlayerCharacter() == HOAG){
     MoveCharacterToObject(HOAG,1);
     }
  PlaySound(30);
  ObjectOn(1);
  DisableHotspot(1);
}

else if (UsedMode(OPEN)) Display("It's already open."); 

else NewRoomEx(4,74, 115);

Also, couldn't you condense the 'CLOSE' condition to:
Code: [Select]
if (UsedMode(CLOSE)){
  MoveCharacterToObject(GetPlayerCharacter(),1);
  PlaySound(30);
  ObjectOn(1);
  DisableHotspot(1);
}
instead of those if.. statements, since it does the same whichever character you're using.
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: on 28 Jul 2005, 20:15
Hello! I'd like to know if it is possible to change the distance between the objects you have picked up, when they appear in the menu, so i can make bigger icons that don't overlap. thanks!
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: monkey0506 on 28 Jul 2005, 21:20
Hello! I'd like to know if it is possible to change the distance between the objects you have picked up, when they appear in the menu, so i can make bigger icons that don't overlap. thanks!

I think if you search the manual for SetInvDimensions you will find what you are looking for.  I don't know the parameters because I don't have a 2.62 manual available ATM.
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: Mats Berglinn on 14 Aug 2005, 19:59
I've some big problems here! Since my game have backgrounds that covers the whole screen unlike the old Lucas Arts games I had set the GUI so there are no black space. Since the Inventory window gets in the way for most walkable areas I had to get rid of the Inventory window from the Main GUI and instead make it into a new GUI. Now there's a strange problem: I have placed a new button in the Main GUI which activates the Inventory GUI (that's working). Now in the Inventory GUI there are three buttons: Arrow Up, Arrow Down and Close Down Inventory window. When I try to press the Close Down button nothing happens even if I scripted it to do so and when I open the Options GUI and then tries to Play, Load, Save or Quit, none of the functions works!

I've tried to check the script and doing changes but it keeps getting on like this. I don't understand what's wrong!!

Can you guys see what's wrong and can you tell me how it can be fixed? Please help me, I'm so desperate that I don't know what I'm going to do and it drives me crazy!  :'(

I'll show the whole script:

Code: [Select]

  }
//-----------------------------------------------------

// change the arrows in the inventory to
// show if you can scroll the inventory:
//-----------------------------------------------------
  if (game.top_inv_item > 0){     //if invent. can scroll up
    SetButtonPic(INVENTORY,0,1,INV_UP_ARROW_ON_SPRITE);
    if (GetInvAt(FIRST_INV_SLOT_COORDS) < 0)//if no items shown in the inventory
       game.top_inv_item = game.top_inv_item - (game.num_inv_displayed/2 ); //scroll inventory up
  }
  else //if can not scroll up
    SetButtonPic(INVENTORY,0,1,INV_UP_ARROW_OFF_SPRITE);   
  if (game.top_inv_item < game.num_inv_items - game.num_inv_displayed)   //if invent. can scroll down
    SetButtonPic(INVENTORY,1,1,INV_DOWN_ARROW_ON_SPRITE); 
  else  // if can not scroll down
    SetButtonPic(INVENTORY,1,1,INV_DOWN_ARROW_OFF_SPRITE);
//-----------------------------------------------------
}
#sectionend repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart on_mouse_click  // DO NOT EDIT OR REMOVE THIS LINE
function on_mouse_click(int button) {////////////////////////////////////On Mouse Click///////////////On Mouse Click
  // called when a mouse button is clicked. button is either LEFT or RIGHT
 
// Store type, name and id# of what the player clicked
// on in global variables GSloctype,GSlocname & GSlocid:
//-----------------------------------------------------
 int mrx=mouse.x+GetViewportX(), mry=mouse.y+GetViewportY();
 GSloctype=GetLocationType(mouse.x,mouse.y);
 if (GSloctype==1) GSlocid=GetHotspotAt(mouse.x,mouse.y);
 else if (GSloctype==2) GSlocid=GetCharacterAt(mouse.x,mouse.y);
 else if (GSloctype==3) GSlocid=GetObjectAt(mouse.x,mouse.y);
 else if (GetInvAt(mouse.x, mouse.y)>=0) GSlocid=GetInvAt(mouse.x, mouse.y);
 GetLocationName(mouse.x,mouse.y,GSlocname);
//-----------------------------------------------------

 if (IsGamePaused() == 1) {
    // Game is paused, so do nothing (ie. don't allow mouse click)
  }

// Handling clicks in map rooms:
//-----------------------------------------------------
  else if (IsGUIOn(MAPS)==1){// if map
    if (button==LEFT){
      if (IsInteractionAvailable(mouse.x,mouse.y,MODE_USE)) ProcessClick(mouse.x,mouse.y,MODE_USE);
      else ProcessClick(mouse.x,mouse.y,MODE_WALK);
    }
  }//end if map
//-----------------------------------------------------

// Handling room clicks:
//-----------------------------------------------------
  else if (button==LEFT || button==RIGHT) {
   
    if (button==RIGHT) SetMode(GetDefaultAction(mouse.x,mouse.y));// set the default mode when right click
   
    if (Extension(GSlocname)==EXITS_EXTENSION){// if its an 'exit'
        HighlightActionBar();
        WalkOffScreen();
    }
    else if (ALWAYS_GO_TO_HOTSPOTS==1 && ExtensionEx(2,GSlocname)!='d' && GetLocationType(mouse.x,mouse.y)!=0 ){
       UpdateActionBar(mrx,mry);
       HighlightActionBar();
       if (Go()==1)   ProcessAction(GSmode,mrx,mry);
       return;
    }
    else ProcessAction(GSmode,mrx,mry);
  }
//-----------------------------------------------------

// Handling inventory clicks:
//-----------------------------------------------------
  else if (button == LEFTINV || button==RIGHTINV){//click in inventory
    if (button == LEFTINV){
      if (GlobalCondition(1)) SetMode(SPECIAL_INV_MODE); //if walk or pickup mode in inventory
    }
    else if (button == RIGHTINV){
      SetMode(GetDefaultAction(mouse.x,mouse.y));
    }
    ProcessInventoryAction(GSmode,GSlocid); 
  }
//-----------------------------------------------------

}
#sectionend on_mouse_click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart on_key_press  // DO NOT EDIT OR REMOVE THIS LINE
function on_key_press(int keycode) {///////////////////////////////////////On Key Press/////////////////On Key Press
  // called when a key is pressed. keycode holds the key's ASCII code

// Pause/unpause with space bar:
//-----------------------------------------------------
  if (keycode==32){// SPACEBAR
    if (IsGamePaused()==0){
       GUIOn(PAUSED);
       DisableInterface();
    }
    else{
       GUIOff(PAUSED);
       EnableInterface();
    }
  }
//-----------------------------------------------------

// Confirm exit with 'Y' and 'N' keys:
//-----------------------------------------------------
  if (IsGUIOn(CONFIRMEXIT)==1){ // if exit gui is on
     if (keycode == CONFIRM_GUIS_CHARACTER_NO) GUIOff(CONFIRMEXIT);//if N is pressed continue
     if (keycode == CONFIRM_GUIS_CHARACTER_YES) QuitGame(0);//if Y is pressed quit game
  }
//-----------------------------------------------------

// Confirm restart with 'Y' and 'N' keys:
//-----------------------------------------------------
  if (IsGUIOn(RESTART)==1){ // if exit gui is on
     if (keycode == CONFIRM_GUIS_CHARACTER_NO) GUIOff(RESTART);//if N is pressed continue
     if (keycode == CONFIRM_GUIS_CHARACTER_YES) RestartGame();//if Y is pressed quit game
  }
//-----------------------------------------------------

  if (IsGamePaused() == 1) keycode=0;  // game paused, so don't react to keypresses
 
  if (keycode==359) Display("Adventure Game Studio v2 run-time engine[[Copyright (c) 1999-2004 Chris Jones[[SCUMM template by Proskrito :)");// F1
  if (keycode==363) GUIOn(OPTIONS);   // F5 - OPTIONS
  if (keycode==366) GUIOn(RESTART);  // F8 - RESTART
  if (keycode==434) SaveScreenShot("scrnshot.bmp");  // F12
  if (keycode==19)  Debug(0,0);  // Ctrl-S, give all inventory
  if (keycode==22)  Debug(1,0);  // Ctrl-V, version
  if (keycode==1)   Debug(2,0);  // Ctrl-A, show walkable areas
  if (keycode==24)  Debug(3,0);  // Ctrl-X, teleport to room

// Setting cursor modes using keys:
//-----------------------------------------------------
  if (Translation("default")){// if no translation file is being used
    if (keycode == 'G')  SetMode(GIVE); //G
    if (keycode == 'P')  SetMode(PICKUP);  //P
    if (keycode == 'U')  SetMode(USE);      //U
    if (keycode == 'O')  SetMode(OPEN);      //O
    if (keycode == 'T')  SetMode(TALK);  //T
    if (keycode == 'S')  SetMode(PUSH);      //S
    if (keycode == 'C')  SetMode(CLOSE);    //C
    if (keycode == 'L')  SetMode(LOOK);  //L
    if (keycode == 'Y')  SetMode(PULL);      //Y
  }
//-----------------------------------------------------
}
#sectionend on_key_press  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart interface_click  // DO NOT EDIT OR REMOVE THIS LINE
function interface_click(int interface, int button) {////////////////On Interface Click///////////On Interface Click

  string buffer;
  if (interface == MAINGUI) {

// Setting cursor modes:
//-----------------------------------------------------
    if (button == 0)  SetMode(GIVE);
    if (button == 1)  SetMode(PICKUP);
    if (button == 2)  SetMode(USE);
    if (button == 3)  SetMode(OPEN);
    if (button == 4)  SetMode(LOOK);
    if (button == 5)  SetMode(PUSH);
    if (button == 6)  SetMode(CLOSE);
    if (button == 7)  SetMode(TALK);
    if (button == 8)  SetMode(PULL);
   
//-----------------------------------------------------
    if (interface == MAINGUI) {
    if (button == 9)  GUIOn(INVENTORY);
    }
//-----------------------------------------------------   

// Options GUI
//-----------------------------------------------------
 if (interface == OPTIONS) {
    if (button == 0){ //save game
      GUIOff(OPTIONS);
      GetLucasSavegameListBox(SAVE,1); // fills listbox 1 on gui SAVE with saved games
      GUIOn(SAVE);
      }
    if (button == 1){ //load game
      GUIOff(OPTIONS);
      GetLucasSavegameListBox(RESTORE,1);
      GUIOn(RESTORE);
      }
    if (button == 2){ // continue playing
      GUIOff(OPTIONS);
      }
    if (button == 3){ // exit??
      GUIOn(CONFIRMEXIT);
      }
    }
//-----------------------------------------------------

// Restore game GUI
//-----------------------------------------------------
 if (interface == RESTORE) {
    if (button ==2) GUIOff(RESTORE); //cancel
    if (button ==1){ //click on listbox item
       int index = ListBoxGetSelected(RESTORE,1);
       if (GetSaveSlotDescription(index+100,buffer)==1){ //if there is a savegame here
         GUIOff(RESTORE);
         RestoreGameSlot(index+100);
        }
       }     
    if (button == 3){ //scroll up
         if (GStopsaveitem<5) GStopsaveitem=0;
         else GStopsaveitem-=5;
      ListBoxSetTopItem(RESTORE,1,GStopsaveitem);
      }
    if (button == 4 && GStopsaveitem<90) //scroll down
      GStopsaveitem+=5;
      ListBoxSetTopItem(RESTORE,1,GStopsaveitem);
    }
//-----------------------------------------------------

// Save game GUI
//-----------------------------------------------------

 if (interface == SAVE){
    int index=ListBoxGetSelected(SAVE,1);
    if (button == 3){//cancel
      GUIOff(SAVE);
      GUIOff(SAVETEXTBOX);
    }
    if (button == 1){ //click on listbox
     int stbypos;
      StrFormat(buffer,"%d.",index+1);
      SetLabelText(SAVETEXTBOX,1,buffer);
      if (GetSaveSlotDescription(index+100,buffer)==0) StrCopy(buffer,"");//GetSaveSlotDescription(index+100,buffer);
      //else StrCopy(buffer,"");
     SetTextBoxText(SAVETEXTBOX,0,buffer);
     stbypos=28+((index-GStopsaveitem)*(DEFAULT_FONT_HEIGHT+2)); //28 is set by trial-error. Deppends of the savegames listbox position
     if (index<9)  SetGUIObjectPosition(SAVETEXTBOX, 0, 12, 0);
     else SetGUIObjectPosition(SAVETEXTBOX, 0, 18, 0);     
     SetGUIPosition(SAVETEXTBOX,29,stbypos);// 29 is set by trial-error. Same as above.
     GUIOn(SAVETEXTBOX);
    }
    if (button == 2 && index>=0) { //save
      GetTextBoxText(SAVETEXTBOX,0,buffer);
      GUIOff(SAVE);
      GUIOff(SAVETEXTBOX);
      SaveGameSlot(index+100,buffer);
    }
    if (button == 4){// scroll up
       GUIOff(SAVETEXTBOX);
       ListBoxSetSelected(SAVE,1,-1);
         if (GStopsaveitem<5) GStopsaveitem=0;
         else GStopsaveitem-=5;
       ListBoxSetTopItem(SAVE,1,GStopsaveitem);
    }
    if (button == 5 && GStopsaveitem<90){ //scroll down
       GUIOff(SAVETEXTBOX);
       ListBoxSetSelected(SAVE,1,-1);
       GStopsaveitem+=5;
       ListBoxSetTopItem(SAVE,1,GStopsaveitem);
    }
  }
 if (interface == SAVETEXTBOX){
    int index=ListBoxGetSelected(SAVE,1);
    if (button == 0){
      GetTextBoxText(SAVETEXTBOX,0,buffer);
      GUIOff(SAVE);
      GUIOff(SAVETEXTBOX);
      SaveGameSlot(index+100,buffer);
    }
    if (IsButtonDown(RIGHT)) GUIOff(SAVETEXTBOX); 
 }
//-----------------------------------------------------

// Scrolling the inventory:
//-----------------------------------------------------
    if (interface == INVENTORY){

    if ((button == 0) && (game.top_inv_item < game.num_inv_items - game.num_inv_displayed))
      game.top_inv_item = game.top_inv_item + (game.num_inv_displayed/2);
    if ((button == 1) && (game.top_inv_item > 0))
      game.top_inv_item = game.top_inv_item - (game.num_inv_displayed/2);
     }
     }
//-----------------------------------------------------

//      Close down the inventory:
//-----------------------------------------------------
    if (interface == INVENTORY){
    if (button ==2){
     GUIOff(INVENTORY);
     }
     }
}
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: Ashen on 14 Aug 2005, 20:39
For some reason you've got two if (interface == MAINGUI) conditions, and two for if (interface == INVENTORY). The INVENTORY ones aren't so important - there don't seem to be any conflicts, it just looks odd. However, one of the MAINGUI's isn't closed properly so everything down to the second INVENTORY condition ('Close down the Inventory') probably won't run (Ctrl-B to check braces, to see what I mean).

Try changing (I've added some comments):
Code: [Select]
  if (interface == MAINGUI) { // NOTE: MAINGUI opened

// Setting cursor modes:
//-----------------------------------------------------
    if (button == 0)  SetMode(GIVE);
    if (button == 1)  SetMode(PICKUP);
    if (button == 2)  SetMode(USE);
    if (button == 3)  SetMode(OPEN);
    if (button == 4)  SetMode(LOOK);
    if (button == 5)  SetMode(PUSH);
    if (button == 6)  SetMode(CLOSE);
    if (button == 7)  SetMode(TALK);
    if (button == 8)  SetMode(PULL);
   
//-----------------------------------------------------
    if (interface == MAINGUI) { // NOTE: MAINGUI opened again, for some reason
      if (button == 9)  GUIOn(INVENTORY);
    } // NOTE: Second MAINGUI closed
//-----------------------------------------------------   

// Options GUI
//-----------------------------------------------------
if (interface == OPTIONS) { // NOTE: First MAINGUI _still open_

to:

Code: [Select]
  if (interface == MAINGUI) { // NOTE: MAINGUI opened
// Setting cursor modes:
//-----------------------------------------------------
    if (button == 0)  SetMode(GIVE);
    if (button == 1)  SetMode(PICKUP);
    if (button == 2)  SetMode(USE);
    if (button == 3)  SetMode(OPEN);
    if (button == 4)  SetMode(LOOK);
    if (button == 5)  SetMode(PUSH);
    if (button == 6)  SetMode(CLOSE);
    if (button == 7)  SetMode(TALK);
    if (button == 8)  SetMode(PULL);
//-----------------------------------------------------
    if (button == 9)  GUIOn(INVENTORY);
  } // NOTE: MAINGUI closed
//-----------------------------------------------------   

// Options GUI
//-----------------------------------------------------
if (interface == OPTIONS) {

I can't see why you can't turn the INVENTORY GUI off, though - unless there's another problem with the braces somewhere. It's probably worth giving them a thorough checking - when in doubt, always check your braces.
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: Mats Berglinn on 15 Aug 2005, 08:38
Thanks. The problems have been solved. I've discovered for the closing of inventory wasn't working. It was that I set the button 2 for it but the real button actually was 3 (and the number 2 was the inventory window, not a button). Silly me!
Title: Re: The LucasArts GUI Help Thread
Post by: on 15 Aug 2005, 14:43
http://www.freewebs.com/skimbleshanks/templatesandmodules.htm

Just unzip the file, and place it all in your ags directory. When you create a new game, the new template choice should appear.

I have tried this link and it is 404 also when I click to download the file. Does anyone know where else I can get a copy, or could someone e-mail me the Lucas GUI?
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: subspark on 22 Aug 2005, 17:45
Hey. It's been a while...but, I am curious. Has anyone actually managed to recompile ANY of the LEC Templates for use with AGS 2.7 Beta 3 and succeeded with testing it fully?

Also, I wish to have a DOTT,FOA,MI2 style interface but my game resolution is 640x480. Is there an easy way of adjusting the code to take the > resolution into account?

In my opinion JAVA and .net fx is going to give AGS an expidential increase in functionality and user friendliness. But thats beside my point. Just loving the moment! Purely loving it!  :D

Any ideas about the resolution and any news on the LEC game templates' full compadability with 2.7b3 would be greatly appreciated.

Beers,

Subspark.
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: That Guy on 25 Aug 2005, 23:10
I've managed to reconstruct an LEC-style interface using my own graphics and scripting... since this template appears to be either MIA or incompatible with 2.7, would anyone benefit from my posting a tutorial of some sort?
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: Mats Berglinn on 04 Sep 2005, 13:50
Is it possible for changing the inventory from having two rows to one and that you can have more inventory items on the same row than four? If yes, how?
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: monkey0506 on 04 Sep 2005, 20:28
Check the InvWindow.ItemHeight and InvWindow.ItemWidth properties (AGS 2.7+).  For 2.62- it's SetInvDimensions.

To make only 1 row, with more than four items per row, just make sure that you set the height to that of the height of 1 inventory item, and the width to more than the width of 4 items (at least 5 to be able to have 5 items per row).
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: Lazarus on 19 Sep 2005, 14:55
I'm progressing well with my game using the MI2 template (thanks to the creator Proskrito for making the template!) and converted the template for use with AGS 2.7.

Here's my problem:

I now am at a point where I have around 25 inventory items active for use on each other, obviously only a few will combine! 

The problem I have is that if I "use inventory item on another inventory item" sometimes it works (displaying the message I have scripted for it), sometimes it does nothing, sometimes it says the unhandled event (i.e "That doesn't work") ...

What I don't understand is there doesn't seem to be a pattern to it.

I would like the player to receive a message everytime they try to combine items.

Is anyone else experiencing this?  Or, if you are using the template can you tell me if you can use inventory items on each other and always get a message and not nothingness?

Hope I haven't babbled!

Thanks ...

PS  I haven't "fiddled" with the original Inventory Scripting on the template.
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: SSH on 20 Sep 2005, 15:04
Lazarus, you should have said that you got your template uploaded to http://www.lumpcity.co.uk/~skimbleshanks/templates/MI2v2.7.zip !  ;D

Thanks for the work. Maybe a mod can update the title of the first post now!
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: Lazarus on 20 Sep 2005, 18:00
SSH:

I didn't think!, sorry!

I hope the template is okay but it may need tweaking here and there (I am relatively new to this scripting lark).

Arrays and struts will be my next headache me thinks  ::)

... so you guys will be fed-up with me and my postings before too long  ;D
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: subspark on 27 Oct 2005, 03:41
Still no update for MI2 Template? RC2 has been released and the MI2 template remains ever so.....incompatible.  :'(
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: Gilbert on 27 Oct 2005, 03:47
Why? The template for V2.7 is quite new already, just that there're some huge changes in string handling for AGS V2.71 makes it not directly usable without small changes.
Unless you know what you're doing or you desperately need some new features you should not work with a non-release version of AGS (though V2.71 had reach RC already...).
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: subspark on 27 Oct 2005, 03:56
Yes but it is safe to assume these changes in the way RC2 handles string constants is permanent. And I want my game to work with it as soon as possible. RC2 has been thouraghly tested or it would not be a release candidate.  :)

Minor bugs and hickups asside, I want my game to be compatible with the lastest + stablest version of AGS.

The point is, my game code isn't going to work with AGS 2.71 Final nor any future version. So I am asking anybody who 'knows what they're doing' for help in adjusting these minor errors to work with the new version's architecture sooner rather than later.

Too much?

Cheers.
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: Gilbert on 27 Oct 2005, 04:04
Maybe, in fact my game was made with V2.6SP1, and I'll let it stay even when it's released, I won't even upgrade it to V2.62. In my opinion if you start your game with a stable release version, unless you really need some of the new features or bug fixes you don't need to change the game to use a newer version of the engine. This can save you from many problems while upgrading, especially when you use third party components that may not work properly when the engine version is changed.
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: subspark on 27 Oct 2005, 04:38
Yes and no. It's important to work with the developer to ensure a smooth and comfortable workflow. Obviously some major things have been changed since 2.7 (which we were warned about naturally) however I need 2.71's new features to work with. I've only just begun my game so theres really no harm in making a swift change over to the latest build.

In addition, after the upgrade and proper adjustments I don't think my game will become incompatible like it is now for quite some time. But as you said, it needs a few minor adjustments and at this stage, I'm prepared to try anything to get my games to work with the latest tools.

Again, if anyone could help me get the obsolete code to work with AGS v2.71 RC2 I would be most appreciative.

BTW: I've started a new thread. So please post there in regards to this issue.
http://www.adventuregamestudio.co.uk/yabb/index.php?PHPSESSID=ef5c5e1983193a0baabe32bb6a8a9a39&topic=23252.0

Thanks again.
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: GokuZ on 12 Dec 2005, 15:48
I am using the MI2v2.7.zip GUI and It works a treat!, I'm currently editing the overall look of the GUI and I cant figure out how to change the 'Action' text from the purple/pink to a green style
Any Ideas?
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: Ashen on 12 Dec 2005, 16:00
Two things:
First, change the 'default' colour of the label on the ACTION GUI to dark green (2 should do it).

Then, open the Global Script ('Script -> Edit Global Script'  or Ctrl-G), and scroll down to around line 30.
You should see two lines like this:
Code: [Select]
#define ACTION_LABEL_COLOR_NORMAL 5// Used in highlighting the action bar.
#define ACTION_LABEL_COLOR_HIGHLIGHTED 13
Change the 5 to 2, and the 13 to 10.

You might have/want to play with the numbers a little, to get exactly the shades you want - get the numbers from the 'Palette' window of the editor - but that should be it.
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: GokuZ on 12 Dec 2005, 16:09
Works Perfectly !
Thankyouverymuch! x
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: GokuZ on 16 Dec 2005, 20:01
Back Again, I've been modifying the MI2 GUI and I've moved the Inventory Screen Location, but now I cant get the Scrolling Inventory to work the way I want it and its driving me *&%$£ nuts!
This is what it looks like and the code Im using in the Global Script
Code: [Select]
    if ((button == 10) && (game.top_inv_item < game.num_inv_items - game.num_inv_displayed))
      game.top_inv_item = game.top_inv_item + game.items_per_line;
     
    if ((button == 9) && (game.top_inv_item > 0))
      game.top_inv_item = game.top_inv_item - game.items_per_line;
    }
If I stretch the Inventory size to fill the 8 slots , it seems to work but it doesnt cycle the inventory correctly

EDIT: Aghh Ive searched all over this forum and all I can find is bits of code that just create more errors in the Global Script.  I know that this code above has been made obsolete with the invMain.ScrollDown(); but theres no clear cut way how to implement it without errors!

EDIT:SOLVED I needed to change the #define FIRST_INV_SLOT_COORDS        170,205 in the global script
Title: Moderators: Please merge into LucasArts GUI Help Thread
Post by: on 21 Dec 2005, 20:33
Hi, is anyone else having problems importing the Proskrito's DOTT template into AGS 2.70?

When I try to compile the template it gives me a series of compile errors that I'm not sure how to deal with:

First I get a message that the variables 'gui' and 'object' in the function GetLucasSavegameListBox() are global variables and cannot be used locally.  I renamed those variables within that function.
I did the same for 'hotspot' in VariableDefaultAction().

The second error regards GoToCharacterEx(): "Function declaration has wrong number of arguments to prototype".  I haven't been able to get beyond this one.

I wouldn't expect any of these compile errors anyway, as I can't find anyone else to have reported it.  Any ideas anyone?

PS The MI2 template works perfectly.

PPS The DOTT template mentions a word document included in the zip file (although the download's a rar file) that doesn't appear to be there.
Title: Re: Problems importing Proskrito's DOTT template
Post by: strazer on 21 Dec 2005, 21:24
The second error means that the function header in the global script, e.g.
  function GoToCharacterEx(int a, int b, int c) {
does not match the import statement in the script header, e.g.
  import function GoToCharacterEx(); // causes error because parameters are missing
instead of
  import function GoToCharacterEx(int a, int b, int c); // correct

The templates have been written with older versions of AGS and they are not updated regularly so such errors are to be expected.
Title: Re: Moderators: Please merge into LucasArts GUI Help Thread
Post by: on 21 Dec 2005, 21:45
Thanks Strazer, it now works.

Was wondering if anyone knows how I can get hold of the DOTT template documentation that's meant to be included in the zip file?
Title: Re: Moderators: Please merge into LucasArts GUI Help Thread
Post by: strazer on 21 Dec 2005, 21:55
I think http://usuarios.lycos.es/golfapagina/templates/ is Proskrito's official site and the file there doesn't contain the doc either so I guess there is none.
Isn't it used the same way as the MI2 template anyway?
Title: Re: Moderators: Please merge into LucasArts GUI Help Thread
Post by: on 21 Dec 2005, 21:59
I've got the MI2 document so if that works for DOTT I'll read that instead.

Thanks for all your help.
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: strazer on 21 Dec 2005, 22:22
I've never used the templates so I don't know but it's worth a try.

You're welcome and good luck with your game. :)
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: Grapefruitologist on 07 Jan 2006, 01:53
Um, this might seem like a silly question... but remember, I'm a newbie, so I don't know much.
I want to use the LucasArts GUI, but, how do you do that? I download the .zip. But now what? (Read the readme already, but it doesn't say how to install.)
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: Gilbert on 07 Jan 2006, 02:40
Just drop it in the AGS folder, when you execute AGSedit and start a new game you can choose the template to use.
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: Grapefruitologist on 07 Jan 2006, 05:52
Okay, thanks.
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: Mats Berglinn on 20 Jan 2006, 10:42
I've stumbled across a problem when I changed the look of the options GUI. For some reason the Quit, Load, Save and Play buttons doesn't work even if I didn't change any of the code in the script. Before I changed the background of the GUI it worked just fine so I've no idea of why it happens.

I'm using 2.62 version of AGS.


Never mind, I found a way around the problem.
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: on 16 Feb 2006, 14:52
mmm hi guys!! i'm finally back, the new 2.71 version object-oriented told me <"You have to finish your game..."> ,
but it also gave me a little problem...
i wanted to do a game with LEC GUI template, and so i have downloaded the 2.7 version(thanks Lazarus!!!!) but it gave me some errors on the string stuffs... so i have edited the string vars in const string and everything fine (except the translation stuff, that i have brutally commented, as i couldn't find a way out..), but now i have a new problem, probably connected to the fact that i have edited the string in const string...
When i hover an object, or hotspos, or invobject with the mouse, the button pannel doesn't highlight the default command specified with the extension, but if i click with the right button, the status bar update the verb and it performs the default command.

So... it's a problem of the porting from 2.62 to 2.7 or from 2.7 to 2.71? (changing the string to const string)
i have found something interesting in the global script which can help solving the highlight button thing. First of all i guess the problem is in the HighlightButton function at line 327
Code: [Select]
function HighlightButton(int mode){
  //highlights the appropiate button for the mode passed as parameter
int counter=0;
  while (counter<MAX_MODES){
    if (Tmode[counter].button!=-1){
      if (mode==counter){
        SetButtonPic(MAINGUI, Tmode[counter].button, 1, Tmode[counter].highlightedbutton);
      }
      else  {
SetButtonPic(MAINGUI, Tmode[counter].button, 1, Tmode[counter].normalbutton);
}
    }   
   counter++;
  }
}

and so i have checked the function, and i discovered the problem is located in the first if condition the one that check
Code: [Select]
Tmode[counter].button!=-1

this one will never accour but i don't know why; in fact the

Code: [Select]
Tmode[counter].button
will ALWAYS be equal to -1

Now...i'm not very expert with scripts and i don't know if this is the real reason why the button does not highlight, but i hope i can help solving the problem...

 thanks a lot

Cisco

EDIT:
WOW i found out the solution!!!

it was the "translation" function part that i have commented. I managed to fix it with the 2.71 and now it works even the highlight button for the default command....

GREAT....but i still wonder why translate should affect the highlight function...
anyway now i have my own scumm template for 2.71...
see you!!

Cisco

P.S.

to fix the translation add const string in the script header too, not only in the global script as i did!!!!!

Edit by Ashen: Well done, but please don't double – never mind TRIPLE - post in future.[/size]
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: on 22 Feb 2006, 02:00
Hi, first of all, I'm using MI2 2.7 lazarus version. It looks great.
A great deal of thanks to everyone involved in it.
I'm using it with 2.71 so I had to change some function headers from string to const string. That doesn't affect anything as far as I've seen.

I had this problem where sometimes the default behaviour (like with "look at" -> "Nice something") got executed instead of coded behaviour for behaviours that had specific code.

After some bug tracking I found out several things:
1. It happened only when a player was clickable.
2. It happened only when "always go to hotspot" was active
3. It happened when one was trying to interact with any part of the object that will get "covered" by the character when he finishes moving to the object (in order to interact with it)

Afterwards I read the template and found the bugged code, also I coded a workaround, not the cleanest solution by far, but I've been testing it throughly and it seems to work fine.

If anyone encounters this same problem, post a message and I'll upload the corrected template.

Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: on 02 Mar 2006, 23:47
I'm using a CMI inteface similar to that of the MI3 template. How would I go about changing the inventory to use verb coin over inventory items instead of sierra. Like in CMI?
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: on 09 Mar 2006, 18:09
I'm using Proskrito's FOA v2.71 template and I have a problem interacting with characters. My interactions with objects, inv items, hotspots, etc. all work fine, but no matter what i try i just can't seem to do anything with my characters (NPC or player). Btw, i do have the character's 'clickable' option selected.

I've tried setting up the interactions in the interactions editor (ie. Talk to Character - RunDialog - topic 0) - nothing happens. I've tired doing it in the script (ie. Talk to character - Run Script:
Code: [Select]
if (UsedMode(TALK)) RunDialog(0);
else Unhandled();
...still nothing happens! I've tried all the other interaction options as well. Neither the interaction i want to run nor the unhandled_event runs.

I set up the RunDialog interaction with an object in my room, to test it, and the dialog runs: my player talks to the object while the NPC behind him responds! So RunDialog works fine.

When i move the mouse over the character, the action bar updates with the character's name, and when i click on the character the action bar text gets highlighted, but the mode doesn't reset to 'walk to' as it does with objects after clicking on them.

I did modify the template a bit, but even after going back to the original, adding another character and attempting an interaction, i still got nothing. I've checked out the MI2 template and got the same problem.

I've been through the forums, i've been through Proskrito's walkthru, and i can't find any answers. I don't know which part of the script is causing this problem. What the hell's going on here!? How can i interact with my characters?
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: on 10 Mar 2006, 17:33
Quick Question:

Is there a Sam n' Max GUI template out there anywhere?
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: on 15 Mar 2006, 23:00
I'm using a CMI inteface similar to that of the MI3 template. How would I go about changing the inventory to use verb coin over inventory items instead of sierra. Like in CMI?

Don't worry about it. I made one myself by updating the old MI3 template to version 2.7 and making it precisely like CMI inteface. This means:

LEFT CLICK HOLD -> open coin
LEFT CLICK -> WALK
RIGHT CLICK -> open inventory

LEFT CLICK HOLD WHILE INVENTORY OPEN -> open coin
LEFT CLICK WHILE INVENTORY OPEN -> take item or use selected item with item
RIGHT CLICK -> if item selected release item and restore mouse pointer
SCROLL OUTSIDE INVENTORY (item selected) -> close inventory and contain item
LEFT CLICK OUTSIDE INVENTORY (NO item selected) -> close inventory

Should I save a template out if it? And put it somewhere?

I'm using this interface for my game i'm working on (The Family Treasure 2)
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: on 18 Mar 2006, 02:00
Could someone send me a 2.71 compatable version of the MI template? I can't fix it, so if someone else has, could you send it to me? Send me a PM please!
 - MugOGrog
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: DutchMarco on 22 Mar 2006, 12:59
Mugogrog,

How you fix it is as follows: (I'll describe it by heart so the details are wrong but you'll get the idea)

- try to test the game (Ctrl+T). You get an error and get directed to line 631 in the script.
- change the function call's "string" into "const string", do this for a few parameters.
- There's a "translate" block nearby. If you can't find it, save the text by Ctrl+W and retest by Ctrl+T. You will be redirected to that block if you choose to debug.
- comment out the function call "translate {" and "}", but leave the actual code (DefineMode function calls, or DefineINVMode or something) intact.

It should now compile properly.
------------
Edit: here's how you do it in the global script:

Line 82 change "string" into "const string":
function DefineMode(int mode, const string name, int AGSmode, char extension)

Line 91 change "string" into "const string":
function DefineInvMode(int mode, const string name, const string preposition, int onlyinv, int caninteractwithinv, char extension)

Line 659 onward, comment out the "if" statement and the call to func "translation" but leave the code inside the "if" statement to work:
//  if (Translation("default")){ // if no translation file is being used
//         mode   button   normal   highlighted
//            number   sprite   sprite
    DefineButton(   GIVE,      0,   13,   22);
    DefineButton(   PICKUP,   1,   14,   23);
    DefineButton(   USE,      2,   15,   24);
    DefineButton(   OPEN,      3,   16,   25);
    DefineButton(   LOOK,      4,   17,   26);
    DefineButton(   PUSH,      5,   18,   27);
    DefineButton(   CLOSE,   6,   19,   28);
    DefineButton(   TALK,      7,   20,   29);
    DefineButton(   PULL,      8,   21,   30);
//  }

You need the DefineButton calls for the menu to work properly. But you have now disabled translation.

There are more places where old-style strings are used, but the code seems to function with only these changes. In fact when I changed more bits of code, I just got lots of different error messages.
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: on 29 Mar 2006, 21:39
Quote from: scourge
LEFT CLICK HOLD WHILE INVENTORY OPEN -> open coin

How exactly have you scripted that? My attempt was to tick "Handle inventory clicks in script" and then fiddle with eMouseLeftInv in on_mouse_click.
Everything works fine in the MI3 GUI I use, but I can't seem to get this to work. :/

Campusanis

EDIT: Solved with the use of on_event
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: Psych0F0x on 26 Apr 2006, 22:35
Quote from: scourge
LEFT CLICK HOLD WHILE INVENTORY OPEN -> open coin

How exactly have you scripted that? My attempt was to tick "Handle inventory clicks in script" and then fiddle with eMouseLeftInv in on_mouse_click.
Everything works fine in the MI3 GUI I use, but I can't seem to get this to work. :/

Campusanis

EDIT: Solved with the use of on_event

Could someone please explain this? I've only been fooling around in ags scripting since today and most of it is self-explanatory but I can't figure this out.
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: on 12 May 2006, 17:40
Hello.
Im using Proskrito's MI2 template.

I have a serius problem. I can't interact with my characters.. Ive spent probably the las 10 hourse trying to find somthing in manuals, forums, and template documents...

But no one seems to have the same problem except "globesquatter" and his post hasn't been awnserd since marc 9!! (about 5 posts up)

im realy freaking out... will this mean the end of my game?
any tips? anuone els even have this problem?

Thank you for any help given...



Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: on 12 May 2006, 18:13
Omg.

now i feel so stupid...

tried out the "td" (talk but dont walk) ending. And the characters react like normal to the interactions called...

but i didnt have the same problem as the other posts with brought that up.
my character where not working att all with just the "t" ending.

well i guess thats it.
thanks for all the great posts in this forum and the great templates u guys have done.

.Peace
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: Wonko The Sane on 15 May 2006, 22:52
I havedownload the GUI template and I keep getting an erro when I try the test game. It says: Error (line 631): Type mismatch: cannot convert 'const string' to 'string' Iam sorry if this problem has been addressed in previous posts but I don't have time to go through 16 pages  :-\
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: Scummbuddy on 16 May 2006, 09:16
This most likely has to do with the version of AGS you are using. Find out through the template documentation what version of AGS the template was built for, and then we can get you that version to use with the template, and you shouldn't run into any problems using it.
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: Wonko The Sane on 17 May 2006, 03:05
i am using 2.71
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: on 18 May 2006, 13:59
Hi, i've got a problem.
I use MI2.7, and Walk-Behinds hotspot don't seem to work. Serveral time, it's working when I pute a Baseline but serveral time, it didn't work.

Somebody know what's happening ?


(Sorry for my crappy english, i'm french)

[Edit :] Resolved, i forget to put de Baseline, ROFL
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: on 18 May 2006, 14:14
I havedownload the GUI template and I keep getting an erro when I try the test game. It says: Error (line 631): Type mismatch: cannot convert 'const string' to 'string' Iam sorry if this problem has been addressed in previous posts but I don't have time to go through 16 pages  :-

See the DutchMarco Topic ( http://www.adventuregamestudio.co.uk/yabb/index.php?topic=24112.msg323987#msg323987 ), he explain what you have to change
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: Wonko The Sane on 19 May 2006, 20:23
I tried that but it didn't work for some reason, could somebody post the entire updated global code for v2.71?
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: Scummbuddy on 21 May 2006, 06:12
Right now there is not one. You can either wait for one, do it yourself, or do what I suggested before, and use an older version of AGS that the template was made with.

We try to make one with the official releases, and not update one every beta release. We're only human.  ;)
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: SSH on 06 Jun 2006, 13:19
Err, Scummy, 2.71 hasn't been beta since January  ;)

Anyway, here is my attempt at updating the MI2 template for AGS 2.71 (http://ssh.me.uk/MI2forags271.zip). I've also had a go at making it stay working in the 2.72 beta. Please let me know of any problems with it in this thread.

Can a mod please update the first post of the thread with it, too?
Edit by Ashen: Done
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: Lazarus on 12 Jun 2006, 12:30
Hi SSH
Good work on the updating.
I was going to ask you if you had sorted out the unhandled event for inventory items on other inventory items as with the 2.70 version they didn't always work.

I thought when testing your version you had the same problem, but what I found with your example with the "needles" inventory was that you were missing the unhandled function it should read like:

Code: [Select]
    if (UsedInvMode(USE,3)){ // (mode used,inventory number)
// Display ("Chachipiruli"); 
player.LoseInventory(inventory[1]);
player.LoseInventory(inventory[3]);
player.AddInventory(inventory[2]);
}

else Unhandled(); // <---

I also found the interactions for the "voodoo doll" example you show doesn't work if other inventory items are used on it. So it's better to use the above example.


Also you might want to comment out the
Code: [Select]
#define FIRST_INV_SLOT_COORDS

As you have named the inventory box so when moving the gui's around you don't need to set new coordinates for it.

Code: [Select]
  if (MainInventory.TopItem > 0){     //if invent. can scroll up
    gMaingui.Controls[9].AsButton.NormalGraphic=INV_UP_ARROW_ON_SPRITE;
  }
  else //if can not scroll up
    gMaingui.Controls[9].AsButton.NormalGraphic=INV_UP_ARROW_OFF_SPRITE;   
  if (MainInventory.TopItem < MainInventory.ItemCount - (MainInventory.RowCount*MainInventory.ItemsPerRow))   //if invent. can scroll down
    gMaingui.Controls[10].AsButton.NormalGraphic=INV_DOWN_ARROW_ON_SPRITE; 
  else  // if can not scroll down
    gMaingui.Controls[10].AsButton.NormalGraphic=INV_DOWN_ARROW_OFF_SPRITE;
//-----------------------------------------------------
}

Thats my findings at present I'll keep testing it.

Keep up the good work

Lazarus
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: SSH on 12 Jun 2006, 16:29
I thought when testing your version you had the same problem, but what I found with your example with the "needles" inventory was that you were missing the unhandled function it should read like:
Fixed.

Quote
I also found the interactions for the "voodoo doll" example you show doesn't work if other inventory items are used on it. So it's better to use the above example.
Not sure what you mean by this. I didn't change any interactions from the 2.7 template.

Quote
Also you might want to comment out the
Code: [Select]
#define FIRST_INV_SLOT_COORDS
Removed entirely


Quote
Code: [Select]
  if (MainInventory.TopItem > 0){     //if invent. can scroll up
    gMaingui.Controls[9].AsButton.NormalGraphic=INV_UP_ARROW_ON_SPRITE;
  }
  else //if can not scroll up
    gMaingui.Controls[9].AsButton.NormalGraphic=INV_UP_ARROW_OFF_SPRITE;   
  if (MainInventory.TopItem < MainInventory.ItemCount - (MainInventory.RowCount*MainInventory.ItemsPerRow))   //if invent. can scroll down
    gMaingui.Controls[10].AsButton.NormalGraphic=INV_DOWN_ARROW_ON_SPRITE; 
  else  // if can not scroll down
    gMaingui.Controls[10].AsButton.NormalGraphic=INV_DOWN_ARROW_OFF_SPRITE;
//-----------------------------------------------------
}

Errr... what was this code for? That's the same as what I have.


Anyway, thanks for the testing!
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: Lazarus on 13 Jun 2006, 09:17
With regards to the voodoo doll interactions yes your quite right it is in the 2.70 version. (Slaps face repeatedly)
And maybe that should have been taken out.

*Edit* The example shown with the voodoo doll uses the drop down menu conditional and it's this that doesn't kick in the unhandled event for other inventory items used on it.*

With reagrds to the
Code: [Select]
if (MainInventory.TopItem > 0){     //if invent. can scroll up
    gMaingui.Controls[9].AsButton.NormalGraphic=INV_UP_ARROW_ON_SPRITE;
  }
  else //if can not scroll up
    gMaingui.Controls[9].AsButton.NormalGraphic=INV_UP_ARROW_OFF_SPRITE;   
  if (MainInventory.TopItem < MainInventory.ItemCount - (MainInventory.RowCount*MainInventory.ItemsPerRow))   //if invent. can scroll down
    gMaingui.Controls[10].AsButton.NormalGraphic=INV_DOWN_ARROW_ON_SPRITE; 
  else  // if can not scroll down
    gMaingui.Controls[10].AsButton.NormalGraphic=INV_DOWN_ARROW_OFF_SPRITE;
//-----------------------------------------------------
}


that was to show anyone else looking where you had named the inventory box.

Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Khris on 28 Jul 2006, 02:19
There an issue with NPC interactions not working properly due to a missing "return".

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=27613.msg350994#msg350994
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: SSH on 28 Jul 2006, 09:46
I've updated the template on my site. Thanks for finding and debuigging this, khrisMUC
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Boco on 28 Jul 2006, 21:41
two questions I think are related to the template...

One is that I want to be able to talk to hotspots and objects yet when I put the cursor over those areas, the talk to thingy doesnt select them.

Also I changed the res for my game from the original tiny res and would like to know how to change the seperation incrament between inventory items so I can space them out properly.

Thanks.

edit: also where are the open and close / push and pull in the interaction thingy...
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Khris on 29 Jul 2006, 05:28
Well, add characters if you wanna run dialogs with inanimate objects. Just assign the Object's sprite to all four loops.

You can set the width and height of an inventoy item by changing x.ItemWidth and x.ItemHeight. Look it up in the manual. (Scripting -> GuiInvWindow)

Open/Close/Push/Pull are handled seperately, please refer to the included readme for details.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Boco on 30 Jul 2006, 14:53
Awesome got everything working. Again, you guys are awesome. I'm getting the hang of things now.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: vurt on 21 Aug 2006, 06:37
Hi all,

I've recently downloaded AGS and I'm very impressed with it. Since I'm a LucasFilm/Arts junkie from way back, I was over the moon to see that there was a template that allowed you to use the classic Lucas UI.

However, I've had a problem using the MI2 template with AGS 2.72. When I click on a hotspot, the game crashes. This happens with the demo game. You can reproduce it with the test game by walk left and walking to the door to the woodcarver's hut.

The full error message is:

(ACI version 2.72.920)

in Global script (line 425)
from Global script (line 444)
from Global script (line 543)
from Global script (line 550)
from Global script (line 789)

Error: GetGameParameter: invalid frame specified.

This problem doesn't occur with 2.71, so I can still get on and work on my game (which, at this stage, mostly consists of learning to draw) but it would be nice to use the latest version.

Thanks in advance.

Apologies if this has been answered upthread; I did look through but couldn't find any solutions.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: SSH on 21 Aug 2006, 08:10
I'll have a go at making it work with 2.71 and 2.72 soon
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Lazarus on 21 Aug 2006, 08:49
I had a quick look using 2.72, I also had the same error only it was with line 428.
Code: [Select]
ViewFrame *vf2=Game.GetViewFrame(CURSOR, 0, counter/DELAY);

So I then chaged it too :
Code: [Select]
ViewFrame *vf2=Game.GetViewFrame(CURSOR,0,1);
This may not be right, but for now it seems to work.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: SSH on 21 Aug 2006, 13:18
The bug is in line 387 of the template's global script, where:

Code: [Select]
int numframes=Game.GetFrameCountForLoop(CURSOR, 0);

should be

Code: [Select]
int numframes=Game.GetFrameCountForLoop(CURSOR, 0)-1;

which means the counter resetting happens 1 cycle too late. Thanks again to Lazarus for his debugging hints!

The zip download on my site has been updated with this fix.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: vurt on 21 Aug 2006, 21:47
Wow - thanks for the speedy turnaround. I should really have had a go at debugging it myself, but I'll wait until I've finished the manual before I dive too deep into the code :)
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Lazarus on 22 Aug 2006, 09:46
One thing I have noticed is with the status line,
in that for example. If you give a character an inventory item and this in turn causes the player to change room, in the new room it will briefly show that you have given an inventory item to a character.

So what I then did was to give the status label a script name "lblStatus" and then add to the on event function the following:
Code: [Select]
function on_event (int event, int data) {//////////////////////////////////////On Event/////////////////////On Event
  if (event == eEventEnterRoomBeforeFadein) player.PlaceOnWalkableArea();

  else if (event == eEventLeaveRoom) { // Reset Label to "walk to".
    SetDefaultMode(WALK);
    lblStatus.Text = ("Walk to");
  }

}

which seems to have solved the problem.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: SSH on 22 Aug 2006, 10:08
I've updated the zip with your change, Lazarus. Thanks again.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: on 26 Aug 2006, 19:13
I'm sorry if this has been answered, but I'm pretty new in terms of scripting in AGS (my best works include calling/hiding GUIs and moving objects). Can anyone give me a fast method on how to implement only the status bar from Lucas Arts GUIs? The MI2 template includes all of the buttons and such, and I can't understand one bit of the scripting. I've made fair progress on my project and don't wish to start over using the MI2 template as a, well, template!

Answers would be appreciated...
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: SSH on 27 Aug 2006, 08:19
Use my Description module http://ssh.me.uk/modules/Description.zip

instructions are in the module header, or search the forums for the thread...
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: on 28 Aug 2006, 17:10
Use my Description module http://ssh.me.uk/modules/Description.zip

instructions are in the module header, or search the forums for the thread...
Many thanks. This is exactly what I'm looking for!
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Mats Berglinn on 13 Sep 2006, 18:35
Could someone make a 2.72 version of the Day of the Tentacle template, please?
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: cjhrules on 14 Sep 2006, 21:04
I have some problems with the "GIVE" command. When I use it nothing happen not even the "default" message "I'd rather keepit ." displays. What can be the problem.
It's used on chracters of course so that's no the problem.

EDIT: Ok, I solved it. I had to put the command in the "Any click" section.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: on 17 Sep 2006, 12:37
Hey, new member here, currently working on a new game, some of it is built already and ive recently found out about these gui templates. so i tried one of the MI2 ones out. encountering a few problems, the first one was the 'gInventory' , i think its sorted now, i checked out some previous posts, the next one is the SetMode problem..

#sectionstart interface_click  // DO NOT EDIT OR REMOVE THIS LINE
function interface_click(int interface, int button) {

  String buffer;
  if (interface == MAINGUI) {

//   Setting cursor modes:
//-----------------------------------------------------
    if (button == 0)  SetMode(GIVE);    ( <-- line 76)
    if (button == 1)  SetMode(PICKUP);
    if (button == 2)  SetMode(USE);
    if (button == 3)  SetMode(OPEN);
    if (button == 4)  SetMode(LOOK);
    if (button == 5)  SetMode(PUSH);
    if (button == 6)  SetMode(CLOSE);
    if (button == 7)  SetMode(TALK);
    if (button == 8 )  SetMode(PULL);
//-----------------------------------------------------
_______________________________________ _______________________

..It says "There was an error compliling your script. The problem was: In:'Global script'

Error(line 76): Undefined token 'SetMode'

Do you want to fix the script now?9Your game has not been saved."
_______________________________________ ________
ive been reading over loads of previous posts and i cant seem to work out what it is, if anyone coudl shed some light on this then it'd be most appreciated!Thanks!
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Ashen on 17 Sep 2006, 12:51
undefined token errors mean the thing you're trying to use (in this case the function SetMode) doesn't exist.
Are you using the template as-is, or have you copied some code over to another game? Since that's only line 76, I'd guess you're missing a whole lot of the template code before that point. NOTE: functions and variables have to have been created before - i.e. earlier in the script than - they're used, so if the declaration for SetMode is there, but starts at line 90, you'd still get that error.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: on 17 Sep 2006, 13:10
yeah i copied exported the code, then imported it into my own one, do you know at all what i am missing from my script then? would it be difficult to fix?

// main global script file

#sectionstart game_start  // DO NOT EDIT OR REMOVE THIS LINE
function game_start() {
  // called when the game starts, before the first room is loaded
}
#sectionend game_start  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute() {
  // put anything you want to happen every game cycle here
}
#sectionend repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE


function show_inventory_window () {
  // This demonstrates both types of inventory window - the first part is how to
  // show the built-in inventory window, the second part uses the custom one.
  // Un-comment one section or the other below.
 
  // ** DEFAULT INVENTORY WINDOW
//  InventoryScreen();

  // ** CUSTOM INVENTORY WINDOW
  // switch to the Use cursor (to select items with)
  mouse.Mode = eModeInteract;
  // But, override the appearance to look like the arrow
  mouse.UseModeGraphic(eModePointer);

}

#sectionstart on_key_press  // DO NOT EDIT OR REMOVE THIS LINE
function on_key_press(int keycode) {
  // called when a key is pressed. keycode holds the key's ASCII code
  if (IsGamePaused() == 1) keycode=0;  // game paused, so don't react to keypresses
  if (keycode==17)  QuitGame(1);   // Ctrl-Q
  if (keycode==363) SaveGameDialog();   // F5
  if (keycode==365) RestoreGameDialog();  // F7
  if (keycode==367) RestartGame();  // F9
  if (keycode==434) SaveScreenShot("scrnshot.bmp");  // F12
  if (keycode==9)   show_inventory_window();  // Tab, show inventory

  if (keycode==19)  Debug(0,0);  // Ctrl-S, give all inventory
  if (keycode==22)  Debug(1,0);  // Ctrl-V, version
  if (keycode==1)   Debug(2,0);  // Ctrl-A, show walkable areas
  if (keycode==24)  Debug(3,0);  // Ctrl-X, teleport to room
}
#sectionend on_key_press  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart on_mouse_click  // DO NOT EDIT OR REMOVE THIS LINE
function on_mouse_click(MouseButton button) {
  // called when a mouse button is clicked. button is either LEFT or RIGHT
  if (IsGamePaused() == 1) {
    // Game is paused, so do nothing (ie. don't allow mouse click)
  }
  else if (button == eMouseLeft) {
    ProcessClick(mouse.x, mouse.y, mouse.Mode );
  }
  else {   // right-click, so cycle cursor
    mouse.SelectNextMode();
  }
}
#sectionend on_mouse_click  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart interface_click  // DO NOT EDIT OR REMOVE THIS LINE
function interface_click(int interface, int button) {

  String buffer;
  if (interface == MAINGUI) {

//   Setting cursor modes:
//-----------------------------------------------------
    if (button == 0)  SetMode(GIVE);
    if (button == 1)  SetMode(PICKUP);
    if (button == 2)  SetMode(USE);
    if (button == 3)  SetMode(OPEN);
    if (button == 4)  SetMode(LOOK);
    if (button == 5)  SetMode(PUSH);
    if (button == 6)  SetMode(CLOSE);
    if (button == 7)  SetMode(TALK);
    if (button == 8 )  SetMode(PULL);
//-----------------------------------------------------

//   Scrolling the inventory:
//-----------------------------------------------------
    if ((button == 10))
      MainInventory.ScrollDown();
    if ((button == 9))
      MainInventory.ScrollUp();
    }
//-----------------------------------------------------

//   Options GUI
//-----------------------------------------------------
 if (interface == OPTIONS) {
    if (button == 0){ //save game
      gOptions.Visible=0;
      GetLucasSavegameListBox(SAVE,1); // fills listbox 1 on gui SAVE with saved games
      gSave.Visible=1;
      }
    if (button == 1){ //load game
      gOptions.Visible=0;
      GetLucasSavegameListBox(RESTORE,1);
      gRestore.Visible=1;
      }
    if (button == 2){ // continue playing
      gOptions.Visible=0;
      }
    if (button == 3){ // exit??
      gConfirmexit.Visible=1;
      }
    }
//-----------------------------------------------------

//   Restore game GUI
//-----------------------------------------------------
 if (interface == RESTORE) {
    if (button ==2) gRestore.Visible=0; //cancel
    if (button ==1){ //click on listbox item
       int index = gRestore.Controls[1].AsListBox.SelectedIndex;
       buffer=Game.GetSaveSlotDescription(index+100);
       if (buffer!=null){ //if there is a savegame here
         gRestore.Visible=0;
         RestoreGameSlot(index+100);
        }
       }     
    if (button == 3){ //scroll up
         if (GStopsaveitem<5) GStopsaveitem=0;
         else GStopsaveitem-=5;
         gRestore.Controls[1].AsListBox.TopItem=GStopsaveitem;
      }
    if (button == 4 && GStopsaveitem<90) //scroll down
      GStopsaveitem+=5;
         gRestore.Controls[1].AsListBox.TopItem=GStopsaveitem;
    }
//-----------------------------------------------------

//   Save game GUI
//-----------------------------------------------------

 if (interface == SAVE){
    int index=gSave.Controls[1].AsListBox.SelectedIndex;
    if (button == 3){//cancel
      gSave.Visible=0;
      gSavetextbox.Visible=0;
    }
    if (button == 1){ //click on listbox
     int stbypos;
      gSavetextbox.Controls[1].AsLabel.Text=String.Format("%d", index+1);
      buffer=Game.GetSaveSlotDescription(index+100);
      if (buffer==null) buffer="";//GetSaveSlotDescription(index+100,buffer);
       gSavetextbox.Controls[0].AsTextBox.Text=buffer;
     stbypos=28+((index-GStopsaveitem)*(DEFAULT_FONT_HEIGHT+2)); //28 is set by trial-error. Deppends of the savegames listbox position
     if (index<9) { gSavetextbox.Controls[0].X=12; gSavetextbox.Controls[0].Y=0; }
     else { gSavetextbox.Controls[0].X=18; gSavetextbox.Controls[0].Y=0; }
     gSavetextbox.X=29;
     gSavetextbox.Y=stbypos;
     gSavetextbox.Visible=1;
    }
    if (button == 2 && index>=0) { //save
      buffer=gSavetextbox.Controls[0].AsTextBox.Text;
      gSave.Visible=0;
      gSavetextbox.Visible=0;
      SaveGameSlot(index+100,buffer);
    }
    if (button == 4){// scroll up
       gSavetextbox.Visible=0;
       gSave.Controls[1].AsListBox.SelectedIndex=-1;
         if (GStopsaveitem<5) GStopsaveitem=0;
         else GStopsaveitem-=5;
          gSave.Controls[1].AsListBox.TopItem=GStopsaveitem;
    }
    if (button == 5 && GStopsaveitem<90){ //scroll down
       gSavetextbox.Visible=0;
       gSave.Controls[1].AsListBox.SelectedIndex=-1;
       GStopsaveitem+=5;
          gSave.Controls[1].AsListBox.TopItem=GStopsaveitem;
    }
  }
 if (interface == SAVETEXTBOX){
    int index=gSave.Controls[1].AsListBox.SelectedIndex;
    if (button == 0){
      buffer=gSavetextbox.Controls[0].AsTextBox.Text;
      gSave.Visible=0;
      gSavetextbox.Visible=0;
      SaveGameSlot(index+100,buffer);
    }
    if (mouse.IsButtonDown(eMouseRight)) gSavetextbox.Visible=0;
 }
//-----------------------------------------------------

    }
#sectionend interface_click  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart btnInvUp_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnInvUp_Click(GUIControl *control, MouseButton button) {
  invCustomInv.ScrollUp();
}
#sectionend btnInvUp_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnInvDown_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnInvDown_Click(GUIControl *control, MouseButton button) {
  invCustomInv.ScrollDown();
}
#sectionend btnInvDown_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnInvOK_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnInvOK_Click(GUIControl *control, MouseButton button) {
 
   // They pressed the OK button, close the GUI
   gInventory.Visible = false;
   mouse.UseDefaultGraphic();
}
#sectionend btnInvOK_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnInvSelect_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnInvSelect_Click(GUIControl *control, MouseButton button) {
 
   // They pressed SELECT, so switch to the Get cursor
   mouse.Mode = eModeInteract;
   // But, override the appearance to look like the arrow
   mouse.UseModeGraphic(eModePointer);
}
#sectionend btnInvSelect_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnIconInv_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnIconInv_Click(GUIControl *control, MouseButton button) {
 
  show_inventory_window();
}
#sectionend btnIconInv_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnIconCurInv_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnIconCurInv_Click(GUIControl *control, MouseButton button) {
 
  if (player.ActiveInventory != null)
    mouse.Mode = eModeUseinv;
}
#sectionend btnIconCurInv_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnIconSave_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnIconSave_Click(GUIControl *control, MouseButton button) {
 
  SaveGameDialog();
}
#sectionend btnIconSave_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnIconLoad_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnIconLoad_Click(GUIControl *control, MouseButton button) {
 
  RestoreGameDialog();
}
#sectionend btnIconLoad_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnIconExit_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnIconExit_Click(GUIControl *control, MouseButton button) {
 
  QuitGame(1);
}
#sectionend btnIconExit_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnIconAbout_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnIconAbout_Click(GUIControl *control, MouseButton button) {
 
  Display("Adventure Game Studio v2 run-time engine[[Copyright (c) 1999-2005 Chris Jones");
}
#sectionend btnIconAbout_Click  // DO NOT EDIT OR REMOVE THIS LINE



much appreciated thanks!
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Khris on 21 Sep 2006, 10:23
By default, there's no SetMode function in AGS, nor does AGS know what GIVE means.
Exporting and importing a short bit of code from the template won't work at all, I'm afraid. You'd have to sort out exactly which portions are needed and copy over all of them.

Why don't you just use the complete template and alter it to fit your needs?
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Lazarus on 15 Nov 2006, 12:18
Hi I'm having a go with updating the DOTT template to use with ags 2.72, I'm wanting to use the enforce object based scripting and enforce new style strings and was wondering how you upate the following code.
Code: [Select]
function SetPlayer(int charid){
  //use this instead of SetPlayerCharacter function for switching to other players
  int counter=1;
  while (counter<MAX_PLAYERS){
    if (charid==Tposition[counter].charac){
      SetButtonPic(MAINGUI,Tposition[counter].smallpicbutton,1,Tplayer[GetPlayerCharacter()].smallpic);
      Tposition[counter].charac=GetPlayerCharacter();
    }
    SetButtonPic(MAINGUI,Tposition[counter].smallpicbevelbutton,1,Tplayer[charid].smallpicbevel);
    counter++;
  }
  Tposition[0].charac=charid;
  counter=0;   
  while (counter<MAX_MODES){
    if (Tmode[counter].button[charid]>=0) SetButtonPic(MAINGUI,Tmode[counter].button[charid],2,Tmode[counter].highlightedbutton[charid]);
    counter++;
  }
  SetLabelColor(ACTION,0,Tplayer[charid].actionlabelcolor);

  Tplayer[GetPlayerCharacter()].topinvitem=game.top_inv_item;
  if (Tplayer[charid].topinvitem>=0) game.top_inv_item=Tplayer[charid].topinvitem;

  SetCharacterClickable(GetPlayerCharacter(),1);
  SetCharacterClickable(charid,0);
  StopMoving(GetPlayerCharacter());
  SetPlayerCharacter(charid);
  SetMode(DEFAULT);

}

I get an error with the "SetButtonPic" undefined token.
Any help would be grateful
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Ashen on 15 Nov 2006, 12:46
The error (as you can probably guess) means you're trying to use an old-style command (SetButtonPic) which is now obsolete. (Leaving 'Enforce object-based scripting' unchecked tells AGS it can still use the obsolete functions, but you're right that it's better to phase them out.)

You can use the manual to help you with this type of error - select the old command in the 'Index' tab, and you should be taken to the OO equivilant. In this case, there are three properties that replace it: Button.NormalGraphic, Button.MouseOverGraphic and Button.PushedGraphic, depending on the which parameter (the 3rd one) used in the SetButtonPic commands.
1 = NormalGraphic, 2 = MouseOver, 3 = Pushed.

Code: [Select]
SetButtonPic(MAINGUI,Tposition[counter].smallpicbutton,1,Tplayer[GetPlayerCharacter()].smallpic);

which = 1, so that would be:
Code: [Select]
gMaingui.Controls[Tposition[counter].smallpicbutton].AsButton.NormalGraphic = Tplayer[player.ID].smallpic; // 'GetPlayerCharacter()' is also obsolete

You might be better changing the Tposition[counter].smallpicbutton variable to a Button pointer, allowing the slightly shorter:
Code: [Select]
Tposition[counter].smallpicbutton.NormalGraphic = Tplayer[player.ID].smallpic;
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Lazarus on 16 Nov 2006, 09:43
I tried your shortened version of
Code: [Select]
Tposition[counter].smallpicbutton.NormalGraphic = Tplayer[player.ID].smallpic;
and this gave an error stating NormalGraphic is not a member of "int". So I used your second version which seems to work.

My next problem is with this code
Code: [Select]
if (Tmode[counter].button[charid]>=0) SetButtonPic(MAINGUI,Tmode[counter].button[charid],2,Tmode[counter].highlightedbutton[charid]);
I've tried this code below, but I get a Parse error in expr near "Tmode"
Code: [Select]
if (Tmode[counter].button[charid]>=0) gMaingui.Controls[Tmode[counter].button[charid]].AsButton.MouseOverGraphic = Tmode[counter].highlightedbutton[charid]);
I know I'm missing something but I cannot see it

*Edit*
Also would I be right with changing
Code: [Select]
  SetLabelColor(ACTION,0,Tplayer[charid].actionlabelcolor);

  Tplayer[GetPlayerCharacter()].topinvitem=game.top_inv_item;
  if (Tplayer[charid].topinvitem>=0) game.top_inv_item=Tplayer[charid].topinvitem;

  SetCharacterClickable(GetPlayerCharacter(),1);
  SetCharacterClickable(charid,0);
  StopMoving(charid);
  SetPlayerCharacter(charid);
To this
Code: [Select]
  labelStatus.TextColor = Tplayer[charid].actionlabelcolor;

  Tplayer[charid].topinvitem=MainInventory.TopItem;// MainInventory script name.
  if (Tplayer[charid].topinvitem>=0) MainInventory.TopItem=Tplayer[charid].topinvitem;

  character[player.ID].Clickable = 1;// Yes
  character[charid].Clickable = 0;   // No
  player.StopMoving();
  character[charid].SetAsPlayer();
  SetMode(DEFAULT);
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Ashen on 16 Nov 2006, 11:16
Quote
I tried your shortened version of
...
and this gave an error stating NormalGraphic is not a member of "int". So I used your second version which seems to work.

Did you also change smallpicbutton variable (in the struct the Tposition refers to) into a Button pointer? If so, it makes no sense that the 'short' version doesn't work, and the 'long' version does. If not - there's your problem. There's no real need to do it that way, it'll just save a little bit of typing, and make the code look a little more OO-like.

Code: [Select]
My next problem is with this code
...
I've tried this code below, but I get a Parse error in expr near "Tmode"
...
I know I'm missing something but I cannot see it

It looks like you've got a stray ) at the end of the line - Tmode[counter].highlightedbutton[charid]);.

Quote
Also would I be right with changing
...
To this

Looks good, but:
Code: [Select]
  Tplayer[charid].topinvitem=MainInventory.TopItem;// MainInventory script name.
The original line uses GetPlayerCharacter, so shouldn't that be:
Code: [Select]
  Tplayer[player.ID].topinvitem=MainInventory.TopItem;// MainInventory script name.

And:
Code: [Select]
  character[player.ID].Clickable = 1;// Yes
Would work fine, but why not just:
Code: [Select]
  player.Clickable = 1;// Yes
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Lazarus on 17 Nov 2006, 09:10
Great that fixed that problem.
Now my next problem seems to be with the new "Strings" commands.
I have this code and it's saying "undefined token GetInvName"
here's the function in question
Code: [Select]
function GiveInv(int invitem, int charid){
  String invname;
  GetInvName(invitem,invname);

  character[charid].inv[invitem]=character[GetPlayerCharacter()].inv[invitem];
  character[GetPlayerCharacter()].inv[invitem]=0;
  UpdateInventory();
  character[GetPlayerCharacter()].activeinv=invitem;

  GSloctype=0;
  RunCharacterInteraction(charid, MODE_USEINV);
}
Also would I be right with using this code?
Code: [Select]
  character[charid].inv[invitem]=player.ID.inv[invitem];
  player.ID.inv[invitem]=0;
  UpdateInventory();
  player.ID.activeinv=invitem;
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: SSH on 17 Nov 2006, 09:15
Err, the invname is not actually being used at all so that code is redundant anyway.

and character[GetPlayerCharacter()] can just be replaced by player
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Lazarus on 17 Nov 2006, 09:32
How do you mean? just leave out "invname" or the whole function?
If it's just the "invname" do you mean so that all that is left would be something like
Code: [Select]
function GiveInv(int invitem, int charid){
  character[charid].inv[invitem]=player.ID.inv[invitem];
  player.ID.inv[invitem]=0;
  UpdateInventory();
  player.ID.activeinv=invitem;

  GSloctype=0;
  RunCharacterInteraction(charid, MODE_USEINV);
}
*Edit*
As this is also linked to this function
Code: [Select]
function GiveInvChronOJohn(int invitem, int charid){
  String invname;
  GetInvName(invitem, invname);
  if (ExtensionEx(3,invname)!='d') {
    GSmode=GIVECHRON;
    GSusedmode=GIVECHRON;
    SetGraphicalVariable("Used Mode", GIVECHRON);
    GiveInv(invitem, charid);
    SetMode(DEFAULT);
  }
  else {
  //you could put here different messages or actions for different items when the player
  //tries to give them via the chron-o-john (i.e. the little icons in the GUI)
  //and it doesnt do the default behaviour (giving the item), because the second extension of
  //that inventory item is 'd'.
    if (invitem==2) Display("The hamster wouldn't survive to a Chron-O-John travel");//if tried to give the hamster
    else Display ("I think i can't put that in the Chron-O-John"); //generic message
  }
}
which would be the next problem.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: SSH on 17 Nov 2006, 10:06
ew, this code looks a real mess. I'd rewrite it from scratch... ;)

Code: [Select]
function GiveInv(InventoryItem *invitem, Character *charid){
  charid.InventoryQuantity[invitem.ID]=player.InventoryQuantity[invitem.ID];
  player.InventoryQuantity[invitem.ID]=0;
  UpdateInventory();
  player.ActiveInventory=null;

  GSloctype=0;
  charid.RunInteraction(eModeUseInv);
}
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Lazarus on 20 Nov 2006, 09:34
How would I change this function as it is also linked with the "function GiveInv(InventoryItem *invitem, Character *charid){"

Code: [Select]
function GiveInvChronOJohn(int invitem, int charid){
  String invname;
  GetInvName(invitem, invname);
  if (ExtensionEx(3,invname)!='d') {
    GSmode=GIVECHRON;
    GSusedmode=GIVECHRON;
    SetGraphicalVariable("Used Mode", GIVECHRON);
    GiveInv(invitem, charid);
    SetMode(DEFAULT);
  }
  else {
  //you could put here different messages or actions for different items when the player
  //tries to give them via the chron-o-john (i.e. the little icons in the GUI)
  //and it doesnt do the default behaviour (giving the item), because the second extension of
  //that inventory item is 'd'.
    if (invitem==2) Display("The hamster wouldn't survive to a Chron-O-John travel");//if tried to give the hamster
    else Display ("I think i can't put that in the Chron-O-John"); //generic message
  }
}

Thanks in advance
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: SSH on 20 Nov 2006, 10:06
Code: [Select]
function GiveInvChronOJohn(InventoryItem *invitem, Character *charid){
  if (ExtensionEx(3,invitem.Name)!='d') {
    GSmode=GIVECHRON;
    GSusedmode=GIVECHRON;
    SetGraphicalVariable("Used Mode", GIVECHRON);
    GiveInv(invitem, charid);
    SetMode(DEFAULT);
  }
  else {
  //you could put here different messages or actions for different items when the player
  //tries to give them via the chron-o-john (i.e. the little icons in the GUI)
  //and it doesnt do the default behaviour (giving the item), because the second extension of
  //that inventory item is 'd'.
    if (invitem.ID==2) Display("The hamster wouldn't survive to a Chron-O-John travel");//if tried to give the hamster
    else Display ("I think i can't put that in the Chron-O-John"); //generic message
  }
}
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Lazarus on 20 Nov 2006, 11:41
Thanks SSH
I've been using your code from MI2 template into this template hope you don't mind.

My next problem is with
Code: [Select]
function GlobalConditionEx(int parameter, int roomx, int roomy){
// here are some conditions that are used many times in the script
  if (parameter==1){//if the mouse is in the inventory and modes Walk or pickup are selected
    return ( GetInvAt(roomx-GetViewportX(),roomy-GetViewportY())>=0 && (GetAGSMode(GetMode())==9 || GetAGSMode(GetMode())==5) );
  }
  else if (parameter==2){//if the mode is useinv and the mouse is over the active inv (like "use knife on knife")
    return (character[GetPlayerCharacter()].activeinv==GetInvAt(mouse.x,mouse.y) && GetAGSMode(GetMode())==4);
  }
  else if (parameter==3){//if the mode is talk, or "Give", and the mouse isnt over a character
    return (   (GetAGSMode(GetMode())==MODE_TALK || (Mode(GIVE) && GetAGSMode(GIVE)==4) ) && GetLocationType(roomx-GetViewportX(),roomy-GetViewportY())!=2  );
  }
  else if (parameter==4){//if its a 'only inventory' mode (like GIVE), and the mouse isnt over a inv.item
    return (GetAGSMode(GetMode())==MODE_USE && Tmode[GSmode].onlyinv==1 && GetInvAt(mouse.x,mouse.y)<0);
  }
  else if (parameter==5){
    int counter=1;
    while (counter<MAX_PLAYERS){
      if (GetGUIAt(mouse.x,mouse.y)==MAINGUI && GetGUIObjectAt(mouse.x,mouse.y)==Tposition[counter].smallpicbevelbutton) return 1;
      counter++;
    }
    return 0;
  }
}
And I sort of ended up with this which I think is probably not right, haven't tried parameter 5 yet.
Code: [Select]
function GlobalConditionEx(int parameter, int roomx, int roomy){
// here are some conditions that are used many times in the script
  InventoryItem *ii=InventoryItem.GetAtScreenXY(mouse.x,mouse.y);
  if (parameter==1){//if the mouse is in the inventory and modes Walk or pickup are selected
    return ( ii!=null && (roomx-GetViewportX(),roomy-GetViewportY())>=0 && (GetAGSMode(GetMode())==9 || (GetAGSMode(GetMode())==5) );
  }
  else if (parameter==2){//if the mode is useinv and the mouse is over the active inv (like "use knife on knife")
    return (player.ActiveInventory==ii && GetAGSMode(GetMode())==4);
  }
  else if (parameter==3){//if the mode is talk, or "Give", and the mouse isnt over a character
    return (   (GetAGSMode(GetMode())==eModeTalkto || (Mode(GIVE) && GetAGSMode(GetMode())==4) ) && GetLocationType(roomx-GetViewportX(),roomy-GetViewportY())!=2  );
  }
  else if (parameter==4){//if its a 'only inventory' mode (like GIVE), and the mouse isnt over a inv.item
    return (GetAGSMode(GetMode())==eModeUse && Tmode[GSmode].onlyinv==1 && ii==null);
  }
  else if (parameter==5){
    int counter=1;
    while (counter<MAX_PLAYERS){
      if (GetGUIAt(mouse.x,mouse.y)==MAINGUI && GetGUIObjectAt(mouse.x,mouse.y)==Tposition[counter].smallpicbevelbutton) return 1;
      counter++;
    }
    return 0;
  }
}

function GlobalCondition(int parameter){
  return GlobalConditionEx(parameter, mouse.x+GetViewportX(), mouse.y+GetViewportY());
}

*EDIT*
Just realised that maybe parameter 1 could be
Code: [Select]
  if (parameter==1){//if the mouse is in the inventory and modes Walk or pickup are selected
    return ( ii!=null && (GetAGSMode(GetMode())==9 || GetAGSMode(GetMode())==5) );
Just need help with parameter 5

any help would be grateful thanks again.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Ashen on 20 Nov 2006, 13:39
This should work:
Code: [Select]
  else if (parameter==5){
    int counter=1;
    while (counter < MAX_PLAYERS){
      if (GUIControl.GetAtScreenXY(mouse.x, mouse.y) == gMaingui.Controls[Tposition[counter].smallpicbevelbutton]) return 1;
      counter++;
     }
    return 0;
  }

Unless you've made smallpicbevelbutton into a Button pointer, in which case you'd use if (GUIControl.GetAtScreenXY(mouse.x, mouse.y) == Tposition[counter].smallpicbevelbutton).
The other thing is MAX_PLAYERS - I guess that's #define'd in the script somewhere? You might be able to replace it with Game.CharacterCount - don't hold me to that as I'm not sure what it does.

Have you tried the manual, like I suggested? All the new commands you need are in there.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Lazarus on 21 Nov 2006, 08:47
Thanks Ashen
Yes MAX_PLAYERS is defined with this
Code: [Select]
#define MAX_PLAYERS 3//Put here how many player characters your game has
My next problem, am I right with turning this
Code: [Select]
if (Tposition[counter].smallpicbevelbutton==GetGUIObjectAt(mouse.x,mouse.y) ){
into this
Code: [Select]
if (gMaingui.Controls[Tposition[counter].smallpicbevelbutton]){

If this is okay then would this
Code: [Select]
  string buffer;
  string madetext;
  int mode;
  mode=GSmode;

if (Tposition[counter].smallpicbevelbutton== GUIControl.GetAtScreenXY(mouse.x, mouse.y){
 GetInvName(character[GetPlayerCharacter()].activeinv,buffer);
 RemoveExtension(buffer);
 StrFormat(madetext,"%s %s %s %s",Tmode[GIVE].name,buffer,Tmode[GIVE].preposition,character[Tposition[counter].charac].name);
 }

turn into this?
Code: [Select]
  String buffer;
  String madetext;
  int mode;
  mode=GSmode;

if (gMaingui.Controls[Tposition[counter].smallpicbevelbutton] ){
 madetext=String.Format("%s %s %s %s", madetext, Tmode[GIVE].name, RemoveExtension(player.ActiveInventory.Name), Tmode[mode].preposition);
}
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Lazarus on 23 Nov 2006, 10:12
I'm assuming my last code is okay, as I would like to check that this next function is right.
Here's the original
Code: [Select]
function WalkOffScreen(){
 //handles the action of hotspots with exit extension ('>e' by default).
 //double click in such hotspots/objects... will make the player skip
 //walking to it. Look the documentation for more information on exits.
  if (IsTimerExpired(19)==1){
    SetTimer(19,GetGameSpeed()/3);
    if (Go()){
      int x=character[GetPlayerCharacter()].x,y=character[GetPlayerCharacter()].y;

      int offset=30;
      int dir=ExtensionEx(2,GSlocname);
      if      (dir=='u') y-=offset;
      else if (dir=='d') y+=offset;
      else if (dir=='l') x-=offset;
      else if (dir=='r') x+=offset;
      if (MovePlayerEx(x,y,1)==1)
        RunHotspotInteraction(GSlocid,9);
    }
  }
  else RunHotspotInteraction(GSlocid,9);
}

And here's mine.
Code: [Select]
function WalkOffScreen(){

  if (IsTimerExpired(19)==1){
    SetTimer(19,GetGameSpeed()/3);
    if (Go()){
      int x=character[player.ID].x,y=character[player.ID].y;// <---Here

      int offset=30;
      int dir=ExtensionEx(2,GSlocname);
      if      (dir=='u') y-=offset;
      else if (dir=='d') y+=offset;
      else if (dir=='l') x-=offset;
      else if (dir=='r') x+=offset;
      if (MovePlayerEx(x,y,1)==1)
       hotspot[GSlocid].RunInteraction(9);//<---Here
    }
  }
  else hotspot[GSlocid].RunInteraction(9);//<---Here
}

*Edit*
My next problem is with
Code: [Select]
  else if (button==eMouseLeft || button==eMouseRight) {

    string invname;
    if (character[GetPlayerCharacter()].activeinv>=0) GetInvName(character[GetPlayerCharacter()].activeinv, invname);
    if (button==eMouseRight) SetMode(GetDefaultAction(mouse.x,mouse.y));// set the default mode when right click
   
    if (Extension(GSlocname)==EXITS_EXTENSION){// if its an 'exit'
        HighlightActionBar();
        WalkOffScreen();
    }
    // automatically give items to other player characters:
    else if (ALWAYS_GIVE_ITEMS_TO_PLAYERS==1 && ExtensionEx(2,invname)!='d' && Mode(GIVE) && GetAGSMode(GIVE)==4 && GSloctype==2 && GSlocid<MAX_PLAYERS){
      if (GoToCharacter(GSlocid,0,1,2)){
       GiveInv(character[GetPlayerCharacter()].activeinv,GSlocid);
        SetMode(DEFAULT);
      }
    }

I've tried this but doesn't work
Code: [Select]
  else if (button==eMouseLeft || button==eMouseRight) {
if (player.ActiveInventory>=0) player.ActiveInventory.Name;//<---here
    if (button==eMouseRight) SetMode(GetDefaultAction(mouse.x,mouse.y));// set the default mode when right click
   
    if (Extension(GSlocname)==EXITS_EXTENSION){// if its an 'exit'
        HighlightActionBar();
        WalkOffScreen();
    }
    // automatically give items to other player characters:
    else if (ALWAYS_GIVE_ITEMS_TO_PLAYERS==1 && ExtensionEx(2,invname)!='d' && Mode(GIVE) && GetAGSMode(GIVE)==4 && GSloctype==2 && GSlocid<MAX_PLAYERS){
      if (GoToCharacter(GSlocid,0,1,2)){
       GiveInv(character[GetPlayerCharacter()].activeinv,GSlocid);
        SetMode(DEFAULT);
      }
    }
And how would I change
Code: [Select]
GiveInv(character[GetPlayerCharacter()].activeinv,GSlocid);
As I think it is linking to the function
Code: [Select]
function GiveInv(InventoryItem *invitem, Character *charid){

Thanks in advance
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Grue on 23 Nov 2006, 17:42
Is there a Maniac Mansion/Zak McKracken GUI (original) which I can download as it seems that I have grown fond of playing with that interface more with the later SCUMM interfaces?
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: on 27 Nov 2006, 02:12
I am not sure if this is possible, but i downloaded the MI2 LucasArts GUI as a part of this thread.  I have already poked around and see that i can change the look and feel and what not, but am curious about one thing.  I would like to create a game with two seperate players, but i want one to be controlled by the LucasArts GUI and the other by the default (Sierra Style) GUI.  Is this possible, or has someone done this?  Thanks in Advance.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: SSH on 27 Nov 2006, 12:42
It's possible, and I don't think anyone has done it. You'd need to put code like:

if (player==cLucasguy) {
  //Do stuff as in MI2 template
} else {
  // Do stuff from Default game
}

in each of the global functions like on_mouse_click...
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Lazarus on 29 Nov 2006, 12:03
Would I be right with turning this
Code: [Select]
GiveInv(character[GetPlayerCharacter()].activeinv,GSlocid);
into this as the function is now
GiveInv(InventoryItem *invitem, Character *charid)
Code: [Select]
GiveInv(invitem, charid);

and my next question is with this code
Code: [Select]
if (character[GetPlayerCharacter()].activeinv>=0) GetInvName(character[GetPlayerCharacter()].activeinv, invname);
I've tried this
Code: [Select]
if (player.ActiveInventory>=0) player.ActiveInventory.Name;
but it's not working any helk would be grateful
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Ashen on 30 Nov 2006, 21:51
Code: [Select]
GiveInv(invitem, charid);
There's no obvious reason that shouldn't work, provided invitem and charid are both valid pointers of the right type. Except, there might be a problem using pointers with the same names as those used in the function declaration (the XXX is a global var, cannot use as name for a local error is a possibility). Unless that was just psuedocode?

Code: [Select]
if (player.ActiveInventory>=0) player.ActiveInventory.Name;
For this - you don't actually seem to be doing anything with player.ActiveInventory.Name, so it's no wonder nothing's happening. What about using:
Code: [Select]
if (player.ActiveInventory>=0) invname = player.ActiveInventory.Name;

invname is the string (old-style) used in the original example, change it if you've got a different name for the String (new style).
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Lazarus on 04 Dec 2006, 08:33
I get an error saying "cannot convert inventoryitem to int" here's the original

Code: [Select]
  else if (button==eMouseLeft || button==eMouseRight) {

    string invname;
    if (character[GetPlayerCharacter()].activeinv>=0) GetInvName(character[GetPlayerCharacter()].activeinv, invname);

    if (button==eMouseRight) SetMode(GetDefaultAction(mouse.x,mouse.y));// set the default mode when right click
   
    if (Extension(GSlocname)==EXITS_EXTENSION){// if its an 'exit'
        HighlightActionBar();
        WalkOffScreen();
    }
    // automatically give items to other player characters:
    else if (ALWAYS_GIVE_ITEMS_TO_PLAYERS==1 && ExtensionEx(2,invname)!='d' && Mode(GIVE) && GetAGSMode(GIVE)==4 && GSloctype==2 && GSlocid<MAX_PLAYERS){
      if (GoToCharacter(GSlocid,0,1,2)){

       GiveInv(character[GetPlayerCharacter()].activeinv,GSlocid);

        SetMode(DEFAULT);
      }
    }
// ---------------------------------------------------
    else if (ALWAYS_GO_TO_HOTSPOTS==1 && ExtensionEx(2,GSlocname)!='d' && GetLocationType(mouse.x,mouse.y)!=0 ){
       UpdateActionBar(mrx,mry);
       HighlightActionBar();
       if (Go()==1) ProcessAction(GetMode(),mrx,mry);
       return;
    }
    else ProcessAction(GetMode(),mrx,mry);
  }

And here's what I have so far, I had to also add
Character *charid;
InventoryItem *invitem;
As I got an undefined token with the "GiveInv(invitem, charid);"
Code: [Select]
  else if (button==eMouseLeft || button==eMouseRight) {

    String invname;
    if (player.ActiveInventory>=0) invname = player.ActiveInventory.Name;


    if (button==eMouseRight) SetMode(GetDefaultAction(mouse.x,mouse.y));// set the default mode when right click
   
    if (Extension(GSlocname)==EXITS_EXTENSION){// if its an 'exit'
        HighlightActionBar();
        WalkOffScreen();
    }
    // automatically give items to other player characters:
    else if (ALWAYS_GIVE_ITEMS_TO_PLAYERS==1 && ExtensionEx(2,invname)!='d' && Mode(GIVE) && GetAGSMode(GIVE)==4 && GSloctype==2 && GSlocid<MAX_PLAYERS){
      if (GoToCharacter(GSlocid,0,1,2)){

Character *charid;
InventoryItem *invitem;
       GiveInv(invitem, charid);

        SetMode(DEFAULT);
      }
    }
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Ashen on 04 Dec 2006, 12:08
Well, in that example invitem and charid aren't actually pointing to anything so you might still get a 'null pointer' error from it.

From the original:
Code: [Select]
GiveInv(character[GetPlayerCharacter()].activeinv,GSlocid);

character[GetPlayerCharacter()].activeinv can be replaced with player.ActiveInventory.

GSlocid looks like it's still an int so you could probably replace that with:
character[GSlocid]

Also, from the new version:
Code: [Select]
if (player.ActiveInventory>=0)

I missed this before but since ActiveInventory is an InvItem pointer and not an int, that might need to be:
Code: [Select]
if (player.ActiveInventory.ID>=0)

Or:
Code: [Select]
if (player.ActiveInventory!=null)

Of course, if it works as-is, then don't worry about it.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Lazarus on 05 Dec 2006, 08:59
I've tried both examples you suggested and both give the same error "null pointer reference" on mouse click.
This happens as soon as I click anywhere on the screen.

Here's the on mouse click
Code: [Select]
function on_mouse_click(int button) {////////////////////////////////////On Mouse Click///////////////On Mouse Click
  // called when a mouse button is clicked. button is either LEFT or RIGHT
 
// Store type, name and id# of what the player clicked
// on in global variables GSloctype,GSlocname & GSlocid:
//-----------------------------------------------------

 int mrx=mouse.x+GetViewportX(), mry=mouse.y+GetViewportY();
 GSloctype=GetLocationType(mouse.x,mouse.y);
 InventoryItem *ii=InventoryItem.GetAtScreenXY(mouse.x,mouse.y);
 if (GSloctype==1) {
   Hotspot *hh=Hotspot.GetAtScreenXY(mouse.x,mouse.y);
   GSlocid=hh.ID;
 } else if (GSloctype==2) {
   Character *cc=Character.GetAtScreenXY(mouse.x,mouse.y);
GSlocid=cc.ID;
 } else if (GSloctype==3) {
   Object *oo=Object.GetAtScreenXY(mouse.x,mouse.y);
GSlocid=oo.ID;
 } else if (ii!=null) {
GSlocid=ii.ID;
 }
 GSlocname=Game.GetLocationName(mouse.x,mouse.y);

//-----------------------------------------------------

 if (IsGamePaused() == 1) {
    // Game is paused, so do nothing (ie. don't allow mouse click)
  }

// Handling clicks in map rooms:
//-----------------------------------------------------
  else if (gMaps.Visible){// if map
    if (button==eMouseLeft){
      if (IsInteractionAvailable(mouse.x,mouse.y,eModeUse)) ProcessClick(mouse.x,mouse.y,eModeUse);
      else ProcessClick(mouse.x,mouse.y,0);
    }
  }//end if map
//-----------------------------------------------------

// Handling room clicks:
//-----------------------------------------------------
  else if (button==eMouseLeft || button==eMouseRight) {

    String invname;
    if (player.ActiveInventory!=null) invname = player.ActiveInventory.Name;

    if (button==eMouseRight) SetMode(GetDefaultAction(mouse.x,mouse.y));// set the default mode when right click
   
    if (Extension(GSlocname)==EXITS_EXTENSION){// if its an 'exit'
        HighlightActionBar();
        WalkOffScreen();
    }
    // automatically give items to other player characters:
    else if (ALWAYS_GIVE_ITEMS_TO_PLAYERS==1 && ExtensionEx(2,invname)!='d' && Mode(GIVE) && GetAGSMode(GIVE)==4 && GSloctype==2 && GSlocid<MAX_PLAYERS){
      if (GoToCharacter(GSlocid,0,1,2)){
        GiveInv(player.ActiveInventory,character[GSlocid]);

        SetMode(DEFAULT);
      }
    }
// ---------------------------------------------------
    else if (ALWAYS_GO_TO_HOTSPOTS==1 && ExtensionEx(2,GSlocname)!='d' && GetLocationType(mouse.x,mouse.y)!=0 ){
       UpdateActionBar(mrx,mry);
       HighlightActionBar();
       if (Go()==1) ProcessAction(GetMode(),mrx,mry);
       return;
    }
    else ProcessAction(GetMode(),mrx,mry);
  }


//-----------------------------------------------------

// Handling inventory clicks:
//-----------------------------------------------------
  else if (button == eMouseLeftInv || button==eMouseRightInv){//click in inventory
    if (button == eMouseLeftInv){
      if (GlobalCondition(1)) SetMode(SPECIAL_INV_MODE); //if walk or pickup mode in inventory
    }
    else if (button == eMouseRightInv){
      SetMode(GetDefaultAction(mouse.x,mouse.y));
    }
    ProcessInventoryAction(GSmode,GSlocid); 
  }

Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: on 21 Mar 2007, 00:15
I've been looking at proskritos'gui and it seems quite good. His monkey gui for AGS 2.72 works fine. However, his indy gui only works with 2.6x. IS tehre any way to convert it to AGS 2.72? and if not, is there any other gui for AGS 2.72 resembling indy4?
Title: LecScumm gui, 640x480 Re: LucasArts GUI Help Thread <2.71 Now Available)
Post by: on 25 Apr 2007, 00:27
[deleted]
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Khris on 25 Apr 2007, 08:06
Again, where did you put the code? More info needed.
Title: SOLVED Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: on 25 Apr 2007, 16:16
Code: [Select]
      StrCat(texty,"PULL ");}
    if (GetGlobalInt(10)==10) {
      StrCat(texty,"GIVE ");
      StrCat(texty, activeinvname);
      StrCat (texty, " TO ");}
    if (GetGlobalInt(10)==11) {
      StrCat(texty,"USE ");
      StrCat(texty, activeinvname);
      StrCat (texty, " WITH ");}
    StrCat (texty, placer);
    SetLabelText (0,10,texty);}
  else if (GetCursorMode()==MODE_WALK){ SetLabelText (0,10,"WALK TO @OVERHOTSPOT@");}
SetLabelColor (0,10,41736);}
function unhandled_event (int what, int type) {
  //all the unhandled_events for various things.
  if ((what==1)&&(type==8)) { //hotspot
         if (GetGlobalInt(10)==1){ DisplaySpeech (EGO, "I can't give that.");}

That's where the "unhandled" section begins

at the end of the script there is

Code: [Select]
// script for inventory1: Other click on inventory item
  if (GetGlobalInt(10)==8) DisplaySpeech (EGO, "Ish a key.");
  else unhandled_event (5,4);}
  //TOTALLY IMPORTANT. INCLUDE THE ABOVE LINE AFTER
  //EVERY INV ITEM YOU HAVE AN INTERACTION FOR.
#sectionend inventory1_a  // DO NOT EDIT OR REMOVE THIS LINE
export actinv; //for use in script header

EDIT: solved finally. Let me say: "fucking script".
Title: Inventory items appear in the wrong place
Post by: on 26 Apr 2007, 13:12
Lec SCUMM 1.5 adapted to a 640x480 game.

When the character pick the first object everything is fine.

Then the second (and 3rd and 4th, etc) is displayed in the middle of the successive two slots of the inventory, damn! The item itself works fine (i can use, look at it, etc.), it is just in a wrong position in the inventory...

I tried to search a function to solve this but had no luck...
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Ashen on 27 Apr 2007, 10:54
Sorry, don't quite understand the problem here.
So I'll make a suggestion based on what I think it is. Take a look at the optional addAtIndex parameter for Charatcter.AddInventory (http://www.adventuregamestudio.co.uk/manual/Character.AddInventory.htm).  That should allow you to add new items at whatever position you want. (Looking at the code, it may use the old AddInvetory command which won't allow this - if so, just replace it.)
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: on 28 Apr 2007, 01:54
Sorry, don't quite understand the problem here.
So I'll make a suggestion based on what I think it is.

What you think it was was really what i meant. Thank you!

Unfortunately it didn't work! Here's a picture that will surely help my rusty english

(http://img341.imageshack.us/img341/2748/lecguiqg2.jpg)

The two keys are both inventory objects (didn't draw the sprites yet). The second key should obviously be placed a little bit more left. I searched the globat script but with no fortune... Any help?
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Ashen on 28 Apr 2007, 14:07
It looks like you just need to adjust the Item sizes for the GUI Inventory window. Select it in the GUI editor, and change the 'Item width' and 'Item height' properties to match your Inventory item size. (It's also settable in Script (http://www.adventuregamestudio.co.uk/manual/InvWindow.ItemHeight.htm), but there shouldn't be any need for that, really).
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Gribbler on 19 Jul 2007, 22:13
Hi

Do you know maybe what's the best LucasArts style GUI available now? The one with the minimum glitches. I know there's good one by monkey_05_06. But which one woud you recommend guys? I assume you're the experts on the subject in this thread.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Scummbuddy on 19 Jul 2007, 23:59
Well, you can go ahead and use Proskrito's or monkey_05_06's but try to stick with the version of AGS that they were made for. I wouldn't suggest trying to fix them to work with the "latest and greatest" version of AGS, if you really don't need the added benefits of a new version. Not everyone here upgrades every time, just so you know.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Mats Berglinn on 26 Aug 2007, 19:11
You're right about that Scummbuddy. I'm one of these people.

Anyway, I've got a little problem with the DOTT template through use of AGS version 2.62. For some reason sometimes the marked Verb options on the interface sometimes be replaced with some other sprites (for example character sprites or inventory or objects). I've checked the scripts and the GUI part and they say that they're using the correct sprites. I strongly suspects that it's a somekind of bug.

I've tried to solve it by making copies of the sprites of the marked verbs, import those copies and change the sprites to those and delete the old ones. Sometimes it works, others it don't (it really doesn't work with the original blue cup however). I have absolutely no idea how to solve this. Do you?

EDIT:
Never mind about that strange bug, it just happened when I copy over room files and import exported characters. It doesn't happen if I start from scratch.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Scummbuddy on 26 Aug 2007, 20:43
Hmm, I don't know if I've run into this problem before, but it sure is an interesting one. I will fire up my version and see about replicating it.

Does it really randomly pick either an object/character/inventory object, or is it really just one of these? Well, actually, I guess I could see how it is making a mistake pointing to a specific sprite in the sprite manager. What happens when you hover over the "broken" verb? Does it point to the correct highlighted verb, or to a different sprite, which it thinks is the highlighted version of the correct verb? This could be the point of the bug. Anyways, again, I'll take a look.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Dervish on 24 Sep 2007, 07:01
I am using a Proskritos Monkey island gui and cannot seem to get my Talk, Push, Pull, Open, and Close icons to function.  Does it require seperate scripting? NEVERMIND... I read through the rest of the posts and figured it out
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: sentient on 22 Dec 2007, 21:07
Hello, I have recently reloaded AGS on my system with the creative urge to play around. I am hoping to do a monkey island style game but am struggling to find one of these GUI's everyone here keeps mentioning. I have looked and searched the forum but cannot find any to download. Is there one available? I am using AGS to try to make creating this game as simple as possible, so it has a good chance of completion :) But I do not understand any of the scripting options about making a GUI or even know where to start. I don't understand why it's still the sierra interface as standard as I don't know many people who like it, I know I don't. If you can point me to a download that will just replace the existing GUI with a basic monkey island interface that would be great!
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: ncw14 on 31 Dec 2007, 01:03
YA, i cant find how to get a good save/load GUI if anyone knows how or any i can download
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Dualnames on 02 Jan 2008, 22:27
SupSuper's save load with screen GUI is pretty awesome..
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: _thePrizeFighter_ on 18 Jul 2008, 03:00
I recently downloaded Proskritos CMI template. I placed it in the same directory as AGS, but upon running Ags it didn't appear on the list of templates. If it helps I'm using the lastest version (3.0.2), I tried to download version 2.72 to see if it would work, but the link doesn't work so I'm unsure what to do at this point. Any help would be appreciated.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Khris on 18 Jul 2008, 07:23
I've uploaded 2.72:
http://www.savefile.com/files/1673905

The template won't work with 3.02, so yes, open it with 2.72, save the game, then copy/move the game folder to your 3.02 installation.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: MindUnderMatter on 21 Jul 2008, 21:16
Where can I find the version of AGS that the DOTT GUI was made with? The earliest versin of AGS that I can find is the one posted above.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Khris on 22 Jul 2008, 23:58
Right here:
http://aafiles.bicycle-for-slugs.org/ags/
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: fly on 12 Aug 2008, 16:40
Is there LucasArts GUI for AGS 3.0.2 ?
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Nahuel on 23 Sep 2008, 15:42
Hello, I'm new here, and I have a problem, I can't find a LucasArts Templates, Somebody have one?
Other question, when I found a template is in AGT format (MI2 template v2.0c.agt), what format is it? How can I open the file?

Thankyou.

I'm from Argentina, sorry for my poor English.

Nahuel.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Khris on 23 Sep 2008, 19:42
Put the .agt file in AGS's main directory, next to Default.agt and Empty.agt.
Then start AGSEdit, start a new game and select the template.
(If you want to use an old template, try opening it with AGS 2.72 [link further above], then save the game and copy/move the folder to AGS 3.x).
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Nahuel on 23 Sep 2008, 21:11
GREAT! thankyou!!
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Lethian on 27 Nov 2008, 14:16
[solved by myself]
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: MacGyver12345 on 16 Aug 2009, 20:47
i dont understand anyof the scriptingfor getting the gui to work  how do i do that?
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: MacGyver12345 on 16 Aug 2009, 23:02
Where can i find english tutorials on how to create and script lucasarts guis and inventory(stuff like that)?
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: subspark on 17 Aug 2009, 08:59
1) you double posted.
2) you revived an old thread.
3) A mod will get grumpy. ;)

The best info in creating a LucasArts gui is right in this thread! Take a look.

Cheers,
Spary.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: MacGyver12345 on 17 Aug 2009, 19:19
1) you double posted.
2) you revived an old thread.
3) A mod will get grumpy. ;)

The best info in creating a LucasArts gui is right in this thread! Take a look.

Cheers,
Spary.
i cant find any tutorials.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: MacGyver12345 on 18 Aug 2009, 01:00
is ags supposed to come with alucasarts template, because the versions i have didnt.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: subspark on 18 Aug 2009, 04:06
sigh
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Dualnames on 20 Aug 2009, 14:39
Well, here have this(you can set any possible interface and combinations of them with this module)


Control Modes(Scumm,BASS,Sierra)
http://ledzepforever.googlepages.com/ControlModes.rar
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rodrigofantino on 30 Dec 2009, 02:49
Hi there, I´m first time AGS user. I`v downloaded the template, I have all the files, I`v coppied the *.agt file to the templates directory. And when I chose new game > 9verb It tells me: " there was an error creating your game. the error was: Game data file is from version 3.2.0 of AGS or an unsuported beta version please visit the AGS website for a newer version of the editor "

Yes you will say, you have to download the newer version, well I´m using the 3.1.2 version but now that I read the GUIS forum page says that you must use 3.2 or later. Where can I download it because I can`t find it on the download page.



Rodrigo, from Argentina
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 30 Dec 2009, 16:47
Here's the thread:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=37668.0

And a direct link:
http://www.adventuregamestudio.co.uk/AGS-3.2-RC2.exe
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Adrian on 06 Jan 2010, 19:19
Hi everyone!
First of all thanks for the great topics and support!
I have a problem which should be quit simple to solve, I hope: I tried to exchange the grafics for the Lucas art GUI's Buttons with my own ones (same size), which worked fine in the GUI area of AGS. But running the game, the original Buttons are still there. Did I miss something?
Greets!

Sorry, stupid problem solved. Just changed "translate GUI action buttons" in global script. Now everything is fine! :-)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rupert83 on 06 Feb 2010, 13:49
Hi, everyone.

I work on a game based on Proskrito's FOA template and I have a problem with character interactions. I created a character (a Robot) and attached it to a dialogue, but when I do 'Talk to Robot' - nothing happens. After a few attempts on fixing it, I realized that none interactions work at all (not 'Look at', not 'Give'). Everything else works just fine (I mean interacting with objects and hotspots), just the characters. I thought I might have made a mistake before, because I modified the GUIs and some other things, but I also tried to do the same on a new game based on a non-modified template and it comes out the same.

Any ideas appreciated.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 07 Feb 2010, 23:57
Which version of AGS are you using? Have you linked the function(s) properly to the character's any click event?
To be clear, does this happen if you start a new default game, using the template with the same name that comes with AGS?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rupert83 on 09 Feb 2010, 16:21
Thanks for replying. I'm using 3.1.2 version. I'm sure I linked all the functions properly, I checked that many times. When I start a new game with the 'Default Game' template, everything works fine, but when I start with the 'SCUMM_F.O.A._English' template - it doesn't.

I also have a template from Monkey Island - I'll compare the scripts, they might be similar.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: SinSin on 10 Feb 2010, 20:09
nvm DONE IT WOOT
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Jackpumpkinhead on 20 Apr 2010, 14:38
i have just started a project that uses this template ( the new one)
and i am having a bit of trouble with my main characters sprite when in the game
it seems that when he is moving down, the down loop/animation isnt used
instead the sideways (right or left loop) animation is used
is there a way to correct this
i havent made any rooms yet
i am just using the demo room but i am using my new character instead of 'cEgo'
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 20 Apr 2010, 22:48
The loops in the view are named, make sure that the down sprites are in the correct loop (0, I believe).
Having said that, if the character is moving at an angle rather horizontal than down, AGS will use the side views.

(Btw, this isn't really concerning the template; it doesn't handle walking differently.)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Jackpumpkinhead on 21 Apr 2010, 14:31
The loops in the view are named, make sure that the down sprites are in the correct loop (0, I believe).
Having said that, if the character is moving at an angle rather horizontal than down, AGS will use the side views.

(Btw, this isn't really concerning the template; it doesn't handle walking differently.)

thanks
i thought maybe the template changed the way sprites were viewed when moving down
i am a noob at all of this
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Jackpumpkinhead on 03 May 2010, 20:26
okay i have a new problem i am dealing with
the default left click is the "use with" verb
and if you click "use" and then on an inventory item the player character just says "I can't use this"

i would like to make it so that the default left click for inventory items is "look at" instead of "use with"
like in the original monkey island games ie SOMI and MI2
then if you want to "use with" then the player has to actually click the "use" verb.

also i would like to make it so that you can make the inventory usable with the player character


Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 03 May 2010, 23:16
AFAIK, in the template, a left click on an inv item selects the item as active while a right click triggers the "look at" action.
So to use an item (as opposed to use it with something else), one's supposed to click "Use", then the item. If the item doesn't have that action, it defaults to "Use x with".

All this is intentional and IMO a big improvement over the original games. Why would you want to change that?
Why put the same action on two buttons and require an additional click for one of the most prevalent interactions in the game?

Also, to implement your changes, one has to make the player character clickable, which has the downside of them obstructing small hotspots behind them, something LucasArts has always avoided.

(I know, this post isn't helpful at all considering what you asked, sorry.)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 04 May 2010, 09:50
I also think the current approach is way more playable than the original.
But if you insist, you can edit the template at line 1261 (at least in version 1.2.1):

Code: [Select]
SetAction (eGA_LookAt);
location=GSinvloc;
if (ii.IsInteractionAvailable(eModeLookat)) {
  used_action = global_action;
  ii.RunInteraction(eModeLookat);
  SetAction(eMA_Default);
}
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Jackpumpkinhead on 04 May 2010, 14:54
so there is no way to do this in the current version
i dont mind it i guess
i am just trying to make a game and make it as close to the original scumm engine as possible
thanx anyway
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 04 May 2010, 18:35
It is, you just have to alter the lines I've mentioned in guiscript.asc ;)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Jackpumpkinhead on 04 May 2010, 20:14
i am not 100% sure on how to alter this to make the default left click on inventory be lookat
or how to make the "use" button allow you to use inventory items with other things ie. hotspots, characters, other inventory...
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 04 May 2010, 20:54
well, then just move that point down your priority list. That issue shouldn't be a show stopper, just change those lines after you get some scripting experience.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Mati256 on 30 Jun 2010, 03:29
Hello, I have tried the GUI and it works fine, but when I try to use higher resolutions it shots the game down or the interface its all messed up.
I want to use it for 640x480.

Also is there a guide on how to create my own Lucasarts GUI from scratch? I remember I had done this before, a couple of years ago, but don´t remember how.

Thanks!
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 30 Jun 2010, 07:40
I've just tried it without a problem on AGS 3.2 Final5.

New Game -> 9VerbMi Style Template -> Global Settings -> Resolution set to 640x480

After that you need to re-import/change the backgrounds in the rooms 1 and 2 because of the resolution change.

Voilá :)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 30 Jun 2010, 08:13
For me, only converting the resolution to 640x400 works without the layout getting messy.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Mati256 on 30 Jun 2010, 16:34
Here is what I mean, in 640x480 the layout is messed up:
(http://img84.imageshack.us/img84/6227/640x480.jpg)

And as Khris says, in 640x400 its ok, I didn't knew this!
(http://img12.imageshack.us/img12/6794/640x400.jpg)

I think i will just use 640x400.

EDIT:
Another problem while using 640x400, the inventory is messed up:
(http://img718.imageshack.us/img718/9236/98713623.jpg)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 30 Jun 2010, 23:37
Open the GUI for editing, then select the InventoryWindow.
In its properties, double ItemWidth and ItemHeight.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Mati256 on 01 Jul 2010, 01:45
Open the GUI for editing, then select the InventoryWindow.
In its properties, double ItemWidth and ItemHeight.

Thanks Khris, I have decided, after a lot of thinking, I will use the 320x200 resolution.  :-[
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Mati256 on 08 Jul 2010, 03:51

EDITED: Never mind I just found what I needed.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Cyrus on 03 Feb 2011, 10:50
I've got the following problem with the DOTT template:
Code: [Select]
import function GoToCharacterEx(int charid, int chartofollow, int direction, int xoffset, int yoffset, int NPCfacesplayer, int blocking)
int playerchar,charidx,charidy,playerx,playery;
  if (charidwhogoes!=GetPlayerCharacter() && blocking==2) blocking=0;//npcs cant perform semi-blocking actions
  playerchar=charidwhogoes;
  charidx=character[charidtogo].x;
  charidy=character[charidtogo].y;
  playerx=character[playerchar].x;
  playery=character[playerchar].y;
The error is in the first line, which is line 599 in the actual script:
"Variable 'GoToCharacterEx' is already defined"
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 03 Feb 2011, 12:52
Well, first of all I'd suggest to use the new template and replace the graphics in case you need the DOTT verb graphics.

It will be hard to get support for this outdated and unmaintained template ;)


To answer your question: You don't need to import this function in the main script, as this should be done in the script headers.

So if you add braces and remove the import, you should be fine better ;) But please consider using the 9-Verb GUI or a recent maniac mansion starter pack.

Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: thomasjames on 11 May 2011, 16:59
I just got the  GUI recently. well, it runs for me. but i cant seem to make the commands work. any thoughts on this?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: on 11 May 2011, 17:20
I just got the  GUI recently. well, it runs for me. but i cant seem to make the commands work. any thoughts on this?

Please be a bit more precise- what commands, and how do they not work? Trouble making commands in-game (look at x), or trouble using scripting commands?

And a happy welcome to the forums, by the way  ;)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 11 May 2011, 18:03
Also, I assume you're using the 9verb GUI included with AGS, right? (Since you wrote you had "got" it).
Its official thread is here: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=38874.0

The separate download (http://shatten.sonores.de/wp-content/uploads/2011/02/9verb_13.zip) includes a documentation.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Jackpumpkinhead on 28 Jun 2011, 22:06
i don't know if this has something to do with the latest version of AGS
but i keep getting an error when i go to the options of the game and try to change the music volume
it says something like

"-1 is not possible" or something
ill post a pic or something later of the actually wordage
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 29 Jun 2011, 07:18
yes, that would help :)
And please post the template version as well.

You could also look for the sliders in gOptions and check minValue and maxValue.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Edgar_España on 31 Aug 2011, 02:35
First, pardon by my English… I am Spanish. I have the same problem that a user, called Adrian , to change the graphs of the GUY of 9 verbs… As I speak rather badly English, I copy its message to you:

(((I have to problem which should sees quit simple to solve, I hope: For I tried to exchange the grafics the Lucas art GUI' s Buttons with my own ones (same size), which worked fine in the GUI area of AGS. But running the game, the original Buttons plows still there. Did I miss something? Greets! Sorry, stupid problem solved. Just changed " translate GUI action buttons" in global script. Now everything is fine! : -))


 I understand that the problem is fixed modifying something in the global Script… I found the line in that it is spoken of " " translate GUI action buttons" " , but not what to do… What I must make exactly to solve it? Help me, please! And it tries to explain it of a simple form because I will have to translate your answer with a translator, and do not go very well… THANKS!
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 31 Aug 2011, 08:45
Spanish is already built in, open guiscript.asc in the Scripts node, and in line 15 it says
(El español es ya integrado, abierto guiscript.asc en el nodo de secuencias de comandos, y en la línea 15 que dice)

Code: [Select]
int lang = eLangEN;
Just change that to:
(Sólo cambia que a:)

Code: [Select]
int lang = eLangES;
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Edgar_España on 31 Aug 2011, 16:06
Ok, that's good!!
But my main problem is to change the graphs. Explanation: First, I open  the tree of GUYs. Later, I beach option 2, called dMaingui. There they appear the graphs of each button. I choose, for example, the button " Pick up" , and in " properties" , option number 3: Image, I select the three points (...) to change the image. There position a Sprite mine, to change to the image " Pick up" by defect, another one " Pick Up" that I have done previously. In the image of the GUY, the button changes, but later, when position the game. The Pick Up by defect follows there…. I have only obtained that the option appears my image changing " Pushed image" … and if, when pulse, appears the image that I wish, but that is not worth! Then, my problem is to change that image of the button, with my own image…
Pardon by my English evil! And thanks!
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 31 Aug 2011, 16:58
At the start of the game, the button images are set automatically, according to the language that was set.
To edit the sprites, export them from the Sprite manager, edit them, then import over them.

You can find them here: Sprites -> MainGUI -> es

Another way: open Scripts -> guiscript.asc, then search the function AdjustLanguage().
In there, look for the Spanish block, then change the numbers.

Code: [Select]
    SetActionButtons(eGA_GiveTo, "a_button_give    0  6    11  Qq");
6 is the normal image, 11 the active one.

----


Al comienzo del juego, las imágenes de botón se ajustan automáticamente, en función del idioma que se estableció.
Para editar los sprites, los de exportación desde el gestor de Sprite, editarlos, a continuación, importe por encima de ellos.

Usted puede encontrar aquí: Sprites -> MainGUI -> es

Otra forma: abierta Scripts -> guiscript.asc, a continuación, buscar la AdjustLanguage() function.
De allí, buscar el bloque español, a continuación, cambiar los números.

Code: [Select]
SetActionButtons (eGA_GiveTo, "a_button_give 0 6 11 Qq");
6 es la imagen normal, 11 el que está activo.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Edgar_España on 01 Sep 2011, 16:57
Perfect,
This already is solved.
 
                    Thank you very much to all! What would be of my without you!
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Edgar_España on 01 Sep 2011, 22:16
Ooops...! Hello friendly, I have a new problem:

               I was enjoying the  9 verbs GUY, when I have loaded my Character, that previously had created when it used verbcoin. Up to here all good. The problem arrives when jam the button " pick_up". Then view of the cursor changes by… my character in movement view! I have been looking for a little but I do not give with the problem… I will have to create my character from the beginning again, or exists a solution? Thanks family!
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Edgar_España on 01 Sep 2011, 22:29
Ey. It already is. It was a stupidity.

Thanks anyway, friendly.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Edgar_España on 04 Sep 2011, 12:35
Hello partners, I am again.
I have what I believe that is going to be my last problem with the GUY of 9 verbs: When jam some button related to character, for example, to speak, player walks until being in front of him… I gave I put in the Script, for example, that remains to a distance of 20 pixels: player first it walks until character, and later, it retraces steps until the position that I wrote in the Script….             
   
how I can do so that to drive a verb related to character, it does not cause that my player one moves automatically towards this character?    (Maybe my English is understandable here… I`m sorry.

UPS: And a small question, not related to this subject, but that perhaps of step you prune to respond to me: How I can cause that there is to character or one view in constant movement without this blocks mo to character, for example the smoke of Smirk in Monkey 1 or Wally writing, in Monkey 2?

Thank mi friends!!! And sorry for my evil english.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: ButtercupSaiyan on 30 Aug 2012, 07:17
Right, so I'm a total noob to AGS and just following tutorials at this point.

x1 x2 x4 x8


I loaded up babby's first room and the interface is blocking the character a bit. Is there some way to move the UI to the top, or will I need to include black space on the bottom of every background?

My resolution is current 1024x768. The Right click UI is also off a bit but still usable.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 30 Aug 2012, 09:13
Sure, you can reposition the interface, just change the GUIs' Top properties in the editor.
However, every game I know of that used this interface had it at the bottom, so I'd go the "only use the top two thirds of the backgrounds" route.

Btw, are you sure that 1024x768 is the right choice for you? And what do you mean by "right click UI"?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: ButtercupSaiyan on 30 Aug 2012, 20:17
The menu that you get when you right click, it offers some options for saving and loading.

And thank you for replying. I've been going through the tutorials and Wiki but it's actually kind of hard to find information for a specific issue. In this case, I didn't know what controlled the 9-verb section. I am not sure 1024x768 is the right choice, but 800x600 is too small for my current resolution to be able to see any detail on a 1900x1000 monitor. We are in 2012, after all! But I don't know if there are ways to scale it differently from a low-resolution.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 30 Aug 2012, 20:48
Sure, it's 2012, but you are using a 9verb-GUI, don't you? ;)
AGS has a variety of filters; you can scale the game window up to 4x. Compile the game (F7), open the Compiled dir in the game dir and run winsetup.exe. There you can choose the filter. This setting will also be used when you run the game from within AGSEdit (F5).

In general, the choice of resolution is subject to your graphic abilities and the style you're aiming for, not an arbitrary high resolution you happen to have your desktop set to.

If you must use the 9verb GUI as a beginner, familiarize yourself with AGS's general workings first by following the tutorial in the manual. Then read through the PDF that comes with the template in order to learn about the special funtions and slightly different workflow.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: MiteWiseacreLives! on 08 Feb 2013, 02:46
Working with the VebCoin Gui (came with AGS 3.2),
I seem to have broken the Inventory Window, won't call up on right click after returning from a certain room...
What I think is the problem is that I am using the following code in this room,
    /code
    {if (mouse.IsButtonDown(eMouseLeft))       {
      mouse.SetBounds(165, 10, 230, 230);
      mouse.Mode = eModeUsermode1;
      check_Shaking();
      }
    /code

The room is a shooter mini-game, uses timers and funtions all running in the repeatedly execute, works pretty good. BUT when I exit the room I am having glitches. In the exit function I use
 /code
 mouse.Mode = eModePointer;
    code/
in attempt to return the curser and and verb coin to normal, cursor and verb coin work but right-click does not bring up inventory?
Hope someone might know what I'm talking about, hope I'm on the right thread.
Thanks!
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: MiteWiseacreLives! on 08 Feb 2013, 19:55
Just to add to my previous post,
I am also switching characters, to the Helicopter character for the shooter .. then back to the main Char(the one with all the inventory) going back to a normal room. I am also unable to bring up the inventory when the helocopter is set to player, I assumed this was because of all the looping & repeat execute stuff going on in that level.. I don't know how to properly handle the inventory when changing characters, I am using the .SetAsPlayer() funtion.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: MiteWiseacreLives! on 09 Feb 2013, 10:12
OK I got it.
Just for any weary noob ags'er like myself out there, this template does NOT like " mouse.Mode = eModePointer " I replaced that with eModeWalkto and the inventory GUI comes up as expected. AGS is not overwhelmed by a bunch of loops and if-statements, I am.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Ewery1 on 28 Dec 2013, 16:26
Ah! Noooo the link is broken. Does anyone know of a working gui like this?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 28 Dec 2013, 16:28
AGS comes with a 9verb GUI.
Just start a new game and select it.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Ewery1 on 28 Dec 2013, 21:59
AGS comes with a 9verb GUI.
Just start a new game and select it.

Whoops. Thanks!
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Ewery1 on 28 Dec 2013, 23:18
AGS comes with a 9verb GUI.
Just start a new game and select it.
[/quote

Aaaand now I have to copy and paste everything... At least I got got to one room.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: ZayanM on 26 Jan 2014, 23:33
I was not using several of the verbs in the LucasArts GUI and I did not want the player to get confused. I started of by deleting the buttons (eg. Open, Close, Pick Up, Give to) from the GUI - Looks like that was a big mistake. I get an error saying "in guiscript.asc", line 389 from "guiscript.asc", line 457 from "guiscript.asc", line 1634      Error: Error running function 'repeatedly_execute': Error: Null pointer referenced.

I tried making changes but have not been successful. Any help? I haven't backed up in a while.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 27 Jan 2014, 14:46
I just deleted a few buttons myself without any errors. The problem might be, that you've also deleted the graphics in the sprite folder.
To fix you problem, go to guiscript.asc and start at line 551. There you find lines like:

Code: [Select]
    SetActionButtons(eGA_GiveTo, "a_button_give    0  125  138 Qq");Comment out all those lines referring to the buttons you've already deleted - also for the other languages (in other words, do it 5 times)

This should do it
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: ZayanM on 02 Feb 2014, 07:23
Thanks for the quick reply, I was only just able to test it - and that fixed it!
The sprites are still there though, so I am not sure what else I did to cause it.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 18 Oct 2014, 16:23
hello, we are making  game in Italian. we have main charachter say something at first room load, during speech the verbs box say "text" and the GUI is translated to italian when the speech ends. Is there a way to avoid that?
solved the text thing deleting a label in guy, it was simple after all :)
for the GUI the only solution i found was overwrite the english sprite with Italian, is there a  method to translate gui before fadein?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 17 Nov 2014, 20:58
hi guys we are stuck with two scene :( we need to do action from distance but  it doesn't seem to work, the player try to go to the object or charachter. Help please. Thank you
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 18 Nov 2014, 08:02
Well, this can be done with plain AGS functions, all those "any_click_walk" functions are shortcuts for walking, talking and doing things.
But nothing stops you from using stock AGS ;)

e.g. like this:

Code: Adventure Game Studio
  1. function cup_AnyClick()
  2. {
  3.   if(UsedAction(eGA_PickUp)) {
  4.       player.AddInventory(iCup);
  5.       oCup.Visible=false;
  6.       player.Say("Yoink!");
  7.     }
  8. }
  9.  
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 18 Nov 2014, 13:33
Well, this can be done with plain AGS functions, all those "any_click_walk" functions are shortcuts for walking, talking and doing things.
But nothing stops you from using stock AGS ;)

e.g. like this:

Code: Adventure Game Studio
  1. function cup_AnyClick()
  2. {
  3.   if(UsedAction(eGA_PickUp)) {
  4.       player.AddInventory(iCup);
  5.       oCup.Visible=false;
  6.       player.Say("Yoink!");
  7.     }
  8. }
  9.  
if i try to use standard ags talk, the player try to go near the character yet even if i specify coordinates and with standard object "look" works using left click (first examine and then click on object) but the right click shortcut give me nothing. The scene is : the main character can't goes near some object on a desk but he could be able to examine them and to talk with npc without go close to him (if i specify coordinates, ego first goes near npc and then goes back to xy and talk and is this i want to avoid). thanks
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 18 Nov 2014, 14:38
Yeah, you're right. That behavior is hard-coded.

Try to paste the contents from the linked file to guiscript.asc (overwrite it ;) )
guiscript.txt (http://shatten.sonores.de/wp-content/uploads/2014/11/guiscript.txt)

In-game you can re-enable the old behavior via set_approaching_char().
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 18 Nov 2014, 19:15
Yeah, you're right. That behavior is hard-coded.

Try to paste the contents from the linked file to guiscript.asc (overwrite it ;) )
guiscript.txt (http://shatten.sonores.de/wp-content/uploads/2014/11/guiscript.txt)

In-game you can re-enable the old behavior via set_approaching_char().
it seems to work fine :) but i had to import set_approaching_char() in the header to make it selectable, is it correct?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 18 Nov 2014, 19:24
Yeah, that's correct. Could you solve that other translation issue in the meantime?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 18 Nov 2014, 19:34
Yeah, that's correct. Could you solve that other translation issue in the meantime?
no, the problem persists but i bypassed it overwriting the English gui with Italian and setting language to it, because i've noticed that if want to make an english translation and set the language to "en", even if the English gui is overwritten the text is shown in english, i don't know why but it works :) but i'm curious about the reason :)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 19 Nov 2014, 08:52
hehe - also a valid workaround. The initial problem with the translated GUI is actually a bug, which I've just fixed. I'll upload a new template soon in the according thread.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 20 Nov 2014, 20:12
hehe - also a valid workaround. The initial problem with the translated GUI is actually a bug, which I've just fixed. I'll upload a new template soon in the according thread.
Thanks a lot :) you saved us :)we look forward for update. Thanks for your work
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 24 Nov 2014, 21:30
i can't find a right way to use set_door_strings. I'm trying to define different string for "look at" command for each door in game. Can someone help me? if i try to change it inside a room script it gives me an error and the game crash
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 25 Nov 2014, 16:49
Well, set_door_strings is meant to set things global for all doors. But you can adjust it for each hotspot of course. At least this doesn't crash for me:
Code: Adventure Game Studio
  1. function hDoor_AnyClick()
  2. {
  3.   set_door_strings("Hello door","It is locked.","I can't unlock it with that.","I have to close it first.","Now it's unlocked.","The door is locked again.");
  4.   if (any_click_on_door_special(20, oDoor.ID, 61, 104, eDir_Left, 2, 180, 88, eDir_Left, null, null, 4, 0)==0) Unhandled();
  5.  
  6. }
  7.  

Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 25 Nov 2014, 17:57
Well, set_door_strings is meant to set things global for all doors. But you can adjust it for each hotspot of course. At least this doesn't crash for me:
Code: Adventure Game Studio
  1. function hDoor_AnyClick()
  2. {
  3.   set_door_strings("Hello door","It is locked.","I can't unlock it with that.","I have to close it first.","Now it's unlocked.","The door is locked again.");
  4.   if (any_click_on_door_special(20, oDoor.ID, 61, 104, eDir_Left, 2, 180, 88, eDir_Left, null, null, 4, 0)==0) Unhandled();
  5.  
  6. }
  7.  

Works fine :) i didn't put set_door_strings in the function hdoor_anyclick but in room load  :-[  sometimes i do such a stupid thing... :)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 06 Dec 2014, 18:10
is there a way to scroll dialogue? i have this problem
and i didn't find any solution :(
thanks
(http://i.imgur.com/gUwFkwKl.jpg)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 07 Dec 2014, 08:42
Yes there's is way but it involves somewhat advanced custom dialog scripting.

For starters you can do remove the current GUI to get AGS' default behavior.
In "General Settings" under "Dialog" set "Use GUI for dialog options" to 0. That way the dialog box scales up to show all the topics.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 08 Dec 2014, 14:09
Yes there's is way but it involves somewhat advanced custom dialog scripting.

For starters you can do remove the current GUI to get AGS' default behavior.
In "General Settings" under "Dialog" set "Use GUI for dialog options" to 0. That way the dialog box scales up to show all the topics.

with zero i have this result

(http://i.imgur.com/6i0llxdl.jpg)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 08 Dec 2014, 14:55
But you have to admit that now all topics are being shown ;)

This module can provide scrolling dialogs, but it takes some time to get used to it.
http://www.adventuregamestudio.co.uk/forums/index.php?topic=36313.0

I'm also using a scumm style scrolling dialog GUI in AeroNuts, which has been open-sourced.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 08 Dec 2014, 22:01
But you have to admit that now all topics are being shown ;)

This module can provide scrolling dialogs, but it takes some time to get used to it.
http://www.adventuregamestudio.co.uk/forums/index.php?topic=36313.0

I'm also using a scumm style scrolling dialog GUI in AeroNuts, which has been open-sourced.
the module works fine thanks, for aeronuts where i can find the sourcecode?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 09 Dec 2014, 09:08
From time to time you should utilize the search function ;)
http://www.adventuregamestudio.co.uk/forums/index.php?topic=39407.msg636496285#msg636496285
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 09 Dec 2014, 17:17
From time to time you should utilize the search function ;)
http://www.adventuregamestudio.co.uk/forums/index.php?topic=39407.msg636496285#msg636496285
sorry, you're right.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 07 Jan 2015, 16:56
i have a little problem using inventory item with "use with". The centre of the cursor moves diagonally upleft and it's difficult to higlight small objects. Is there a way to avoid this?

Solved:I didn't know i have to set a mouse cursor for every inventory Item, now works fine.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 22 Feb 2015, 10:53
Hi guys i've encountered some problems with ags 3.4 alpha. First facecharachter is already defined and i commented the script in the guiscript to avoid error, then when the options of the dialogues are displayed them cannot be choosen , instead the click give an highlight . The game was originally make with ags 3.2 and i disabled Enforce object-based scripting to make processclick works but nothing. Any help?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Gurok on 22 Feb 2015, 12:31
Regarding your dialogue problem, I haven't looked at the module thoroughly, but as a general rule when upgrading to 3.4.x:

Replace dialog_options_get_active with dialog_options_repexec
Ensure info.RunActiveOption(); is called from dialog_options_mouse_click (usually just pasting it at the end will do)

The manual hasn't been updated yet AFAIK, but CW laid out some more detailed guidelines here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=51050.msg636504472#msg636504472
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 09 Mar 2015, 17:21
thanks guys, i've found a strange bug if i double click on savegame slot. It returns an error about SaveListBox_Click wrong number of parameter :2, expected 1. Any suggestion?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 13 Mar 2015, 20:36
the editor says:

error running function savetextbox_click, runtime error wrong number of parameters to exported function savetextbox_click (expected 1 , supplied 2)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 15 Mar 2015, 18:30
Sorry for the late reply and thanks for the bug report.

In the globalscript, look for this line
Code: [Select]
function SaveTextBox_Click(GUIControl *control) {

and change it to
Code: [Select]
function SaveTextBox_Click(GUI *theGui, MouseButton button) {

This fixes it.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 22 Mar 2015, 19:38
Thanks, works perfectly. :-D
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 21 Jun 2015, 11:40
hi guys there's something that comings up with beta testing of our demo. If i use talk to on inventory item it doesn't show on the action bar but if i click it takes the unhandled and if i use pick up on inventory item automatically become use in the action bar.
About speak i would like that the action appears in the action bar and for pick up the action should remain pickup.
Give us an hand pls :)
p.s. (we are searching in the code but we don't understand well where is the part that connect the action bar and the inventory code, moreover this things, maybe, will be solved in the next release of the template.)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 01 Jul 2015, 13:43
I've just updated the template and addressed the issues you've mentioned. Please take a look at the modules thread for more information.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 05 Jul 2015, 17:23
I've just updated the template and addressed the issues you've mentioned. Please take a look at the modules thread for more information.
Thanks :)
We worked some hour to update our game made in 3.2 to 3.4.0.5 (we had to change the code line by line comparing old with new cause we added many things to the old one).Remains one little(or big) problem with complete customdialoguegui 1.6.3, instead of run dialogues on click, it highlights the sentence and nothing else happen. With your semplified customdialogue in the template or deleting the module, it works well. We are trying to figure out what's going on with no results.
Pls help us we wanna use for cycle :)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 09 Oct 2015, 17:01
Hi Guy, we need to have blank gui when dialog is running, is it possible to do it changing something in guiscript instead of close and reopen gui in every dialogues?
Thanks.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 09 Oct 2015, 17:09
You could use a setting in the AGS editor.
In general settings, under "Visual" set "When player interface is disabled, GUIs should" to "be hidden"
Although this also hides the GUI for every other blocking event. Would this be sufficient?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 09 Oct 2015, 17:37
You could use a setting in the AGS editor.
In general settings, under "Visual" set "When player interface is disabled, GUIs should" to "be hidden"
Although this also hides the GUI for every other blocking event. Would this be sufficient?
yes i tried it, but it has strange behaviour during walkto action (sometimes desappears, sometimes not).

and we have another question about doubleclickskip. We are searching for a way to disable and enable it (maybe using a global variable) without act on the speed and have it works also on objects.
we found that parts of guiscript code:
Code: Adventure Game Studio
  1. function WalkOffScreen(){
  2.  //handles the action of hotspots with exit extension ('>e').
  3.  //double click in such hotspots/objects... will make the player skip
  4.  //walking to it. Look the documentation for more information on exits.
  5.  
  6.   // doubleclick
  7.   if (UsedAction(eMA_WalkTo)) {
  8.     if (timer_run == true)
  9.     {
  10.       timer_run=false;
  11.       if (MovePlayerEx(player.x,player.y,eWalkableAreas)>0) hotspot[GSlocid].RunInteraction(eModeUsermode1);
  12.       if (MovePlayerEx(player.x,player.y,eWalkableAreas)>0) object[GSlocid].RunInteraction(eModeUsermode1);// we tried this
  13.  
  14.     }
  15.     else
  16.     {
  17.       //doubleclick = false;
  18.      timer_run = true;
  19.       if (Go()){
  20.         int x=player.x,y=player.y;
  21.         int offset=walkoffscreen_offset;
  22.         int dir=ExtensionEx(2,GSlocname);
  23.         if      (dir=='u') y-=offset;
  24.        else if (dir=='d') y+=offset;
  25.        else if (dir=='l') x-=offset;
  26.        else if (dir=='r') x+=offset;
  27.        if (MovePlayerEx(x,y,eAnywhere)>0){
  28.           hotspot[GSlocid].RunInteraction(eModeUsermode1);
  29.           object[GSlocid].RunInteraction(eModeUsermode1);// and this one
  30.  
  31.         }
  32.       }    
  33.     }
  34.   }
  35. }
but add, for example "object[GSlocid].RunInteraction(eModeUsermode1);" results in crash when re-entering in room
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 20 Nov 2015, 14:14
You need to check the location type first, before you can trigger the function.
Code: Adventure Game Studio
  1. function WalkOffScreen(){
  2.  //handles the action of hotspots with exit extension ('>e').
  3.  //double click in such hotspots/objects... will make the player skip
  4.  //walking to it. Look the documentation for more information on exits.
  5.  
  6.   // doubleclick
  7.   if (UsedAction(eMA_WalkTo)) {
  8.     if (timer_run == true)
  9.     {
  10.       timer_run=false;
  11.       if (MovePlayerEx(player.x,player.y,eWalkableAreas)>0) {
  12.         if (GSloctype==eLocationHotspot) hotspot[GSlocid].RunInteraction(eModeUsermode1);
  13.         else if (GSloctype==eLocationObject) object[GSlocid].RunInteraction(eModeUsermode1);
  14.       }
  15.     }
  16.     else
  17.     {
  18.       //doubleclick = false;
  19.       timer_run = true;
  20.       if (Go()){
  21.         int x=player.x,y=player.y;
  22.         int offset=walkoffscreen_offset;
  23.         int dir=ExtensionEx(2,GSlocname);
  24.         if      (dir=='u') y-=offset;
  25.        else if (dir=='d') y+=offset;
  26.        else if (dir=='l') x-=offset;
  27.        else if (dir=='r') x+=offset;
  28.        if (MovePlayerEx(x,y,eAnywhere)>0){
  29.           if (GSloctype==eLocationHotspot) hotspot[GSlocid].RunInteraction(eModeUsermode1);
  30.           else if (GSloctype==eLocationObject) object[GSlocid].RunInteraction(eModeUsermode1);
  31.         }
  32.       }    
  33.     }
  34.   }
  35. }
  36.  

I also managed to add an option to hide the gui in dialogs.

In dialogscript.ash add this in the struct CustomDialogGui (e.g. line 37)
Code: Adventure Game Studio
  1. bool hide_gui_while_dialog;

In dialogscript.asc add this at the beginning
Code: Adventure Game Studio
  1. bool in_speech;

now add this to the init function (line 19+)
Code: Adventure Game Studio
  1.  
  2. // Activate this to hide the action GUI while a dialog is active.
  3.   this.hide_gui_while_dialog = true;
  4.  

add this to the beginning of _prepare (now line 133+)
Code: Adventure Game Studio
  1.   if (this.hide_gui_while_dialog == true && gMaingui.Visible == true && gAction.Visible == true) {
  2.     gMaingui.Visible = false;
  3.     gAction.Visible = false;
  4.   }
  5.  

and finally add this to repeatedly_execute (now line 738)
Code: Adventure Game Studio
  1.   if (in_speech == true) {
  2.     in_speech = false;
  3.     if (CDG.hide_gui_while_dialog == true && gMaingui.Visible == false && gAction.Visible == false) {
  4.       gMaingui.Visible = true;
  5.       gAction.Visible = true;
  6.     }
  7.   }
  8.  
I will push these changes to the git repository and upload a newer template version later on.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 24 Nov 2015, 23:11
Hi abstauber and thanks a lot. There is only one problem, the gui desappears when the first option appears. If there is only one question that the character say directly or there are some phrases before the options appear the gui is shown. Is there a turnaround to avoid this?
(We are searching in ags (3.4) to some that can check if a dialogue(generally) is running or not, or  something can check if the text is shown on the screen but nothing)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 25 Nov 2015, 12:18
Yeah, you are right. My solution can only work, if the custom dialog GUI has a chance to appear. Unfortunately I don't know of any events that are being triggered once a dialog starts. Therefore you would need to have some sort of global "in_speech" which needs to be set to "true" in every dialog script.
I guess I need to think about this some more.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 04 Apr 2016, 11:04
Hi guys we  are making two different Guis and there are two big problems: the first one (but maybe we have find a workaround) the gui change always after fade in even in room load (using adjust language command); for the second one when we change gui we change also character but the inventory items of the previous character stay visible during fade in and then change. Any solution? Thanks for your time ;)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 04 Apr 2016, 15:40
Quote
the gui change always after fade in even in room load (using adjust language command)
Could you please provide some more details on the first problem - I somehow can't make sense of that statement.

Quote
when we change gui we change also character but the inventory items of the previous character stay visible during fade in and then change
Both characters are in different rooms I suppose? I'll create a test case and see if I can replicate this. In the meantime, have you tried to force an update via invMain.CharacterToUse = cCthulhu; ?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 04 Apr 2016, 17:23
in the guiscript we did something like
Code: Adventure Game Studio
  1. function AdjustLanguage() {
  2.  
  3.   // English
  4.   if (lang == eLangEN){
  5.     // yes/no-keys
  6.     key_u_yes= 'Y';
  7.    key_l_yes= 'y';
  8.    key_u_no= 'N';
  9.    key_l_no= 'n';
  10.    
  11.     // (eNum Name, Name, GUI Button ID, Sprite-Normal, Sprite-Highlight, Keyboard-Shortcut)
  12.     if (FLASHBACK==false)
  13.     {
  14.     btnMainBack.NormalGraphic=123;
  15.     SetActionButtons(eGA_GiveTo, "a_button_give    0  125  138 Qq");
  16.     SetActionButtons(eGA_PickUp, "a_button_pick_up 1  126  139 Ww");
  17.     SetActionButtons(eGA_Use,    "a_button_use     2  127  140 Ee");
  18.     SetActionButtons(eGA_Open,   "a_button_open    3  129  142 Aa");
  19.     SetActionButtons(eGA_LookAt, "a_button_look_at 4  134  147 Ss");
  20.     SetActionButtons(eGA_Push,   "a_button_push    5  131  144 Dd");
  21.     SetActionButtons(eGA_Close,  "a_button_close   6  133  146 Zz");
  22.     SetActionButtons(eGA_TalkTo, "a_button_talk_to 7  130  143 Xx");
  23.     SetActionButtons(eGA_Pull,   "a_button_pull    8  135  148 Cc");
  24.     }
  25.     else
  26.     {
  27.       btnMainBack.NormalGraphic=2184;
  28.       SetActionButtons(eGA_GiveTo, "a_button_give    0  2220  2221 Qq");
  29.     SetActionButtons(eGA_PickUp, "a_button_pick_up 1  2226  2227 Ww");
  30.     SetActionButtons(eGA_Use,    "a_button_use     2  127  140 Ee");
  31.     SetActionButtons(eGA_Open,   "a_button_open    3  129  142 Aa");
  32.     SetActionButtons(eGA_LookAt, "a_button_look_at 4  134  147 Ss");
  33.     SetActionButtons(eGA_Push,   "a_button_push    5  131  144 Dd");
  34.     SetActionButtons(eGA_Close,  "a_button_close   6  133  146 Zz");
  35.     SetActionButtons(eGA_TalkTo, "a_button_talk_to 7  130  143 Xx");
  36.     SetActionButtons(eGA_Pull,   "a_button_pull    8  135  148 Cc");
  37.     }
  38.   }
  39.  
some images are the same but the goal is to change all the button with different images when flashback variable changes.
After that we called the function inside a room load.
(p.s. we made a workaround reassigning the images first with an external function and the calling adjustlanguage, but if it's possible i would like to do it in a better way cause for all possible languages it's a bit frustrating :) )
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 04 Apr 2016, 17:26
forcing with mainInv.characterToUse seems to works fine THKS! :)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 05 Apr 2016, 08:26
Good to hear, I ditch the test case then :)
As for the other problem: instead of calling AdjustLanguage() inside room_load, try
Code: [Select]
InitGuiLanguage() This calls also AdjustLanguage but also assigns all button images immediately.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 06 Apr 2016, 17:31
it gives me unresolved import initguilanguage. in the header file of the guiscript there is the function imported but in the .asc the function doesn't exist. Maybe i have an older version?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 06 Apr 2016, 17:45
Quote
Maybe i have an older version?
That could be it. In the recent versions of this template, this function is called from the GlobalScript at line 41 inside game_start().
In any case, here is the function :)

Code: [Select]
//guiscript.ash
import function InitGuiLanguage();

Code: [Select]
//guiscript.asc
function InitGuiLanguage() {
  AdjustLanguage();
  int i;
  GUIControl*gc;
  Button*b;
 
  while (i < A_COUNT_) {
    gc = gMaingui.Controls[action_button[i]];
    b =  gc.AsButton;
    b.NormalGraphic=action_button_normal[i];
    i++;
  }
}

PS.
Quote
it gives me unresolved import initguilanguage.
remember, ags script it is case sensitive: InitGuiLanguage  ;)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 07 Apr 2016, 01:01
thanks tomorrow i'll give it a try.
p.s. i wrote it without uppercase but in the script it was right ;)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 07 Apr 2016, 08:47
It seems to work really fine thanks Abstauber :)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 11 Apr 2016, 07:34
Another "maybe" dumb question but i didn't find a solution yet.
Always regarding the GUI changes we need to change the colors of the square and the text of the listbox in runtime (gsave and grestore).
The options list of the object are different from the other gui and there's no signs of textcolor,selectedtextcolor or selectedbackgroundcolor or, is there a workaround?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 11 Apr 2016, 10:19
Hmm.. it really seems like listboxes do not allow to change colors during runtime - only fonts. Has this been overlooked for such a long time? Maybe it's best to open a separate thread for this.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Crimson Wizard on 11 Apr 2016, 11:26
Hmm.. it really seems like listboxes do not allow to change colors during runtime - only fonts. Has this been overlooked for such a long time? Maybe it's best to open a separate thread for this.
I believe there is already a general issue about non-changeable GUI properties in the tracker.

The workaround for background color (I think) is to create GUI background image and dynamically draw it.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 14 Apr 2016, 10:46
Hi guys we've found another strange behaviour, when interface is disabled and we press a shortcut button on keyboard the cursor appears. Is there a way to ignore them?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 14 Apr 2016, 13:12
Oops, seems to be another bug:

Code: [Select]
//line 110 in GlobalScript.asc
//old
  if (!IsGamePaused()) {

//new
 if (!IsGamePaused() && !is_gui_disabled())
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 18 Apr 2016, 08:41
thanks for reply, we have a problem that doesn't regard paused game, we have a little minigame where you have to press mouse button fast meanwhile maingui, gaction and interface are disabled. If we press qweasdzxc or another keyboard keycode the cursor show it again.
[Half solved with mouse.visible false]
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 16 Jun 2016, 16:36
Hi guys i'm trying to disable in a specific scene keyboard shortcuts in wich way i can do it?
(i made a variable in setactionbutton in guiscript but didn't work)
Thanks
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Danvzare on 17 Jun 2016, 09:58
Hi guys i'm trying to disable in a specific scene keyboard shortcuts in wich way i can do it?
(i made a variable in setactionbutton in guiscript but didn't work)
Thanks
That's easy. Create a variable. Go into the global script. Add an IF statement so the code to run those shortcuts, only runs when that variable is in its default state. Set the variable to something else at the start of the scene where they're disabled. Set the variable to its default state at end of the scene where they're disabled.
I hope that helps. If it doesn't, I can try and post the exact code I would use (if someone else doesn't beat me to the punch that is).
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 18 Jun 2016, 12:43
SetActionButton() is the inital setup.
Keyboard shortcuts are implemented using a loop at the end of GlobalScript/on_key_press, this loop calls SetAction().

You can either exit on_key_press before the loop, or exit SetAction() at the start. I suggest the latter because it will completely disable the entire mechanism.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 21 Jun 2016, 07:14
Thanks! It seems to work fine ;)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 14 Jul 2016, 19:15
Hi guys, one of my tester yesterday found a null point referenced error on mouse_on_click. I was able just a  minute ago to reproduce it. It occurs when you press "use with" with keyboard shortcut and quickly move cursor outside inventory gui.
the error is on line 1559
Code: Adventure Game Studio
  1.   if (Mouse.Mode==eModeInteract)
  2.             {
  3.               if (isAction(eGA_Use) && ii.IsInteractionAvailable(eModeInteract))
  4.               {
  5.                 ActionLine.TextColor=ActionLabelColorHighlighted;
  6.                 ii.RunInteraction(eModeInteract);
  7.                 SetAction(eMA_Default);
  8.               }
  9.                else player.ActiveInventory=ii;
  10.              }
  11.           else
  12.            {
  13.               if ( (Mouse.Mode >0 && Mouse.Mode <10 )&& ii != null)
  14.               {
  15.                 GSagsusedmode=Mouse.Mode;
  16.                 ActionLine.TextColor=ActionLabelColorHighlighted;
  17.                 ii.RunInteraction(Mouse.Mode);
  18.                 SetAction(eMA_Default);
  19.               }
  20.              
  21.            }
  22.  

i solved like this

Code: Adventure Game Studio
  1.   if (Mouse.Mode==eModeInteract)
  2.             {
  3.              if (ii!=null) //HERE
  4.              {
  5.               if (isAction(eGA_Use) && ii.IsInteractionAvailable(eModeInteract))
  6.               {
  7.                 ActionLine.TextColor=ActionLabelColorHighlighted;
  8.                 ii.RunInteraction(eModeInteract);
  9.                 SetAction(eMA_Default);
  10.               }
  11.                else player.ActiveInventory=ii;
  12.              }
  13.             }
  14.          else
  15.            {
  16.               if ( (Mouse.Mode >0 && Mouse.Mode <10 )&& ii != null)
  17.               {
  18.                 GSagsusedmode=Mouse.Mode;
  19.                 ActionLine.TextColor=ActionLabelColorHighlighted;
  20.                 ii.RunInteraction(Mouse.Mode);
  21.                 SetAction(eMA_Default);
  22.               }
  23.              
  24.            }
  25.  

Do you think that's enough?
For now it works fine...
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 28 Jul 2016, 15:22
It looks fine to me. You could also play save and add the check for inventory item in the right click area as well.

Code: Adventure Game Studio
  1.     //right click in inventory
  2.     else if (button==eMouseRightInv) {
  3.       if (alternative_action==eMA_Default) {
  4.         SetAction(eMA_Default);
  5.       }
  6.       else {
  7.         SetAction(alternative_action);
  8.         used_action=global_action;
  9.         GSagsusedmode=Mouse.Mode;
  10.         if (Mouse.Mode==eModeInteract && ii != null) { // HERE
  11.           if (isAction(eGA_Use) && ii.IsInteractionAvailable(eModeInteract)) {
  12.             UpdateActionBar();
  13.             ActionLine.TextColor=ActionLabelColorHighlighted;
  14.             ii.RunInteraction(eModeInteract);
  15.             SetAction(eMA_Default);
  16.           }
  17.           else player.ActiveInventory=ii;
  18.         }
  19.         else {
  20.           UpdateActionBar();
  21.           ActionLine.TextColor=ActionLabelColorHighlighted;
  22.           inventory[game.inv_activated].RunInteraction(Mouse.Mode);
  23.           SetAction(eMA_Default);
  24.         }
  25.       }
  26.     }
  27.  
Btw. I still didn't manage to replicate the crash - at least not in this tiny sample game.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on 04 Aug 2016, 12:04
Thanks Abstauber we'll make a little test and we confirm the right behave of this thing.

By the way, we have another half turnarouded problem.
We have the languages selection at the start of the game everytime you launch it. If we have saved an italian game, launched the game again and english language is selected before load the gui will be Italian but the language will be english. Now, we've find a solution in event restore using Game.changetranslation. In this way the load will be in the original saved language. We would like to load the game with the language selected at the start of the game. It can be done?
Title: 320x200 Resolution issue - Verb Bar blocking art
Post by: MrJackAttack on 08 Mar 2017, 14:11
Hi,

I am new to AGS, and have a question regarding Art and the MI verb interface resolution at 320x200

So, in GIMP I have created art for a room, at 320x200, filling the entire space of 320x200. From my research, I have gathered that most of the classic adventure titles adhere to that resolution.

The problem I am encountering is that, the Verb Interface ends up blocking just under half of my art, when I import it into the program for use.

My question is, do I have to create art, leaving blank/black space at the end of my "room" for the verbs to fit in?

If so, what are the dimensions of the verb bar? and what is the dimension of space that I can draw in?

or, is there anyway of scaling the art I have already made to fit in the smaller view point.

Or could I move up the resolution to 640x480, and still use the 320x200 art?

Thank you for any help.
MrAttack
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 08 Mar 2017, 17:31
There are several options:

- use the LW BASS template instead. If you absolutely want a 9-verb game, read on.

- let the room scroll. The default height of the GUI is 57 pixels (the action bar GUI is at a Y coordinate of 143), so if you simply add 57 blank rows of pixels to your background, increasing it to 320x257, the room will scroll vertically. The character is auto-centered, so results may vary, and you might want to use custom scrolling instead.

- make the action bar background transparent (if it isn't already) and sacrifice some of your art.

- hide the GUI, and show it if the player moves the mouse to the bottom of the screen. Experienced players will use the shortcut keys for the verbs anyway. This is actually what I would do: slide the action bar and verb GUI down so the verb GUI fully disappears and the action bar is at the bottom. If the mouse moves over the action bar, slide them back up.

- increase the game's resolution. Newest AGS versions allow completely custom resolutions, so you could in fact create a 320x257 game and move the action and verb GUIs down accordingly. You'd have to again add 57 blank pixels to your 320x257 room backgrounds.
This is not recommended if you want players to play your game full-screen, but with a 320 game you probably don't want that anyway. I personally rarely use a factor greater than 4 and play all 320 games windowed.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Snarky on 08 Mar 2017, 18:18
This is not recommended if you want players to play your game full-screen, but with a 320 game you probably don't want that anyway. I personally rarely use a factor greater than 4 and play all 320 games windowed.

I, on the other hand, always play low-resolution games in full screen, but high-resolution games (that don't need to be scaled up) usually windowed. Not sure why...
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: MrJackAttack on 10 Mar 2017, 01:48
There are several options:

- use the LW BASS template instead. If you absolutely want a 9-verb game, read on.

- let the room scroll. The default height of the GUI is 57 pixels (the action bar GUI is at a Y coordinate of 143), so if you simply add 57 blank rows of pixels to your background, increasing it to 320x257, the room will scroll vertically. The character is auto-centered, so results may vary, and you might want to use custom scrolling instead.

- make the action bar background transparent (if it isn't already) and sacrifice some of your art.

- hide the GUI, and show it if the player moves the mouse to the bottom of the screen. Experienced players will use the shortcut keys for the verbs anyway. This is actually what I would do: slide the action bar and verb GUI down so the verb GUI fully disappears and the action bar is at the bottom. If the mouse moves over the action bar, slide them back up.

- increase the game's resolution. Newest AGS versions allow completely custom resolutions, so you could in fact create a 320x257 game and move the action and verb GUIs down accordingly. You'd have to again add 57 blank pixels to your 320x257 room backgrounds.
This is not recommended if you want players to play your game full-screen, but with a 320 game you probably don't want that anyway. I personally rarely use a factor greater than 4 and play all 320 games windowed.

Thank you Khris, you have been very helpful.

Cheers
MrAttack.

Title: blocking problems with 9verb template
Post by: daniel on 02 May 2017, 12:29
EDIT:

in case somebody else runs into the same problem here's what was wrong:

1. i set "WalkToPoint" coordinates for the hotspots in the AGS properties window which caused a blocked "walk to" to be called when left clicking on them.

2. i failed to set the (eMA_WalkTo) action in the AnyClick function of characters/hotspots.
i.e.:
Code: [Select]
if (UsedAction(eMA_WalkTo)) {
    any_click_walk (238, 124, eDirectionRight);
  }

3. i didn't use if statements to avoid calling code that should be canceled along with the action
i.e.:
Code: [Select]
if(UsedAction(eGA_LookAt)) {
    if (any_click_move (391, 123, eDirectionLeft)) {
    player.Say ("blablabla.");
    player.Say ("bliblibli.");
    }
  }

-----------------------------------------------------------
hi,

i've done a search on this but all the answers i found seem to deal with vanilla/standard AGS functionality. i suppose it's a bit different with the 9verb template...

problem:

1. left clicking on a hotspot moves the character but blocks the game (cursor disappears)
2. left clicking on a character does nothing at all
3. using any interaction (open, talk to, etc.) walks the character over but once again the game blocks. the action cannot be cancelled.

what i would like to happen:

default lucasarts game behaviour: whenever a command is given (walk to, open, talk to,...left click or right) the character should walk over and only once it starts talking/interacting should the game "block".

it DOES behave correctly when using the "look at" (UsedAction(eGA_LookAt) function...
however this brings me to another question on the same topic:

for example, when the character has more than one line of dialogue when looking at something or any other action follows the initial "any_click_walk_look" command and the action is cancelled the script continues. how can i keep this from happening?
example:

Code: Adventure Game Studio
  1. if(UsedAction(eGA_LookAt)) {
  2.     any_click_walk_look (203, 124, eDirectionRight, "bla bla bla"); //this can be cancelled successfully
  3.     player.Say("bli bli bli"); //anything after still gets executed
  4.     Wait (40);
  5.     player.FaceDirection (eDirectionDown);
  6.     Wait (20);
  7.     player.Say ("blo blo blo");
  8. }
  9.  

in this case when the action is cancelled the character will still say "bli bli bli", face down then say "blo blo blo"...

cheers
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Snarky on 02 May 2017, 12:54
Have you read the documentation for the 9-verb template?

Looking at the raw version here (https://github.com/dkrey/ags_9verb-template/blob/master/doc/9Verbs/9verb_player.rst), you can see that it explains how to use MovePlayer() inside an if-clause to avoid blocking and make later commands contingent on not canceling/overriding the command before reaching the walkto point.

Also, the player character not being clickable is default LucasArts behavior. There doesn't seem to be a setting to change that in the template, but you can just set player.Clickable = true.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: daniel on 02 May 2017, 21:05
thanks, i actually did read the 9verb documentation but it's a lot to take in for someone like me who's never coded anything before. a lot of that stuff is still greek to me.
i'll try that "if-clause" thing tomorrow but it sounds like that should solve it. :)

i was not talking about the player character not being clickable btw. (of course i do not want him clickable)
it's all the NPC characters. they are "clickable" (their names show in the action bar) but when i left-click them the player doesn't walk up to them.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 03 May 2017, 02:47
Are you saying you're using GoToCharacter() as described in the docs, but it has no effect?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 03 May 2017, 10:16
Since we use "AnyClick" the player doesn't automatically walk to characters anymore. This also applies for hotspots, objects etc.

So you need to do it like this:
Code: [Select]
function cBman_AnyClick()
{
  // TALK TO
  if (UsedAction(eGA_TalkTo)) {
    dDialog1.Start();
  }
  // Just walk to BeMan
  else if (UsedAction(eMA_WalkTo)) {
    Go();
  }
.....
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: daniel on 03 May 2017, 10:32
Since we use "AnyClick" the player doesn't automatically walk to characters anymore. This also applies for hotspots, objects etc.


aaah, i see:)
thanks!

might i suggest adding this to the sample function in GlobalScript.asc to avoid confusion for noobs like myself?;)

something like this:
Code: [Select]
/* Character, Object, Hotspot full blown SAMPLE
function cChar_AnyClick() {

  // WALK TO
  if (UsedAction(eMA_WalkTo)) {
    Go();
  }
  // TALK TO (characters only)
  else if (UsedAction(eGA_TalkTo)) {
    Unhandled();
  }
  // LOOK AT
  else if(UsedAction(eGA_LookAt)) {
    Unhandled();
  }
  // OPEN
  else if(UsedAction(eGA_Open)) {
    Unhandled();
  } 
  // CLOSE
  else if(UsedAction(eGA_Close)) {
    Unhandled();
  }
  // USE
  else if(UsedAction(eGA_Use)) {
    Unhandled();
  }
  // Push
  else if(UsedAction(eGA_Push)) {
    Unhandled();
  }
  // Pull
  else if(UsedAction(eGA_Pull)) {
    Unhandled();
  }
  // PICKUP
  else if(UsedAction(eGA_PickUp)) {
    Unhandled();
  }
  // GIVE TO (characters only)
  else if(UsedAction(eGA_GiveTo)) {
    Unhandled();
  } 
  //USE INV
  else if(UsedAction(eGA_UseInv)) {
    Unhandled();
  }
  else Unhandled();
}
*/

Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 03 May 2017, 10:36
Good idea, I'll update it soon

Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: daniel on 03 May 2017, 12:59
ok, here's a quick follow-up question.
i got everything to work as it should now...almost.

when starting a dialog using
Code: [Select]
Dialog.Start() AGS seems to move the PC towards the NPC.
so when i do this
Code: [Select]
else if (UsedAction(eGA_TalkTo)) {
    if (any_click_move (413, 131, eDirectionRight)) {
    dDialog.Start();
    }
the character moves to the NPC and then returns to the given coordinates before starting the dialog.
is there some way to supress this? what if i want the characters to stand really far apart while talking?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 03 May 2017, 13:04
Yep. This can be configured globally in guiscript.asc.
Around line 30 set
Code: [Select]
bool approachCharInteract = false;

You can also turn it on or off during game time via
Code: [Select]
set_approaching_char(bool enable)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: daniel on 03 May 2017, 13:29
Yep. This can be configured globally in guiscript.asc.

perfect, thanks!:)

btw. what's the quickest/easiest way if i want to update my game to the latest version of the 9-verb template?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 03 May 2017, 14:33
That would be replacing the content from Guiscript.asc from here:
https://raw.githubusercontent.com/dkrey/ags_9verb-template/master/guiscript.asc

and guiscript.ash from here:
https://raw.githubusercontent.com/dkrey/ags_9verb-template/master/guiscript.ash

But backup your code first!

Additionally for the fix from 1.5.4 you need to edit the Globalscript.asc and edit the function on_key_press(eKeyCode keycode)
Make sure you comment out these two lines in the pause section
Code: [Select]
  // --- PAUSE-GUI ---
  if (keycode == eKeySpace)
  {
    // SPACEBAR
    if (!IsGamePaused()) {
      PauseGame();
      AdjustGUIText();
      gPaused.Visible=true;
    }
    else {
      gPaused.Visible=false;
      UnPauseGame();
      //SetDefaultAction(eMA_WalkTo);      <---- THIS LINE
      //ActionLine.TextColor=ActionLabelColorHighlighted;   <---- AND THIS LINE
      CheckDefaultAction();
      UpdateActionBar();
    }
  }
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: daniel on 04 May 2017, 11:21
thanks! i'll give it a shot later today:)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: daniel on 08 May 2017, 01:06
hi again,

i noticed another peculiar thing that i can't figure out...not sure if it's actually related to the 9-verb template

when i click on a verb (i.e. "use") and then click on an empty spot on the background the PC always walks to, what seems to be, the center of the background...the game also gets blocked until he's there. it doesn't matter where i click (as long as there is no hotspot or anything). he always walks to the same spot. any idea why it's doing that?

also: is there a limit to how many characters can be displayed in the action bar? i have an item that has a pretty long name and i noticed it gets cut off in the action bar even though there's still plenty of room left.

cheers
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 08 May 2017, 10:45
Hmm... I can't reproduce the first issue. Whenever I click on something empty with "Use" selected, the action just switches to "Go To". No movement involved at all.
Could it be that in your roomscript you have a misplayed MovePlayer or player.Walk command? Does it happen in all rooms?
Also try to create a new game and check if it also happens in this "alley" sample room, the template provides.

Quote
also: is there a limit to how many characters can be displayed in the action bar? i have an item that has a pretty long name and i noticed it gets cut off in the action bar even though there's still plenty of room left.
I just counted 52 characters in total. Did you change the font of the label or did the label size change?
Have a look at the GUI gAction and check the properties of the label ActionLine
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: daniel on 08 May 2017, 14:10
thanks,

i found the source of the first issue. for some weird reason i had set "walk to" coordinates for hotspot 0 in the AGS UI...:D don't ask

as for the second issue...i checked the ActionLine on the gAction UI and everything seems to be fine. i also didn't change the font or mess around with it in any way.
what seems to be happening is that the names of inventory items get cut off after 24 characters. i also tested it in the alley sample room...same thing.

p.s. i noticed that at the end of "function any_click_move" is a "Wait(5);" command...any specific reason why this is there? from what i can tell, all it does is cause the game to block for a fraction of a second every time the character reaches his destination...which felt kind of "glitchy" to me t.b.h.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 08 May 2017, 14:19
Quote
what seems to be happening is that the names of inventory items get cut off after 24 characters.
I only tried 15 chars when I tried it. But this is seems to be a limitation of AGS itself. The editor limits object names to 29 characters, but apparently it forgot about limiting inventory names.

But the label itself could display all those characters ;)

edit: Hotspot names can be pretty long, I just managed to display "Go To 012345678901234567890123456789012345678 90123456"
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: daniel on 08 May 2017, 14:27
yeah i was afraid it would be something like that, too bad...so no way around it at this point i guess?

if the inventory items could have 29 characters as well i'd be fine...i'm 3 characters short!  :-\ :P
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 08 May 2017, 14:32
Unfortunately nothing I could do right now. Possibly CW, Gurok or Alan could help you out.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 09 May 2017, 08:07
I completely overlooked you ninja edit:
Quote
p.s. i noticed that at the end of "function any_click_move" is a "Wait(5);" command...any specific reason why this is there? from what i can tell, all it does is cause the game to block for a fraction of a second every time the character reaches his destination...which felt kind of "glitchy" to me t.b.h.

This is from a time before 3.4.0 where you needed a wait command to actually see the character turning. Why it's Wait(5) instead of Wait(1)... no idea ;)

I replaced it with this code snippet

Code: [Select]
#ifver 3.4
    player.FaceDirection(dir, eBlock);
#endif
#ifnver 3.4
  player.FaceDirection(dir);
  Wait(1);
#endif
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: daniel on 09 May 2017, 11:11
ok thanks for the info...:)

btw. is it possible to add an unhandled event for specific inventory items?

i.e. with a knife in the inventory, whenever it's used on an unhandled object i'd like the character to say "I don't want to cut that" instead of a super-generic phrase.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 09 May 2017, 12:26
Sure, go to guiscript.asc and take a look at the Unhandled Function
instead of:
Code: [Select]
    // unhandled USE INV
    else if (UsedAction(eGA_UseInv)) player.Say("That won't do any good.");
you could write
Code: [Select]
    // unhandled USE INV
    else if (UsedAction(eGA_UseInv)) {
      if (player.ActiveInventory == iKnife) player.Say("I don't want to cut that.");
      else if (player.ActiveInventory == iOtherStuff) player.Say("I don't even know what it is.");
      else player.Say("That won't do any good.");
}
The unhandled function is all yours to be edited :)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: daniel on 09 May 2017, 14:32
great! thanks again:)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Loslem on 12 Jul 2017, 10:44
Hu guys!

I have 2 questions, both regarding the doorscript.
1. That may be the simpler one: where can I define the default door sounds for opening and closing? The 9Verb pdf says that these sounds will be called if the script is used... but I don't know where to insert them ^^

2. My game is set in a house, hence I use a lot of doors. So when I test the game and run around the rooms, from time to time it happens that doors lock themselves(and of course then there is no key exising). Or doors that should be closed are open. Or the door is open, but the object sprite is not displayed. Anyone else has similar experiences?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 12 Jul 2017, 11:51
1. open the main guiscript, check lines 48 - 52

2. double check your any_click_on_door functions; this definitely sounds like user error (i.e. wrong parameters)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 12 Jul 2017, 12:06
1. in addition to that, you can also use "any_click_on_door_special". In this function you can set a custom audioclip for each door. (Useful if you have a wooden and an iron door.)

2. Make sure you keep track of your door ids. It sounds like some doors share the same id.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Loslem on 12 Jul 2017, 13:29
Thanks to you both :)

Just to clarify: Does that mean that every door in the whole game should have an ID on it's own? I thought that was linked to the room, so I started over from ID 1 in every room. Ahehehe...
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 12 Jul 2017, 13:42
Yup, every door is unique (nod)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 12 Jul 2017, 19:21
Just to be really clear: a door that connects two rooms and is visible in both needs to use the same ID in both room scripts.
If you lock door 7 in room 2, then circle back through the entire mansion to room 3 and look at the same "physical" door from the other side, it has to be set up as door 7 in room 3, too, so the status of being open or locked is retained.

Think of the doors as global objects - each with its unique ID - that can be accessed from multiple rooms. Exactly like Characters.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Loslem on 12 Jul 2017, 23:01
Ah, ohmygod that makes so much sense... I never thouhgt of the doors working that way. It seems to work now :)

Now regarding the sound...

That's what I find in the script:
Code: Adventure Game Studio
  1. #ifdef USE_OBJECT_ORIENTED_AUDIO
  2. // In AGS 3.2 you do it this way:
  3. //   Audioclip *openDoorSound = aDoorsound;
  4. AudioClip*  openDoorSound,  
  5.             closeDoorSound,
  6.             unlockDoorSound;    
  7. #endif

Aaaand I don't relly get the pointer stuff...
So this here doesn't work.
Code: Adventure Game Studio
  1. #ifdef USE_OBJECT_ORIENTED_AUDIO
  2. // In AGS 3.2 you do it this way:
  3. //   Audioclip *openDoorSound = aDoorsound;
  4. AudioClip *openDoorSound = aTuerAuf,
  5.             closeDoorSound = aTuerzu,
  6.             unlockDoorSound = aTuerAuf;    
  7. #endif
  8.  
Debugger says: "Cannot assign initial Value to global pointer"
Sry guys, for the most part of the coding stuff I'm doing fine, but here I don't get how it's done right :/

Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 12 Jul 2017, 23:19
Right, you have to assign them inside a function.

Code: Adventure Game Studio
  1. #ifdef USE_OBJECT_ORIENTED_AUDIO
  2. // In AGS 3.2 you do it this way:
  3. //   Audioclip *openDoorSound = aDoorsound;
  4. AudioClip*  openDoorSound,
  5.             closeDoorSound,
  6.             unlockDoorSound;
  7.  
  8. // called by the engine if it exists, at the very start of the game
  9. void game_start() {
  10.   openDoorSound = aTuerAuf;
  11.   closeDoorSound = aTuerzu;
  12.   unlockDoorSound = aTuerAuf;
  13. }
  14. #endif
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: croquetasesina on 22 Mar 2019, 09:25
 I was looking for how to add arrows to scroll in the inventory and also in the dialogs to add more than 5 options. However the links I find plugins or modules are obsolete. I can not find the way Could someone help me please?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 22 Mar 2019, 09:41
The template that comes with AGS already has this build in. The scroll arrows appear automatically as soon as they are needed.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: croquetasesina on 22 Mar 2019, 10:48
You're right, I forgot to add the item and it did not come out. Take me, but in any case, thank you very much for the quick response
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: croquetasesina on 27 Mar 2019, 14:52
How could I change the GUI language from the game? I would like to press a button to change to another language. I do not know what it puts in any_click of an object exactly
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: croquetasesina on 28 Mar 2019, 16:06
I was trying with this, but nothing happens

Code: Adventure Game Studio
  1. function english_AnyClick()
  2. {
  3.  //switch the GUI to English
  4.   int lang = eLangEN;
  5.   AdjustLanguage();
  6.   AdjustGUIText();
  7.  
  8.   if (Game.ChangeTranslation("English") == true) {
  9.     Display("English loaded");
  10. }
  11. }
  12.  

Can anyone help me please?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on 28 Mar 2019, 22:40
Open guiscript.ash (header), then add this anywhere in a separate line:

Code: Adventure Game Studio
  1. import int lang;

Then open the main guiscript.asc and find
Code: Adventure Game Studio
  1. int lang = eLangEN;
It's line 16 for me.
Right below, add this:
Code: Adventure Game Studio
  1. export lang;

Finally, in your code, remove "int":

Code: Adventure Game Studio
  1.   lang = eLangEN; // change global variable

For further questions best use the template's thread: https://www.adventuregamestudio.co.uk/forums/index.php?topic=38874.0
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: croquetasesina on 29 Mar 2019, 15:33
I had to delete "import lang" from GlobalScript.ash, but now all run perfect with your directions. That's perfect!! Thank you very much Khris :)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: croquetasesina on 29 Mar 2019, 15:50
Wuooops! I have been checking that only the verbs change, however, the screen to load the game, pause, exit the game and the rest is still untranslated. Is this normal?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: croquetasesina on 01 Apr 2019, 10:18
I've been trying and trying to see what's wrong, but I do not find much sense. When the game starts in English, everything is completely in English. When you click on Spanish, everything is activated in Spanish, the nine verbs change, the action text changes, and even the entire save and load game menu. Up to here everything perfect. However, when I press the button to return to English, the 9 verbs and the action text change perfectly to English again, but the entire GUI of F5 continues in Spanish.
I'm sorry to continue on this subject despite your recommendation Khris, but I thought maybe it was better to finish it here and take into account your guidance for other future questions and definitely ask there.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Cassiebsg on 01 Apr 2019, 20:42
-i think you should move to the proper thread like Khris suggested, as the author follows that thread and will more quickly give you a quick straight answer.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on 02 Apr 2019, 21:11
I follow this one too from time to time, but I'm afraid I forgot to reply  :-[
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: FormosaFalanster on 16 Sep 2020, 12:18
Hello - after toying with different ideas I decided to give a go to the Lucasarts 9 verbs template. Now this may be a silly question but, what is the best way to "reset" it? I mean, when you create the template there is already two rooms, two character, and various items. I am concerned that if I start deleting them to put my own game elements it may screw up the GUI. Is there anything I should be aware of before I start messing with this?
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Crimson Wizard on 16 Sep 2020, 12:34
Hello - after toying with different ideas I decided to give a go to the Lucasarts 9 verbs template. Now this may be a silly question but, what is the best way to "reset" it? I mean, when you create the template there is already two rooms, two character, and various items. I am concerned that if I start deleting them to put my own game elements it may screw up the GUI. Is there anything I should be aware of before I start messing with this?

GUI is usually made in a way to be separated from actual game objects, rooms, inventory items etc. Essential parts are GUI panels themselves and related script module(s).
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: FormosaFalanster on 16 Sep 2020, 12:42
Thanks, in this game I will try to generate a new game with the template, clean up the pre-existing game, and put my own elements. Thanks!