LucasArts GUI Help Thread (NEW Scumm GUI Available!)

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

Previous topic - Next topic

SSH

Code: ags

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

12

Lazarus

#361
Thanks SSH
I've been using your code from MI2 template into this template hope you don't mind.

My next problem is with
Code: ags

function GlobalConditionEx(int parameter, int roomx, int roomy){
// here are some conditions that are used many times in the script
Ã,  if (parameter==1){//if the mouse is in the inventory and modes Walk or pickup are selected
Ã,  Ã,  return ( GetInvAt(roomx-GetViewportX(),roomy-GetViewportY())>=0 && (GetAGSMode(GetMode())==9 || GetAGSMode(GetMode())==5) );
Ã,  }
Ã,  else if (parameter==2){//if the mode is useinv and the mouse is over the active inv (like "use knife on knife")
Ã,  Ã,  return (character[GetPlayerCharacter()].activeinv==GetInvAt(mouse.x,mouse.y) && GetAGSMode(GetMode())==4);
Ã,  }
Ã,  else if (parameter==3){//if the mode is talk, or "Give", and the mouse isnt over a character
Ã,  Ã,  return (Ã,  Ã, (GetAGSMode(GetMode())==MODE_TALK || (Mode(GIVE) && GetAGSMode(GIVE)==4) ) && GetLocationType(roomx-GetViewportX(),roomy-GetViewportY())!=2Ã,  );
Ã,  }
Ã,  else if (parameter==4){//if its a 'only inventory' mode (like GIVE), and the mouse isnt over a inv.item
Ã,  Ã,  return (GetAGSMode(GetMode())==MODE_USE && Tmode[GSmode].onlyinv==1 && GetInvAt(mouse.x,mouse.y)<0);
Ã,  }
Ã,  else if (parameter==5){
Ã,  Ã,  int counter=1;
Ã,  Ã,  while (counter<MAX_PLAYERS){
Ã,  Ã,  Ã,  if (GetGUIAt(mouse.x,mouse.y)==MAINGUI && GetGUIObjectAt(mouse.x,mouse.y)==Tposition[counter].smallpicbevelbutton) return 1;
Ã,  Ã,  Ã,  counter++;
Ã,  Ã,  }
Ã,  Ã,  return 0;
Ã,  }
}

And I sort of ended up with this which I think is probably not right, haven't tried parameter 5 yet.
Code: ags

function GlobalConditionEx(int parameter, int roomx, int roomy){
// here are some conditions that are used many times in the script
Ã,  InventoryItem *ii=InventoryItem.GetAtScreenXY(mouse.x,mouse.y);
Ã,  if (parameter==1){//if the mouse is in the inventory and modes Walk or pickup are selected
Ã,  Ã,  return ( ii!=null && (roomx-GetViewportX(),roomy-GetViewportY())>=0 && (GetAGSMode(GetMode())==9 || (GetAGSMode(GetMode())==5) );
Ã,  }
Ã,  else if (parameter==2){//if the mode is useinv and the mouse is over the active inv (like "use knife on knife")
Ã,  Ã,  return (player.ActiveInventory==ii && GetAGSMode(GetMode())==4);
Ã,  }
Ã,  else if (parameter==3){//if the mode is talk, or "Give", and the mouse isnt over a character
Ã,  Ã,  return (Ã,  Ã, (GetAGSMode(GetMode())==eModeTalkto || (Mode(GIVE) && GetAGSMode(GetMode())==4) ) && GetLocationType(roomx-GetViewportX(),roomy-GetViewportY())!=2Ã,  );
Ã,  }
Ã,  else if (parameter==4){//if its a 'only inventory' mode (like GIVE), and the mouse isnt over a inv.item
Ã,  Ã,  return (GetAGSMode(GetMode())==eModeUse && Tmode[GSmode].onlyinv==1 && ii==null);
Ã,  }
Ã,  else if (parameter==5){
Ã,  Ã,  int counter=1;
Ã,  Ã,  while (counter<MAX_PLAYERS){
Ã,  Ã,  Ã,  if (GetGUIAt(mouse.x,mouse.y)==MAINGUI && GetGUIObjectAt(mouse.x,mouse.y)==Tposition[counter].smallpicbevelbutton) return 1;
Ã,  Ã,  Ã,  counter++;
Ã,  Ã,  }
Ã,  Ã,  return 0;
Ã,  }
}

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


*EDIT*
Just realised that maybe parameter 1 could be
Code: ags

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

Ashen

This should work:
Code: ags

  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.
I know what you're thinking ... Don't think that.

Lazarus

#363
Thanks Ashen
Yes MAX_PLAYERS is defined with this
Code: ags

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

My next problem, am I right with turning this
Code: ags

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

into this
Code: ags

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


If this is okay then would this
Code: ags

Ã,  string buffer;
Ã,  string madetext;
Ã,  int mode;
Ã,  mode=GSmode;

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


turn into this?
Code: ags

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

*Currently using AGS Editor 2.70 (Build 2.70.601)*

Lazarus

#364
I'm assuming my last code is okay, as I would like to check that this next function is right.
Here's the original
Code: ags

function WalkOffScreen(){
 //handles the action of hotspots with exit extension ('>e' by default).
 //double click in such hotspots/objects... will make the player skip
 //walking to it. Look the documentation for more information on exits.
Ã,  if (IsTimerExpired(19)==1){ 
Ã,  Ã,  SetTimer(19,GetGameSpeed()/3);
Ã,  Ã,  if (Go()){
Ã,  Ã,  Ã,  int x=character[GetPlayerCharacter()].x,y=character[GetPlayerCharacter()].y;

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


And here's mine.
Code: ags

function WalkOffScreen(){

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

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


*Edit*
My next problem is with
Code: ags

Ã,  else if (button==eMouseLeft || button==eMouseRight) {

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


I've tried this but doesn't work
Code: ags

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

And how would I change
Code: ags

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

As I think it is linking to the function
Code: ags

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


Thanks in advance
*Currently using AGS Editor 2.70 (Build 2.70.601)*

Grue

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?
Now you see, this is where we have a problem, I currently don't have a signature, and if I did, well, use your imagination to picture it, as you won't be seeing it magically appear here any time soon. Now run along and enjoy the rest of your life, and hopefully, go back to play some of those old games from the past.

werpy

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.

SSH

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

Lazarus

Would I be right with turning this
Code: ags

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

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

GiveInv(invitem, charid);


and my next question is with this code
Code: ags

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

I've tried this
Code: ags

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

but it's not working any helk would be grateful
*Currently using AGS Editor 2.70 (Build 2.70.601)*

Ashen

Code: ags

GiveInv(invitem, charid);

There's no obvious reason that shouldn't work, provided invitem and charid are both valid pointers of the right type. Except, there might be a problem using pointers with the same names as those used in the function declaration (the XXX is a global var, cannot use as name for a local error is a possibility). Unless that was just psuedocode?

Code: ags

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

For this - you don't actually seem to be doing anything with player.ActiveInventory.Name, so it's no wonder nothing's happening. What about using:
Code: ags

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).
I know what you're thinking ... Don't think that.

Lazarus

I get an error saying "cannot convert inventoryitem to int" here's the original

Code: ags

Ã,  else if (button==eMouseLeft || button==eMouseRight) {

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

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

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

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


And here's what I have so far, I had to also add
Character *charid;
InventoryItem *invitem;
As I got an undefined token with the "GiveInv(invitem, charid);"
Code: ags

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

*Currently using AGS Editor 2.70 (Build 2.70.601)*

Ashen

Well, in that example invitem and charid aren't actually pointing to anything so you might still get a 'null pointer' error from it.

From the original:
Code: ags

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


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

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

Also, from the new version:
Code: ags

if (player.ActiveInventory>=0)


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

if (player.ActiveInventory.ID>=0)


Or:
Code: ags

if (player.ActiveInventory!=null)


Of course, if it works as-is, then don't worry about it.
I know what you're thinking ... Don't think that.

Lazarus

I've tried both examples you suggested and both give the same error "null pointer reference" on mouse click.
This happens as soon as I click anywhere on the screen.

Here's the on mouse click
Code: ags

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


*Currently using AGS Editor 2.70 (Build 2.70.601)*

nahuel

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?

bicilotti

[deleted]

Khris

Again, where did you put the code? More info needed.

bicilotti

#376
Code: ags
      StrCat(texty,"PULL ");}
    if (GetGlobalInt(10)==10) {
      StrCat(texty,"GIVE ");
      StrCat(texty, activeinvname);
      StrCat (texty, " TO ");}
    if (GetGlobalInt(10)==11) {
      StrCat(texty,"USE ");
      StrCat(texty, activeinvname);
      StrCat (texty, " WITH ");}
    StrCat (texty, placer);
    SetLabelText (0,10,texty);}
  else if (GetCursorMode()==MODE_WALK){ SetLabelText (0,10,"WALK TO @OVERHOTSPOT@");}
SetLabelColor (0,10,41736);}
function unhandled_event (int what, int type) {
  //all the unhandled_events for various things.
  if ((what==1)&&(type==8)) { //hotspot
         if (GetGlobalInt(10)==1){ DisplaySpeech (EGO, "I can't give that.");}


That's where the "unhandled" section begins

at the end of the script there is

Code: ags
// 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".

bicilotti

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

Ashen

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.  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.)
I know what you're thinking ... Don't think that.

bicilotti

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



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?

SMF spam blocked by CleanTalk