Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: NsMn on Tue 25/08/2009 17:05:11

Title: [MODULE] SierraInv 1.0 - Add a automatic-resizing inventory to your game!
Post by: NsMn on Tue 25/08/2009 17:05:11
Did you ever created a Sierra-style game and didn't get 5 cups because the inventory GUI was different? Or, did you wonder why you're wasting so much of your screen with a giant GUI, although you sometimes only need space for 3 items?

Well.... too bad I can't help.... nah, just kidding!

The SierraInv module helps you to create a inventory GUI familar to the ones in the old Sierra-classics, wihich changes its size depending on the amount of items the player's carrying!
Also, you can add your own, completely custom GUI as an iconbar. (Just read the readme and try the demo game  ;) )

Download Link:

-> http://dfoh.df.funpic.de/data/SierraInv%201.0.zip (http://dfoh.df.funpic.de/data/SierraInv%201.0.zip)

Demo game:

-> http://dfoh.df.funpic.de/data/SierraInv_Demo.7z (http://dfoh.df.funpic.de/data/SierraInv_Demo.7z)

=>Video demonstration<= (http://www.youtube.com/watch?v=Lzp8GVdtuHU)

Requirements: AGS 3.0 ;  other modules/plugins: none



This is my first script module, so don't hesitate to slap me until I'm only red goo  :P
Title: Re: [MODULE] SierraInv 1.0 - Add a Sierra-style inventory to your game!
Post by: TerranRich on Tue 25/08/2009 17:48:15
At first I thought this thread was a joke or something, because AGS already comes with a sort of Sierra-style inventory. Maybe mention its automatic resizability to the thread title? :)
Title: Re: [MODULE] SierraInv 1.0 - Add a automatic-resizing inventory to your game!
Post by: NsMn on Tue 25/08/2009 17:52:19
Thanks, did that.
Title: Re: [MODULE] SierraInv 1.0 - Add a automatic-resizing inventory to your game!
Post by: TerranRich on Tue 25/08/2009 18:01:34
Do you want me to do a video demonstration and upload it to YouTube? Are there enough sample inventory items in the demo game to test it out fully?
Title: Re: [MODULE] SierraInv 1.0 - Add a automatic-resizing inventory to your game!
Post by: NsMn on Tue 25/08/2009 18:11:11
Say, that would be really nice! There is  actually an unlimited amount of items, because you can pick up one as often as you want.
Title: Re: [MODULE] SierraInv 1.0 - Add a automatic-resizing inventory to your game!
Post by: TerranRich on Tue 25/08/2009 18:53:59
Like I said in another module thread, every module should come with a video demonstration. Just get a free recording program like CamWhateverItsCalled and upload!
Title: Re: [MODULE] SierraInv 1.0 - Add a automatic-resizing inventory to your game!
Post by: NsMn on Wed 26/08/2009 07:32:36
Okay, video is added.
Title: Re: [MODULE] SierraInv 1.0 - Add a automatic-resizing inventory to your game!
Post by: TerranRich on Thu 27/08/2009 03:06:48
Hmm, doesn't seem to work 100%. Should this really be "version 1.0"? ;)
Title: Re: [MODULE] SierraInv 1.0 - Add a automatic-resizing inventory to your game!
Post by: Khris on Thu 27/08/2009 07:22:51
Some suggestions:

- use a struct and group the Set* functions together:
  void SierraInv::SetUp(int MaxWidth, int MaxHeight, ...)
- the module relies on two GUIs and their controls already existing and having specific names, ideally the player should tell the module which GUI to use and it'll work from there

I'd do this:
In game_start, the user calls e.g. SierraInv.SetGui(GUI*g);
The module looks through its controls for an InvWindow and reads out/calculates all the dimensions and margins.
Using on_event/eEventAdd/LoseInventory, the module then resizes the GUI and InvWindow, repositioning all controls automatically.
Basically, a simple coordinate relation should reveal the layout of the GUI's controls and should suffice to determine the necessary changes to the other controls' positions.