Adventure Game Studio | Forums

AGS Support => Beginners' Technical Questions => Topic started by: TerranRich on Fri 01/08/2003 06:04:47

Title: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: TerranRich on Fri 01/08/2003 06:04:47
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 Mon 04/08/2003 01:44:30
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 Mon 04/08/2003 07:14:55
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 Fri 22/08/2003 08:48:06
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 Fri 22/08/2003 12:59:30
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 Sat 23/08/2003 09:27:43
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 Sat 23/08/2003 09:49:44
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 Sat 23/08/2003 20:20:37
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 Sun 24/08/2003 01:41:25
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 Mon 25/08/2003 13:17:49
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 Mon 25/08/2003 16:31:18
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 Tue 26/08/2003 05:28:44
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 Thu 04/09/2003 16:41:29
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 Mon 08/09/2003 08:46:19
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 Mon 08/09/2003 14:22:42
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 Thu 11/09/2003 14:00:50
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 Thu 11/09/2003 17:02:41
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 Fri 12/09/2003 09:47:23
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 Fri 12/09/2003 20:25:27
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 Sat 13/09/2003 16:05:41
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 Sat 13/09/2003 16:52:37
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 Sat 13/09/2003 17:37:15
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 Mon 15/09/2003 17:15:52
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 Mon 15/09/2003 17:20:09
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 Wed 17/09/2003 13:21:57
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 Wed 17/09/2003 14:56:27
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 Wed 17/09/2003 15:46:44
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 Wed 17/09/2003 16:00:41
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 Thu 18/09/2003 18:45:46
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 Thu 18/09/2003 19:21:23
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 Sat 20/09/2003 18:02:15
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 Sun 21/09/2003 06:55:15
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 Thu 25/09/2003 13:12:42
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 Fri 21/11/2003 16:26:18
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 Fri 21/11/2003 18:25:50
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 Sat 22/11/2003 01:09:03
QuoteCan 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 :)
QuoteGoToCharacter(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 Wed 03/12/2003 12:39:10
(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 Sat 06/12/2003 19:49:02
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 Sun 07/12/2003 07:58:14
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 Sun 07/12/2003 14:35:33
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 Sun 07/12/2003 14:52:19
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 Thu 11/12/2003 20:14:17
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 Thu 11/12/2003 20:19:08
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 Thu 11/12/2003 20:59:12
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 Thu 11/12/2003 21:12:01
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 Fri 12/12/2003 01:06:20
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 Fri 12/12/2003 01:36:59
Get the DOTT style gui at the same download site
Title: Re:The LucasArts GUI Help Thread
Post by: on Fri 12/12/2003 02:22:22
Quote from: Scummbuddy on Fri 12/12/2003 01:36:59
Get the DOTT style gui at the same download site

aha...?

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

Thanks anyway,

Simon
Title: Re:The LucasArts GUI Help Thread
Post by: Scummbuddy on Fri 12/12/2003 03:33: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 Fri 12/12/2003 09:43:32
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 Fri 12/12/2003 10:36:13
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 Fri 12/12/2003 21:45:07
Quote from: Petar on Sun 07/12/2003 14:52:19
My logic tells me it should work like this (this is not an actual script=)

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

Try this idea:

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

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

I don't know if you knew about the room repeatedly execute 'loops'. I hope this works.
Title: Re:The LucasArts GUI Help Thread
Post by: on Sat 13/12/2003 17:45:09
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 Sun 14/12/2003 22:32:58
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 Sat 03/01/2004 04:27:26
 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 Tue 03/02/2004 02:07:05
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 Tue 03/02/2004 09:20:26
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:

/**/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 Wed 04/02/2004 00:24:54
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 Sat 07/02/2004 15:17:06
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 Thu 12/02/2004 00:39:56
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 Thu 12/02/2004 07:45:36
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 Thu 12/02/2004 20:15:50
lol Thanks scummbuddy, I must be blind.
:D
Title: Re:The LucasArts GUI Help Thread
Post by: IntentInsane on Sat 14/02/2004 15:42:54
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 Mon 16/02/2004 15:49:40
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 Mon 16/02/2004 17:36:17
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 Tue 17/02/2004 02:04:54
It worked, thanks dude! ^_^
Title: Re:The LucasArts GUI Help Thread
Post by: monkey0506 on Fri 20/02/2004 00:57:24
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...
/**/  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 Sun 22/02/2004 12:25:12
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 Sun 22/02/2004 13:30:25
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 Sun 22/02/2004 20:40:22
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 Sun 22/02/2004 20:52:58
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 Tue 24/02/2004 05:13:29
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 Tue 24/02/2004 15:32:19
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 Wed 25/02/2004 01:21:38
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 Wed 25/02/2004 19:14:41
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 Wed 25/02/2004 20:25: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 Mon 01/03/2004 02:17:40
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 Tue 02/03/2004 23:15: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 Wed 03/03/2004 22:07:28
Quote from: Cisco on Tue 02/03/2004 23:15:15
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:

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 Sat 06/03/2004 14:19:07
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 Wed 10/03/2004 07:01:27
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 Wed 10/03/2004 16:12:57
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 Wed 10/03/2004 18:55:56
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 Thu 11/03/2004 15:08:18
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 Thu 11/03/2004 15:30:37
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 Sat 13/03/2004 22:21:46
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 Sun 14/03/2004 17:58:17
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 Wed 17/03/2004 13:02:08
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
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 Thu 25/03/2004 02:37:15
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 Thu 25/03/2004 16:13:08
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 Thu 25/03/2004 22:32:50
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 Fri 26/03/2004 18:32:29
Did you remember to write the script for interaction with the object?
Title: Re:The LucasArts GUI Help Thread
Post by: monkey0506 on Sun 28/03/2004 16:00:36
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 Mon 29/03/2004 22:48:07
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 Thu 01/04/2004 15:25:36
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 Fri 02/04/2004 23:31:45
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 Mon 05/04/2004 12:32:12
Quote from: Proskrito on Mon 29/03/2004 22:48:07
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 Mon 05/04/2004 16:10:47
Quote from: Ollj on Thu 01/04/2004 15:25:36
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 Thu 08/04/2004 11:36:12
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 Thu 08/04/2004 15:31:15
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 Fri 09/04/2004 18:09:44
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 Sat 10/04/2004 12:00:36
Quote from: Mr Flibble on Fri 09/04/2004 18:09:44
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 Mon 19/04/2004 17:45:10
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 Wed 21/04/2004 18:42:26
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 Fri 23/04/2004 18:21:26
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 Fri 23/04/2004 23:30:13
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 Tue 27/04/2004 00:09:53
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 Tue 27/04/2004 00:24:16
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 Tue 27/04/2004 15:55:57
Quote from: monkey_05_06 on Fri 02/04/2004 23:31:45
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 Mon 03/05/2004 06:54:04
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 Tue 18/05/2004 19:27:12
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 Tue 18/05/2004 20:38:18
try downloading the newest beta. just curious, what version do you have?
Title: Re: The LucasArts GUI Help Thread
Post by: on Wed 19/05/2004 02:10:12
 :-\ 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 Wed 19/05/2004 04:49:01
where did you place your downloaded proskritos template .agt files?
Title: Re: The LucasArts GUI Help Thread
Post by: on Wed 19/05/2004 05:03:55
 :-\ 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 Thu 27/05/2004 20:40:23
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 Thu 27/05/2004 20:57:19
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 Thu 27/05/2004 23:38:03
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 Fri 28/05/2004 00:07:46
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 Fri 28/05/2004 18:33:17
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 Sat 29/05/2004 19:52:04
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:

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 Sun 30/05/2004 00:56:37
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 Sun 30/05/2004 13:16:12
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 Sun 30/05/2004 15:13:52
The exact code would be very helpful. ;)
Title: Re: The LucasArts GUI Help Thread
Post by: Mr Flibble on Sat 05/06/2004 16:50:54

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 Thu 10/06/2004 16:02:46
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 Fri 11/06/2004 21:03:27
Quote from: Kinoko on Tue 27/04/2004 15:55:57
Quote from: monkey_05_06 on Fri 02/04/2004 23:31:45
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 Sat 12/06/2004 19:33:53
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 Sun 13/06/2004 03:34:32
First of all, what is a Verb Coin Template?
Title: Re: The LucasArts GUI Help Thread
Post by: Mr Flibble on Sun 13/06/2004 17:06:08
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 Tue 15/06/2004 22:04:04
Quote from: Mr Flibble on Sat 12/06/2004 19:33:53Still 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) {
   ...
   ...
   ...


Quote3. 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 Thu 17/06/2004 14:28:59
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 Sat 19/06/2004 17:24:18
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 Mon 21/06/2004 13:15:52
Never mind i fixed it
Title: Re: The LucasArts GUI Help Thread
Post by: Mr Flibble on Mon 21/06/2004 19:21:33
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 Mon 21/06/2004 22:02:27
Quote from: Mr Flibble on Mon 21/06/2004 19:21:33So 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.

QuoteI'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 Mon 21/06/2004 22:55:02
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 Fri 25/06/2004 04:15:06
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 Fri 25/06/2004 18:38:12
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 Sun 27/06/2004 00:40:01
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 Sun 27/06/2004 18:48:01
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 Mon 28/06/2004 07:14:15
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 Mon 28/06/2004 14:03:36
Quotedoes 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 Tue 29/06/2004 18:57:03
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 Wed 30/06/2004 02:21:50
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 Wed 30/06/2004 09:17:57
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 Wed 30/06/2004 18:50:04
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 Wed 30/06/2004 21:02:17
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 Thu 01/07/2004 03:24:29
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 Sun 04/07/2004 02:09:39
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 Sun 04/07/2004 19:32:25
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 Wed 07/07/2004 23:09:27
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 Thu 08/07/2004 09:43:14
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 Sun 11/07/2004 08:04:46
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 Mon 12/07/2004 11:45:29
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 Mon 12/07/2004 18:09:54
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 Mon 12/07/2004 18:15:33
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 Thu 15/07/2004 17:35:48
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 Mon 19/07/2004 16:06:40
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 Mon 19/07/2004 17:22:37
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 Mon 19/07/2004 17:53:16
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 Mon 19/07/2004 18:33:15
Ah you must have downloaded a different GUI. I used the MI2 one.
Title: Re: The LucasArts GUI Help Thread
Post by: Estaog on Mon 19/07/2004 18:42:08
I have the MI 1 one.
Title: Re: The LucasArts GUI Help Thread
Post by: Proskrito on Mon 19/07/2004 20:33:03
Quote from: Konador on Thu 15/07/2004 17:35:48
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 Fri 23/07/2004 17:59:26
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 Sat 24/07/2004 01:53:05
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 Sat 24/07/2004 10:28:42
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 Mon 02/08/2004 12:50:19
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 Mon 02/08/2004 15:05:25
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 Wed 04/08/2004 13:12:32
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 Tue 17/08/2004 18:08:12
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 Tue 17/08/2004 18:45:44
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 Thu 19/08/2004 14:13:59
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 Thu 19/08/2004 14:29:02
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 Fri 20/08/2004 17:32:06
  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 Fri 20/08/2004 18:04:16
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 Sat 21/08/2004 09:22:01
Ofcourse! That was a really stupid question  :-\
Thanx a lot!
Title: Re: The LucasArts GUI Help Thread
Post by: on Sat 21/08/2004 19:24:41
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 Tue 24/08/2004 10:15:42
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 Tue 24/08/2004 20:07:23
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 Wed 25/08/2004 08:49:08
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 Wed 25/08/2004 09:37:14
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 Wed 25/08/2004 09:41:52
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 Wed 25/08/2004 10:17:55
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 Wed 25/08/2004 10:26:34
it gives me a list of empty files
Title: Re: The LucasArts GUI Help Thread
Post by: Gilbert on Wed 25/08/2004 10:50:02
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 Wed 25/08/2004 11:28:58
ok thanks
Title: Re: The LucasArts GUI Help Thread
Post by: wackojacko on Fri 27/08/2004 20:29:20
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 Fri 27/08/2004 20:40:32
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 Sat 28/08/2004 01:10:08
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 Mon 30/08/2004 16:09:58
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 Mon 30/08/2004 18:15:31
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 Tue 31/08/2004 15:56:13
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 Tue 31/08/2004 16:35:53
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 Tue 31/08/2004 18:07:45
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 Wed 01/09/2004 12:47:19
Thanks!
It's now working and I get the newest version of AGS!
Title: Re: The LucasArts GUI Help Thread
Post by: on Thu 18/11/2004 03:22:18
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 Fri 19/11/2004 09:09:01
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 Sat 20/11/2004 22:37:15
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 Sun 21/11/2004 15:07:49
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 Mon 22/11/2004 00:20:45
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 Mon 22/11/2004 02:16:46
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 Mon 22/11/2004 20:34:21
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 Tue 23/11/2004 23:20:02
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 Wed 24/11/2004 02:25:33
Still stating the obvious, then:
in the interactions menu: before room loads -> setcharView
Title: Re: The LucasArts GUI Help Thread
Post by: monkey0506 on Wed 24/11/2004 16:36:47
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 Thu 25/11/2004 14:02:40
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 Thu 25/11/2004 17:16:34
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 Fri 26/11/2004 14:24:45
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 Sat 11/12/2004 13:47:34
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 Wed 15/12/2004 17:49:49
Quote from: monkey_05_06 on Sat 11/12/2004 13:47:34Proskrito'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 Sat 18/12/2004 05:10:17
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 Mon 17/01/2005 17:06:03
Quote from: Mats Berglinn on Tue 17/08/2004 18:08:12
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 Mon 17/01/2005 19:17:47
use the new templates here: http://usuarios.lycos.es/golfapagina/templates/
Title: Re: The LucasArts GUI Help Thread
Post by: on Tue 18/01/2005 04:18:12
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 Tue 18/01/2005 07:14:20
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 Wed 16/02/2005 11:54:01
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 Tue 29/03/2005 01:15:18
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 Wed 13/04/2005 16:42:03
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 Thu 14/04/2005 23:39:38
Alright thanks.
Title: Re: The LucasArts GUI Help Thread
Post by: storycatchermike on Fri 15/04/2005 20:11:03
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 Sun 17/04/2005 02:36:35
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 Sun 17/04/2005 02:54: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 Mon 18/04/2005 03:44:29
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 Mon 18/04/2005 04:30:20
QuoteActually, 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:


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 Mon 18/04/2005 16:03:28
Quote from: strazer on Mon 18/04/2005 04:30:20
QuoteActually, 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:


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 Mon 18/04/2005 18:39:24
It sounds to me like perhaps you code wasn't just like strazers... Maybe you were trying to do something like

if (interface == GUINAME) {
  if (control == 2) {
    gGuiname.Visible = false;
    QuitGame(0);
    }
  }


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

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 Wed 20/04/2005 16:52:58
I hate to say it...but that made no sense...
   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 Wed 20/04/2005 22:09:39
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 Wed 20/04/2005 22:16:07
Quote from: Scummbuddy on Wed 20/04/2005 22:09:39
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 Sat 23/04/2005 22:32:31
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 Tue 26/04/2005 10:36:11
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 Tue 26/04/2005 17:11:10
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 Wed 27/04/2005 08:49:27
sorry i forgot all about the search function
Title: Re: The LucasArts GUI Help Thread
Post by: Gilbert on Wed 27/04/2005 11:06:26
At least the search function is disabled for the time being. :=
Title: Re: The LucasArts GUI Help Thread
Post by: Scummbuddy on Wed 27/04/2005 15:26:48
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 Fri 06/05/2005 09:40:14
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 Sat 21/05/2005 07:33:45
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 Sat 21/05/2005 22:36:01
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 Sun 22/05/2005 22:30:58
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 Sun 22/05/2005 22:47:25
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 Mon 23/05/2005 01:54:23
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 Mon 23/05/2005 03:10:35
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 Wed 25/05/2005 09:56:45
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 Mon 30/05/2005 04:14:18
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 Tue 07/06/2005 08:16:13
      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 Tue 07/06/2005 23:23:32
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 Thu 09/06/2005 19:28:10
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 Fri 17/06/2005 13:18:11
Quote from: monkey_05_06 on Thu 09/06/2005 19:28:10I 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 Fri 17/06/2005 15:07:36
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 Fri 17/06/2005 21:11:15
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 Fri 17/06/2005 22:54:08
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 Mon 20/06/2005 09:04:00
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 Mon 20/06/2005 11:04:13
http://www.freewebs.com/skimbleshanks/
Title: Re: The LucasArts GUI Help Thread
Post by: Lazarus on Fri 01/07/2005 11:16:55
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 Mon 04/07/2005 02:37:32
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 Mon 04/07/2005 08:36:38
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 Mon 04/07/2005 08:51:09
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 Fri 08/07/2005 12:12:18
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 Sat 09/07/2005 02:49:16
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 Mon 11/07/2005 14:06:41
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.


Ã,  // 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 Thu 14/07/2005 08:49:31
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 Wed 20/07/2005 07:11:50
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 Wed 20/07/2005 08:50:03
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 Thu 21/07/2005 14:14:31
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 Fri 22/07/2005 09:55:56
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 Fri 22/07/2005 18:48:14
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 Tue 26/07/2005 20:45:41
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 Tue 26/07/2005 22:53:03
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 Wed 27/07/2005 00:18:24
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 Wed 27/07/2005 00:24:15
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 Wed 27/07/2005 01:29:33
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 Wed 27/07/2005 03:06:41
Download a different one from that site.
Title: Re: LucasArts GUI Help Thread <needs recompiling to 2.7>
Post by: Mats Berglinn on Wed 27/07/2005 14:03:15
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:

  // 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 Wed 27/07/2005 15:16:09
You need to limit the NewRoom commands to running when a mode other OPEN or CLOSE is used. Try:

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:

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 Thu 28/07/2005 20:15:06
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 Thu 28/07/2005 21:20:28
Quote from: peluchin on Thu 28/07/2005 20:15:06
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 Sun 14/08/2005 19:59:50
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:


Ã,  }
//-----------------------------------------------------

// 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 Sun 14/08/2005 20:39:36
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):

  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:


  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 Mon 15/08/2005 08:38:09
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 Mon 15/08/2005 14:43:35
Quote from: Scummbuddy on Tue 26/07/2005 22:53:03
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 Mon 22/08/2005 17:45:25
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 Thu 25/08/2005 23:10:09
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 Sun 04/09/2005 13:50:23
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 Sun 04/09/2005 20:28:20
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 Mon 19/09/2005 14:55: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 Tue 20/09/2005 15:04:07
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 Tue 20/09/2005 18:00:45
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 Thu 27/10/2005 03:41:56
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 Thu 27/10/2005 03:47:30
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 Thu 27/10/2005 03:56:46
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 Thu 27/10/2005 04:04:11
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 Thu 27/10/2005 04:38:01
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=ef5c5e1983193a0baabe32bb6a8a9a39opic=23252.0

Thanks again.
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: GokuZ on Mon 12/12/2005 15:48: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 Mon 12/12/2005 16:00:38
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:
#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 Mon 12/12/2005 16:09:54
Works Perfectly !
Thankyouverymuch! x
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: GokuZ on Fri 16/12/2005 20:01:33
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
Ã,  Ã,  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 Wed 21/12/2005 20:33:07
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 Wed 21/12/2005 21:24:40
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 Wed 21/12/2005 21:45:21
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 Wed 21/12/2005 21:55:13
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 Wed 21/12/2005 21:59:00
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 Wed 21/12/2005 22:22:01
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 Sat 07/01/2006 01:53:58
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 Sat 07/01/2006 02:40:08
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 Sat 07/01/2006 05:52:39
Okay, thanks.
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: Mats Berglinn on Fri 20/01/2006 10:42:59
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 Thu 16/02/2006 14:52: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

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

Tmode[counter].button!=-1


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


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 Wed 22/02/2006 02:00:17
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 Thu 02/03/2006 23:47:29
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 Thu 09/03/2006 18:09:03
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: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 Fri 10/03/2006 17:33:53
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 Wed 15/03/2006 23:00:19
Quote from: buloght on Thu 02/03/2006 23:47:29
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 Sat 18/03/2006 02:00:14
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 Wed 22/03/2006 12:59:01
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 Wed 29/03/2006 21:39:34
Quote from: scourgeLEFT 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 Wed 26/04/2006 22:35:51
Quote from: Campusanis on Wed 29/03/2006 21:39:34
Quote from: scourgeLEFT 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 Fri 12/05/2006 17:40:57
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 Fri 12/05/2006 18:13:16
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 Mon 15/05/2006 22:52:00
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 Tue 16/05/2006 09:16:53
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 Wed 17/05/2006 03:05:17
i am using 2.71
Title: Re: LucasArts GUI Help Thread <2.7 Now Available>
Post by: on Thu 18/05/2006 13:59:38
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 Thu 18/05/2006 14:14:27
Quote from: Wonko The Sane on Mon 15/05/2006 22:52:00
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 Fri 19/05/2006 20:23:19
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 Sun 21/05/2006 06:12:45
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 Tue 06/06/2006 13:19:06
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 Mon 12/06/2006 12:30:45
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:


Ã,  Ã,  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

#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.


Ã,  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 Mon 12/06/2006 16:29:50
Quote from: Lazarus on Mon 12/06/2006 12:30:45
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

#define FIRST_INV_SLOT_COORDS

Removed entirely


Quote

  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 Tue 13/06/2006 09:17:28
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
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 Fri 28/07/2006 02:19:50
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 Fri 28/07/2006 09:46:35
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 Fri 28/07/2006 21:41:29
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 Sat 29/07/2006 05:28:32
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 Sun 30/07/2006 14:53:12
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 Mon 21/08/2006 06:37:35
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 Mon 21/08/2006 08:10:28
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 Mon 21/08/2006 08:49:19
I had a quick look using 2.72, I also had the same error only it was with line 428.

ViewFrame *vf2=Game.GetViewFrame(CURSOR, 0, counter/DELAY);


So I then chaged it too :

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 Mon 21/08/2006 13:18:05
The bug is in line 387 of the template's global script, where:


int numframes=Game.GetFrameCountForLoop(CURSOR, 0);


should be


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 Mon 21/08/2006 21:47:04
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 Tue 22/08/2006 09:46:05
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:

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 Tue 22/08/2006 10:08:15
I've updated the zip with your change, Lazarus. Thanks again.
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: on Sat 26/08/2006 19:13:16
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 Sun 27/08/2006 08:19:31
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 Mon 28/08/2006 17:10:51
Quote from: SSH on Sun 27/08/2006 08:19:31
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 Wed 13/09/2006 18:35:09
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 Thu 14/09/2006 21:04:40
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 Sun 17/09/2006 12:37:28
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 Sun 17/09/2006 12:51:37
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 Sun 17/09/2006 13:10:04
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 Thu 21/09/2006 10:23:18
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 Wed 15/11/2006 12:18:50
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.

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 Wed 15/11/2006 12:46:45
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.


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


which = 1, so that would be:

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:

Tposition[counter].smallpicbutton.NormalGraphic = Tplayer[player.ID].smallpic;
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Lazarus on Thu 16/11/2006 09:43:48
I tried your shortened version of

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

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"

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

Ã,  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

Ã,  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 Thu 16/11/2006 11:16:17
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.


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:

  Tplayer[charid].topinvitem=MainInventory.TopItem;// MainInventory script name.

The original line uses GetPlayerCharacter, so shouldn't that be:

  Tplayer[player.ID].topinvitem=MainInventory.TopItem;// MainInventory script name.


And:

  character[player.ID].Clickable = 1;// Yes

Would work fine, but why not just:

  player.Clickable = 1;// Yes
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Lazarus on Fri 17/11/2006 09:10:04
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

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?

Ã,  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 Fri 17/11/2006 09:15:09
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 Fri 17/11/2006 09:32:55
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

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

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 Fri 17/11/2006 10:06:41
ew, this code looks a real mess. I'd rewrite it from scratch... ;)


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 Mon 20/11/2006 09:34:26
How would I change this function as it is also linked with the "function GiveInv(InventoryItem *invitem, Character *charid){"


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 Mon 20/11/2006 10:06:15

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 Mon 20/11/2006 11:41:35
Thanks SSH
I've been using your code from MI2 template into this template hope you don't mind.

My next problem is with

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.

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

Ã,  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 Mon 20/11/2006 13:39:33
This should work:

  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 Tue 21/11/2006 08:47:22
Thanks Ashen
Yes MAX_PLAYERS is defined with this

#define MAX_PLAYERS 3//Put here how many player characters your game has

My next problem, am I right with turning this

if (Tposition[counter].smallpicbevelbutton==GetGUIObjectAt(mouse.x,mouse.y) ){

into this

if (gMaingui.Controls[Tposition[counter].smallpicbevelbutton]){


If this is okay then would this

Ã,  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?

Ã,  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 Thu 23/11/2006 10:12:44
I'm assuming my last code is okay, as I would like to check that this next function is right.
Here's the original

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.

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

Ã,  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

Ã,  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

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

As I think it is linking to the function

function GiveInv(InventoryItem *invitem, Character *charid){


Thanks in advance
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Grue on Thu 23/11/2006 17:42:35
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 Mon 27/11/2006 02:12:27
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 Mon 27/11/2006 12:42:36
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 Wed 29/11/2006 12:03:23
Would I be right with turning this

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

into this as the function is now
GiveInv(InventoryItem *invitem, Character *charid)

GiveInv(invitem, charid);


and my next question is with this code

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

I've tried this

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 Thu 30/11/2006 21:51:47

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?


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:

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 Mon 04/12/2006 08:33:06
I get an error saying "cannot convert inventoryitem to int" here's the original


Ã,  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);"

Ã,  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 Mon 04/12/2006 12:08:28
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:

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:

if (player.ActiveInventory>=0)


I missed this before but since ActiveInventory is an InvItem pointer and not an int, that might need to be:

if (player.ActiveInventory.ID>=0)


Or:

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 Tue 05/12/2006 08:59:07
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

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 Wed 21/03/2007 00:15:53
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 Wed 25/04/2007 00:27:13
[deleted]
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Khris on Wed 25/04/2007 08:06:58
Again, where did you put the code? More info needed.
Title: SOLVED Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: on Wed 25/04/2007 16:16:09
      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

// 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 Thu 26/04/2007 13:12:19
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 Fri 27/04/2007 10:54:42
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 Sat 28/04/2007 01:54:41
Quote from: Ashen on Fri 27/04/2007 10:54:42
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 Sat 28/04/2007 14:07:10
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 Thu 19/07/2007 22:13:26
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 Thu 19/07/2007 23:59:22
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 Sun 26/08/2007 19:11:23
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 Sun 26/08/2007 20:43:54
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 Mon 24/09/2007 07:01:47
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 Sat 22/12/2007 21:07:22
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 Mon 31/12/2007 01:03:29
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 Wed 02/01/2008 22:27:22
SupSuper's save load with screen GUI is pretty awesome..
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: _thePrizeFighter_ on Fri 18/07/2008 03:00:38
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 Fri 18/07/2008 07:23:02
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 Mon 21/07/2008 21:16:44
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 Tue 22/07/2008 23:58:40
Right here:
http://aafiles.bicycle-for-slugs.org/ags/
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: fly on Tue 12/08/2008 16:40:18
Is there LucasArts GUI for AGS 3.0.2 ?
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Nahuel on Tue 23/09/2008 15:42:26
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 Tue 23/09/2008 19:42:29
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 Tue 23/09/2008 21:11:11
GREAT! thankyou!!
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Lethian on Thu 27/11/2008 14:16:54
[solved by myself]
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: MacGyver12345 on Sun 16/08/2009 20:47:30
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 Sun 16/08/2009 23:02:48
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 Mon 17/08/2009 08:59:42
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 Mon 17/08/2009 19:19:18
Quote from: subspark on Mon 17/08/2009 08:59:42
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 Tue 18/08/2009 01:00:28
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 Tue 18/08/2009 04:06:17
sigh
Title: Re: LucasArts GUI Help Thread <2.71 Now Available>
Post by: Dualnames on Thu 20/08/2009 14:39:14
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 Wed 30/12/2009 02:49:35
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 Wed 30/12/2009 16:47:06
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 Wed 06/01/2010 19:19:55
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 Sat 06/02/2010 13:49:59
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 Sun 07/02/2010 23:57:14
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 Tue 09/02/2010 16:21:44
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 Wed 10/02/2010 20:09:37
nvm DONE IT WOOT
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Jackpumpkinhead on Tue 20/04/2010 14:38:56
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 Tue 20/04/2010 22:48:03
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 Wed 21/04/2010 14:31:01
Quote from: Khris on Tue 20/04/2010 22:48:03
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 Mon 03/05/2010 20:26:43
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 Mon 03/05/2010 23:16:58
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 Tue 04/05/2010 09:50:53
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):


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 Tue 04/05/2010 14:54:47
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 Tue 04/05/2010 18:35:23
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 Tue 04/05/2010 20:14:10
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 Tue 04/05/2010 20:54:19
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 Wed 30/06/2010 03:29:14
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 Wed 30/06/2010 07:40:57
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 Wed 30/06/2010 08:13:11
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 Wed 30/06/2010 16:34:32
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 Wed 30/06/2010 23:37:57
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 Thu 01/07/2010 01:45:25
Quote from: Khris on Wed 30/06/2010 23:37:57
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 Thu 08/07/2010 03:51:28

EDITED: Never mind I just found what I needed.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Cyrus on Thu 03/02/2011 10:50:50
I've got the following problem with the DOTT template:

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 Thu 03/02/2011 12:52:38
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 Wed 11/05/2011 16:59:31
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 Wed 11/05/2011 17:20:08
Quote from: thomasjames on Wed 11/05/2011 16:59:31
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 Wed 11/05/2011 18:03:48
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 Tue 28/06/2011 22:06:29
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 Wed 29/06/2011 07:18:37
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 Wed 31/08/2011 02:35:37
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 Wed 31/08/2011 08:45:05
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)

int lang = eLangEN;

Just change that to:
(Sólo cambia que a:)

int lang = eLangES;
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Edgar_España on Wed 31/08/2011 16:06:25
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 Wed 31/08/2011 16:58:42
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.

    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.

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 Thu 01/09/2011 16:57: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 Thu 01/09/2011 22:16:15
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 Thu 01/09/2011 22:29:59
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 Sun 04/09/2011 12:35:26
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 Thu 30/08/2012 07:17:30
Right, so I'm a total noob to AGS and just following tutorials at this point.

[imgzoom]http://i.imgur.com/9Qxvm.png[/imgzoom]

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 Thu 30/08/2012 09:13:31
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 Thu 30/08/2012 20:17:31
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 Thu 30/08/2012 20:48:08
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 Fri 08/02/2013 02:46:27
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 Fri 08/02/2013 19:55:32
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 Sat 09/02/2013 10:12:26
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 Sat 28/12/2013 16:26:37
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 Sat 28/12/2013 16:28:00
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 Sat 28/12/2013 21:59:12
Quote from: Khris on Sat 28/12/2013 16:28:00
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 Sat 28/12/2013 23:18:45
Quote from: Khris on Sat 28/12/2013 16:28:00
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 Sun 26/01/2014 23:33:32
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 Mon 27/01/2014 14:46:16
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:

    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 Sun 02/02/2014 07:23:36
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 Sat 18/10/2014 16:23:00
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 Mon 17/11/2014 20:58:17
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 Tue 18/11/2014 08:02:06
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 (ags) Select

function cup_AnyClick()
{
  if(UsedAction(eGA_PickUp)) {
      player.AddInventory(iCup);
      oCup.Visible=false;
      player.Say("Yoink!");
    }
}
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on Tue 18/11/2014 13:33:56
Quote from: abstauber on Tue 18/11/2014 08:02:06
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 (ags) Select

function cup_AnyClick()
{
  if(UsedAction(eGA_PickUp)) {
      player.AddInventory(iCup);
      oCup.Visible=false;
      player.Say("Yoink!");
    }
}

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 Tue 18/11/2014 14:38:00
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 Tue 18/11/2014 19:15:12
Quote from: abstauber on Tue 18/11/2014 14:38:00
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 Tue 18/11/2014 19:24:41
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 Tue 18/11/2014 19:34:41
Quote from: abstauber on Tue 18/11/2014 19:24:41
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 Wed 19/11/2014 08:52: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.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on Thu 20/11/2014 20:12:40
Quote from: abstauber on Wed 19/11/2014 08:52: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 Mon 24/11/2014 21:30:29
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 Tue 25/11/2014 16:49: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 (ags) Select

function hDoor_AnyClick()
{
  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.");
  if (any_click_on_door_special(20, oDoor.ID, 61, 104, eDir_Left, 2, 180, 88, eDir_Left, null, null, 4, 0)==0) Unhandled();

}


Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on Tue 25/11/2014 17:57:07
Quote from: abstauber on Tue 25/11/2014 16:49: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 (ags) Select

function hDoor_AnyClick()
{
  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.");
  if (any_click_on_door_special(20, oDoor.ID, 61, 104, eDir_Left, 2, 180, 88, eDir_Left, null, null, 4, 0)==0) Unhandled();

}


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 Sat 06/12/2014 18:10:18
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 Sun 07/12/2014 08:42:50
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 Mon 08/12/2014 14:09:22
Quote from: abstauber on Sun 07/12/2014 08:42:50
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 Mon 08/12/2014 14:55:40
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 Mon 08/12/2014 22:01:45
Quote from: abstauber on Mon 08/12/2014 14:55:40
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 Tue 09/12/2014 09:08:39
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 Tue 09/12/2014 17:17:13
Quote from: abstauber on Tue 09/12/2014 09:08:39
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 Wed 07/01/2015 16:56:24
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 Sun 22/02/2015 10:53:26
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 Sun 22/02/2015 12:31:06
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 Mon 09/03/2015 17:21:09
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 Fri 13/03/2015 20:36:51
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 Sun 15/03/2015 18:30:13
Sorry for the late reply and thanks for the bug report.

In the globalscript, look for this line

function SaveTextBox_Click(GUIControl *control) {


and change it to

function SaveTextBox_Click(GUI *theGui, MouseButton button) {


This fixes it.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on Sun 22/03/2015 19:38:29
Thanks, works perfectly. :-D
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on Sun 21/06/2015 11:40:55
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 Wed 01/07/2015 13:43:11
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 Sun 05/07/2015 17:23:17
Quote from: abstauber on Wed 01/07/2015 13:43:11
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 Fri 09/10/2015 17:01:09
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 Fri 09/10/2015 17:09:13
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 Fri 09/10/2015 17:37:36
Quote from: abstauber on Fri 09/10/2015 17:09:13
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 (ags) Select
function WalkOffScreen(){
//handles the action of hotspots with exit extension ('>e').
//double click in such hotspots/objects... will make the player skip
//walking to it. Look the documentation for more information on exits.
 
  // doubleclick
  if (UsedAction(eMA_WalkTo)) {
    if (timer_run == true)
    {
      timer_run=false;
      if (MovePlayerEx(player.x,player.y,eWalkableAreas)>0) hotspot[GSlocid].RunInteraction(eModeUsermode1);
      if (MovePlayerEx(player.x,player.y,eWalkableAreas)>0) object[GSlocid].RunInteraction(eModeUsermode1);// we tried this

    }
    else
    {
      //doubleclick = false;
     timer_run = true;
      if (Go()){
        int x=player.x,y=player.y;
        int offset=walkoffscreen_offset;
        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,eAnywhere)>0){
          hotspot[GSlocid].RunInteraction(eModeUsermode1);
          object[GSlocid].RunInteraction(eModeUsermode1);// and this one

        }
      }   
    }
  }
}

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 Fri 20/11/2015 14:14:01
You need to check the location type first, before you can trigger the function.
Code (ags) Select

function WalkOffScreen(){
//handles the action of hotspots with exit extension ('>e').
//double click in such hotspots/objects... will make the player skip
//walking to it. Look the documentation for more information on exits.
 
  // doubleclick
  if (UsedAction(eMA_WalkTo)) {
    if (timer_run == true)
    {
      timer_run=false;
      if (MovePlayerEx(player.x,player.y,eWalkableAreas)>0) {
        if (GSloctype==eLocationHotspot) hotspot[GSlocid].RunInteraction(eModeUsermode1);
        else if (GSloctype==eLocationObject) object[GSlocid].RunInteraction(eModeUsermode1);
      }
    }
    else
    {
      //doubleclick = false;
      timer_run = true;
      if (Go()){
        int x=player.x,y=player.y;
        int offset=walkoffscreen_offset;
        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,eAnywhere)>0){
          if (GSloctype==eLocationHotspot) hotspot[GSlocid].RunInteraction(eModeUsermode1);
          else if (GSloctype==eLocationObject) object[GSlocid].RunInteraction(eModeUsermode1);
        }
      }   
    }
  }
}


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 (ags) Select
bool hide_gui_while_dialog;

In dialogscript.asc add this at the beginning
Code (ags) Select
bool in_speech;

now add this to the init function (line 19+)
Code (ags) Select
 
// Activate this to hide the action GUI while a dialog is active.
  this.hide_gui_while_dialog = true;


add this to the beginning of _prepare (now line 133+)
Code (ags) Select

  if (this.hide_gui_while_dialog == true && gMaingui.Visible == true && gAction.Visible == true) {
    gMaingui.Visible = false;
    gAction.Visible = false;
  }


and finally add this to repeatedly_execute (now line 738)
Code (ags) Select

  if (in_speech == true) {
    in_speech = false;
    if (CDG.hide_gui_while_dialog == true && gMaingui.Visible == false && gAction.Visible == false) {
      gMaingui.Visible = true;
      gAction.Visible = true;
    }
  }

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 Tue 24/11/2015 23:11:25
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 Wed 25/11/2015 12:18:34
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 Mon 04/04/2016 11:04:32
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 Mon 04/04/2016 15:40:23
Quotethe 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.

Quotewhen 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 Mon 04/04/2016 17:23:00
in the guiscript we did something like
Code (ags) Select

function AdjustLanguage() {
 
  // English
  if (lang == eLangEN){
    // yes/no-keys
    key_u_yes= 'Y';
    key_l_yes= 'y';
    key_u_no= 'N';
    key_l_no= 'n';
   
    // (eNum Name, Name, GUI Button ID, Sprite-Normal, Sprite-Highlight, Keyboard-Shortcut)
    if (FLASHBACK==false)
    {
    btnMainBack.NormalGraphic=123;
    SetActionButtons(eGA_GiveTo, "a_button_give    0  125  138 Qq");
    SetActionButtons(eGA_PickUp, "a_button_pick_up 1  126  139 Ww");
    SetActionButtons(eGA_Use,    "a_button_use     2  127  140 Ee");
    SetActionButtons(eGA_Open,   "a_button_open    3  129  142 Aa");
    SetActionButtons(eGA_LookAt, "a_button_look_at 4  134  147 Ss");
    SetActionButtons(eGA_Push,   "a_button_push    5  131  144 Dd");
    SetActionButtons(eGA_Close,  "a_button_close   6  133  146 Zz");
    SetActionButtons(eGA_TalkTo, "a_button_talk_to 7  130  143 Xx");
    SetActionButtons(eGA_Pull,   "a_button_pull    8  135  148 Cc");
    }
    else
    {
      btnMainBack.NormalGraphic=2184;
      SetActionButtons(eGA_GiveTo, "a_button_give    0  2220  2221 Qq");
    SetActionButtons(eGA_PickUp, "a_button_pick_up 1  2226  2227 Ww");
    SetActionButtons(eGA_Use,    "a_button_use     2  127  140 Ee");
    SetActionButtons(eGA_Open,   "a_button_open    3  129  142 Aa");
    SetActionButtons(eGA_LookAt, "a_button_look_at 4  134  147 Ss");
    SetActionButtons(eGA_Push,   "a_button_push    5  131  144 Dd");
    SetActionButtons(eGA_Close,  "a_button_close   6  133  146 Zz");
    SetActionButtons(eGA_TalkTo, "a_button_talk_to 7  130  143 Xx");
    SetActionButtons(eGA_Pull,   "a_button_pull    8  135  148 Cc");
    }
  }

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 Mon 04/04/2016 17:26:19
forcing with mainInv.characterToUse seems to works fine THKS! :)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: abstauber on Tue 05/04/2016 08:26:57
Good to hear, I ditch the test case then :)
As for the other problem: instead of calling AdjustLanguage() inside room_load, try 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 Wed 06/04/2016 17:31:06
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 Wed 06/04/2016 17:45:51
QuoteMaybe 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 :)


//guiscript.ash
import function InitGuiLanguage();



//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.
Quoteit 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 Thu 07/04/2016 01:01:07
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 Thu 07/04/2016 08:47:56
It seems to work really fine thanks Abstauber :)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on Mon 11/04/2016 07:34:31
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 Mon 11/04/2016 10:19:45
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 Mon 11/04/2016 11:26:04
Quote from: abstauber on Mon 11/04/2016 10:19:45
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 Thu 14/04/2016 10:46:29
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 Thu 14/04/2016 13:12:45
Oops, seems to be another bug:


//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 Mon 18/04/2016 08:41: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 Thu 16/06/2016 16:36:19
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 Fri 17/06/2016 09:58:55
Quote from: rmonic79 on Thu 16/06/2016 16:36:19
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 Sat 18/06/2016 12:43:45
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 Tue 21/06/2016 07:14:34
Thanks! It seems to work fine ;)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: rmonic79 on Thu 14/07/2016 19:15:35
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 (ags) Select

  if (Mouse.Mode==eModeInteract)
            {
              if (isAction(eGA_Use) && ii.IsInteractionAvailable(eModeInteract))
              {
                ActionLine.TextColor=ActionLabelColorHighlighted;
                ii.RunInteraction(eModeInteract);
                SetAction(eMA_Default);
              }
               else player.ActiveInventory=ii;
             }
          else
           {
              if ( (Mouse.Mode >0 && Mouse.Mode <10 )&& ii != null)
              {
                GSagsusedmode=Mouse.Mode;
                ActionLine.TextColor=ActionLabelColorHighlighted;
                ii.RunInteraction(Mouse.Mode);
                SetAction(eMA_Default);
              }
             
           }


i solved like this

Code (ags) Select

  if (Mouse.Mode==eModeInteract)
            {
             if (ii!=null) //HERE
             {
              if (isAction(eGA_Use) && ii.IsInteractionAvailable(eModeInteract))
              {
                ActionLine.TextColor=ActionLabelColorHighlighted;
                ii.RunInteraction(eModeInteract);
                SetAction(eMA_Default);
              }
               else player.ActiveInventory=ii;
             }
            }
         else
           {
              if ( (Mouse.Mode >0 && Mouse.Mode <10 )&& ii != null)
              {
                GSagsusedmode=Mouse.Mode;
                ActionLine.TextColor=ActionLabelColorHighlighted;
                ii.RunInteraction(Mouse.Mode);
                SetAction(eMA_Default);
              }
             
           }


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 Thu 28/07/2016 15:22:46
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 (ags) Select

    //right click in inventory
    else if (button==eMouseRightInv) {
      if (alternative_action==eMA_Default) {
        SetAction(eMA_Default);
      }
      else {
        SetAction(alternative_action);
        used_action=global_action;
        GSagsusedmode=Mouse.Mode;
        if (Mouse.Mode==eModeInteract && ii != null) { // HERE
          if (isAction(eGA_Use) && ii.IsInteractionAvailable(eModeInteract)) {
            UpdateActionBar();
            ActionLine.TextColor=ActionLabelColorHighlighted;
            ii.RunInteraction(eModeInteract);
            SetAction(eMA_Default);
          }
          else player.ActiveInventory=ii;
        }
        else {
          UpdateActionBar();
          ActionLine.TextColor=ActionLabelColorHighlighted;
          inventory[game.inv_activated].RunInteraction(Mouse.Mode);
          SetAction(eMA_Default);
        }
      }
    }

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 Thu 04/08/2016 12:04:24
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 Wed 08/03/2017 14:11:45
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 Wed 08/03/2017 17:31:27
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 Wed 08/03/2017 18:18:38
Quote from: Khris on Wed 08/03/2017 17:31:27
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 Fri 10/03/2017 01:48:55
Quote from: Khris on Wed 08/03/2017 17:31:27
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 Tue 02/05/2017 12:29:02
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.:
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.:
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 (ags) Select

if(UsedAction(eGA_LookAt)) {
    any_click_walk_look (203, 124, eDirectionRight, "bla bla bla"); //this can be cancelled successfully
    player.Say("bli bli bli"); //anything after still gets executed
    Wait (40);
    player.FaceDirection (eDirectionDown);
    Wait (20);
    player.Say ("blo blo blo");
}


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 Tue 02/05/2017 12:54:57
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 Tue 02/05/2017 21:05:26
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 Wed 03/05/2017 02:47:25
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 Wed 03/05/2017 10:16:35
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:

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 Wed 03/05/2017 10:32:05
Quote from: abstauber on Wed 03/05/2017 10:16:35
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:

/* 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 Wed 03/05/2017 10:36:28
Good idea, I'll update it soon

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

when starting a dialog using Dialog.Start() AGS seems to move the PC towards the NPC.
so when i do this
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 Wed 03/05/2017 13:04:08
Yep. This can be configured globally in guiscript.asc.
Around line 30 set

bool approachCharInteract = false;


You can also turn it on or off during game time via
set_approaching_char(bool enable)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: daniel on Wed 03/05/2017 13:29:45
Quote from: abstauber on Wed 03/05/2017 13:04:08
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 Wed 03/05/2017 14:33:22
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

  // --- 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 Thu 04/05/2017 11:21:33
thanks! i'll give it a shot later today:)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: daniel on Mon 08/05/2017 01:06:17
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 Mon 08/05/2017 10:45:47
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 Mon 08/05/2017 14:10:17
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 Mon 08/05/2017 14:19:28
Quotewhat 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 01234567890123456789012345678901234567890123456"
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: daniel on Mon 08/05/2017 14:27:49
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 Mon 08/05/2017 14:32:56
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 Tue 09/05/2017 08:07:57
I completely overlooked you ninja edit:
Quotep.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

#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 Tue 09/05/2017 11:11:40
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 Tue 09/05/2017 12:26:50
Sure, go to guiscript.asc and take a look at the Unhandled Function
instead of:

    // unhandled USE INV
    else if (UsedAction(eGA_UseInv)) player.Say("That won't do any good.");

you could write

    // 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 Tue 09/05/2017 14:32:19
great! thanks again:)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Loslem on Wed 12/07/2017 10:44:48
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 Wed 12/07/2017 11:51:59
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 Wed 12/07/2017 12:06:47
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 Wed 12/07/2017 13:29:25
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 Wed 12/07/2017 13:42:06
Yup, every door is unique (nod)
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on Wed 12/07/2017 19:21:02
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 Wed 12/07/2017 23:01:03
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 (ags) Select

#ifdef USE_OBJECT_ORIENTED_AUDIO
// In AGS 3.2 you do it this way:
//   Audioclip *openDoorSound = aDoorsound;
AudioClip*  openDoorSound, 
            closeDoorSound,
            unlockDoorSound;   
#endif


Aaaand I don't relly get the pointer stuff...
So this here doesn't work.
Code (ags) Select

#ifdef USE_OBJECT_ORIENTED_AUDIO
// In AGS 3.2 you do it this way:
//   Audioclip *openDoorSound = aDoorsound;
AudioClip *openDoorSound = aTuerAuf,
            closeDoorSound = aTuerzu,
            unlockDoorSound = aTuerAuf;   
#endif

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 Wed 12/07/2017 23:19:58
Right, you have to assign them inside a function.

Code (ags) Select
#ifdef USE_OBJECT_ORIENTED_AUDIO
// In AGS 3.2 you do it this way:
//   Audioclip *openDoorSound = aDoorsound;
AudioClip*  openDoorSound,
            closeDoorSound,
            unlockDoorSound;

// called by the engine if it exists, at the very start of the game
void game_start() {
  openDoorSound = aTuerAuf;
  closeDoorSound = aTuerzu;
  unlockDoorSound = aTuerAuf;
}
#endif
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: croquetasesina on Fri 22/03/2019 09:25:43
 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 Fri 22/03/2019 09:41:12
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 Fri 22/03/2019 10:48:00
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 Wed 27/03/2019 14:52:18
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 Thu 28/03/2019 16:06:06
I was trying with this, but nothing happens

Code (ags) Select

function english_AnyClick()
{
//switch the GUI to English
  int lang = eLangEN;
  AdjustLanguage();
  AdjustGUIText();
 
  if (Game.ChangeTranslation("English") == true) {
    Display("English loaded");
}
}


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

Code (ags) Select
import int lang;

Then open the main guiscript.asc and find
Code (ags) Select
int lang = eLangEN;
It's line 16 for me.
Right below, add this:
Code (ags) Select
export lang;

Finally, in your code, remove "int":

Code (ags) Select
  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 Fri 29/03/2019 15:33:03
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 Fri 29/03/2019 15:50:32
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 Mon 01/04/2019 10:18:57
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 Mon 01/04/2019 20:42:53
-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 Tue 02/04/2019 21:11:37
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 Wed 16/09/2020 12:18:49
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 Wed 16/09/2020 12:34:45
Quote from: FormosaFalanster on Wed 16/09/2020 12:18:49
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 Wed 16/09/2020 12:42:50
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!
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Reave on Thu 26/10/2023 20:24:58
I would like to make a game with this template.

I have two doubts: it's been a long time since the first message, is it necessary to install the proskitos template or the one that comes with the game is already ok?

Another doubt: I would like to use a bit strange resolution for my game: 1024x1024 for the "game space" and a bit more to make way for the classic Lucas Arts menu. I thought about putting 1024x1024 but the menu is placed on the background.

I thought then to put 1024x1100. My logic was that if I put more spaco below, the menu will go on the bottom but the menu doesn't seem to move. Is there an option to place the menu that I haven't seen?


Sorry if my English is not very good.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Crimson Wizard on Thu 26/10/2023 21:26:38
Quote from: Reave on Thu 26/10/2023 20:24:58I would like to make a game with this template.

I have two doubts: it's been a long time since the first message, is it necessary to install the proskitos template or the one that comes with the game is already ok?

Erm, this is an ancient thread, and frankly I'd suggest that it should be locked and unpinned, and a new sticky thread made if necessary with up-to-date info.

The newest module version that comes with AGS is called "Tumbleweed Verbs" (a parody on "Thimbleweed Park" game) and its thread may be found here:
https://www.adventuregamestudio.co.uk/forums/modules-plugins-tools/template-tumbleweed-verbs-1-4/
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Khris on Thu 26/10/2023 22:10:35
Quote from: Reave on Thu 26/10/2023 20:24:58Another doubt: I would like to use a bit strange resolution for my game: 1024x1024 for the "game space" and a bit more to make way for the classic Lucas Arts menu. I thought about putting 1024x1024 but the menu is placed on the background.
I thought then to put 1024x1100. My logic was that if I put more spaco below, the menu will go on the bottom but the menu doesn't seem to move. Is there an option to place the menu that I haven't seen?

I would suggest 960x1080, that way it at least matches Full HD vertically.
To move a GUI, change its "left" and "top" properties.
Title: Re: LucasArts GUI Help Thread (NEW Scumm GUI Available!)
Post by: Reave on Fri 27/10/2023 09:42:36
Thanks a lot to both of you