LucasArts GUI Help Thread (NEW Scumm GUI Available!)

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

Previous topic - Next topic

Scummbuddy

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.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

monkey0506

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.

RickJ

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.

Proskrito

if you need any help with the template or could i help with anything, just tell me : )

RickJ

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

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

Kachicho

      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!!

Theme

How do i make a coin appear then to get the option like in moneky island 3 or fullthrottle?
im noob in ags

o/

monkey0506

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

strazer

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, btw.

Theme

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/

Mats Berglinn

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)?

Theme

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/

amb

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.


Lazarus

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
*Currently using AGS Editor 2.70 (Build 2.70.601)*

Gilbert

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

Lazarus

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
*Currently using AGS Editor 2.70 (Build 2.70.601)*

Gilbert

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

Lazarus

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;
}


*Currently using AGS Editor 2.70 (Build 2.70.601)*

Gilbert

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.

SMF spam blocked by CleanTalk