Author Topic: Inventory window issue [SOLVED]  (Read 164 times)

Axelord1942

    • I can help with AGS tutoring
    •  
    • I can help with animation
    •  
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with making music
    •  
    • I can help with play testing
    •  
    • I can help with PR
    •  
    • I can help with proof reading
    •  
    • I can help with publishing
    •  
    • I can help with story design
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Inventory window issue [SOLVED]
« on: 03 Feb 2018, 21:21 »
Trying to sort out my inventory gui.  Currently all my items seem jumbled together, do I have to make the sprites smaller or what?

Problem in question

Additionally, I tried having an inventory window in the icon bar, Space Quest style, but so far all it does is show me all my items all jumbled together in the one window so I've just temporarily removed it.  Do I have to use some ActiveInventory script to get that working right?

This is a debug room, so I'm not worried about character scale or anything like that in here, just use this place to test out my animations.  Thanks in advance.  I've been scouring the forums on and off while working but I haven't found this specific issue yet.  I'll keep looking and update if I find it.
« Last Edit: 03 Feb 2018, 22:00 by Axelord1942 »
You have been eaten by a Gru

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Inventory window issue
« Reply #1 on: 03 Feb 2018, 21:33 »
Regarding items stacked up - you need to set up ItemWidth and ItemHeight properties of the InventoryWindow.

Additionally, I tried having an inventory window in the icon bar, Space Quest style, but so far all it does is show me all my items all jumbled together in the one window so I've just temporarily removed it.  Do I have to use some ActiveInventory script to get that working right?
Yes, normally you need to put a Button and change its graphic to player.ActiveInventory.Graphic in script.

Also, there is a special trick for this, which you may see in Default Template: just type in "(INVSHR)" into Button's Text property, and it will show current inventory automatically.


EDIT: wait, it looks like you are already using Default Template? If so, you should be having such button on the icon bar, unless you deleted it.
« Last Edit: 03 Feb 2018, 21:39 by Crimson Wizard »

Axelord1942

    • I can help with AGS tutoring
    •  
    • I can help with animation
    •  
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with making music
    •  
    • I can help with play testing
    •  
    • I can help with PR
    •  
    • I can help with proof reading
    •  
    • I can help with publishing
    •  
    • I can help with story design
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: Inventory window issue
« Reply #2 on: 03 Feb 2018, 21:43 »
Yeah, I just read about ItemHeight and ItemWidth...still at a loss though. :/ I set it up in game start as a function, right?  I'm not getting any feedback from the program (no autocomplete, etc.) so I don't think I'm doing it right.  Where do I set this up?

Thanks for the help, I appreciate it!:-D
You have been eaten by a Gru

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Inventory window issue
« Reply #3 on: 03 Feb 2018, 21:49 »
Yeah, I just read about ItemHeight and ItemWidth...still at a loss though. :/ I set it up in game start as a function, right?  I'm not getting any feedback from the program (no autocomplete, etc.) so I don't think I'm doing it right.  Where do I set this up?

You may set them up in the properties window (bottom-right corner of the screen) when you select InventoryWindow control in the editor.
Note, you need to select the white rectangle frame on the Inventory GUI, not the GUI itself (grey dialog box).

Step by step, just in case:
* find gInventory under "GUIs" node in the project tree and double click to open GUI editor.
* click to select InventoryWindow (white rectangle)
* now you will see this inventory's properties in the bottom-right table.

You may also change them in script too, in game_start:
Code: Adventure Game Studio
  1. function game_start()
  2. {
  3.     invCustomInv.ItemWidth = 100;
  4.     invCustomInv.ItemHeight = 100;
  5. }
  6.  

invCustomInv - this is how the InventoryWindow control is named in default template. If you rename it, obviously you need to use the new name.
« Last Edit: 03 Feb 2018, 21:52 by Crimson Wizard »

Axelord1942

    • I can help with AGS tutoring
    •  
    • I can help with animation
    •  
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with making music
    •  
    • I can help with play testing
    •  
    • I can help with PR
    •  
    • I can help with proof reading
    •  
    • I can help with publishing
    •  
    • I can help with story design
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: Inventory window issue
« Reply #4 on: 03 Feb 2018, 22:00 »
Oh my lord, I don't know how i didn't notice the parameters in the property box of the gui editor. -_-

That solves that, I guess!  Thanks for being patient, I feel pretty dumb right now! (laugh)

I'm sure I'll be back soon, I'm not very good at this yet!
You have been eaten by a Gru