Inventory interaction problems...

Started by , Sun 26/10/2003 20:19:32

Previous topic - Next topic

JudasFm

I've been trying to add a button to the Inventory GUI for ages now for Interaction, but it just doesn't appear when I test the game.  I've saved it and everything, it just doesn't work ??? Any help greatly appreciated.  Also, how do you get the inventory items working outside (ie, I want to have someone put a ring on in my game, but when I click the ring on the character nothing happens) It's probably really simple, but I'm very new to all this.  Help please?  :-\

Ishmael

Well, I'm not completely sure what you mean by "it doesnt appear". Is it that the button wont appear, or it wont change the cursor mode? You should just set the button action to 'Set Cursor Mode' and the 'cursor mode to set' to 2. This should do it...  and for the ring question, do you mean that you have the ring on the character, in game? That's quite difficult with AGS right now, in case I understood correct. Could you elaborate a bit?
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

JudasFm

#2
Quote from: TK on Mon 27/10/2003 06:14:05
Well, I'm not completely sure what you mean by "it doesnt appear". Is it that the button wont appear, or it wont change the cursor mode? You should just set the button action to 'Set Cursor Mode' and the 'cursor mode to set' to 2. This should do it...  and for the ring question, do you mean that you have the ring on the character, in game? That's quite difficult with AGS right now, in case I understood correct. Could you elaborate a bit?

Sure...sorry for the muddle-headedness of my post yesterday :-[...it was pretty late at night when I wrote it

What I mean is the button won't appear.  I've got the cursor mode sorted, and when I'm editing it I can see it in place on the Inventory Window, but when I try to play all it has are the standard 'Look', 'Pointer' and 'OK'.

The ring question...yeah, I should have been a little clearer on that one  :-[ My bad.  Let me try to explain a little better.

The basic idea is that when the character puts the ring on, it sucks them into another dimension.  I can go into the inventory and select the ring, that's no problem, but when I click it on the character, I can't make anything happen.  At first I thought it might be because I didn't have the next room completed yet, so I replaced the code with a 'DisplayMessage' to test it but still nothing.

I guess what I'm really asking is how can you make inventory objects interact with characters or any other background items/hotspots.  Um.  Does that make more sense? :)

CB..

use the
if inventory item number was used
then
go to room options  on the character or hot spot etc

Paper Carnival

#4
QuoteWhat I mean is the button won't appear. I've got the cursor mode sorted, and when I'm editing it I can see it in place on the Inventory Window, but when I try to play all it has are the standard 'Look', 'Pointer' and 'OK'.

I think this is one of the most common questions. I had the same thing when I started, though I realised what was wrong myself. Anyway, to fix this press Ctrl+G to make the main game script appear. Find the line which says: "function show_inventory_window () {" (if you didn't make any changes in the script it should be on line 11). Now, what you see is:
Quotefunction 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
 GUIOn (INVENTORY);  
 // switch to the Use cursor (to select items with)
 SetCursorMode (MODE_USE);
 // But, override the appearance to look like the arrow
 SetMouseCursor (6);
*/
}
Replace it with:
Quotefunction 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
 GUIOn (INVENTORY);  
 // switch to the Use cursor (to select items with)
 SetCursorMode (MODE_USE);
 // But, override the appearance to look like the arrow
 SetMouseCursor (6);
}

You see, everything after // or anything between /* and */ is ignored. You must set it to ignore the line where it says to bring the default inventory (or even delete it) and then make it not ignore the lines where the custom inventory is brought up.

JudasFm

 ;D Thanks Guybrush, you're a star.  I'll try that tonight

SMF spam blocked by CleanTalk