Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Drax on April 13, 2004, 06:18:13 PM

Title: inventorywindow buttons
Post by: Drax on April 13, 2004, 06:18:13 PM
I have a little problem with my inventory buttons.

I had a lot of Items and if I wan't to scroll it's more then just uncomfortable. I always have to move my mouse after clicking one item onward, if I don't do, the buttons won't scroll the items.
So you can't click fast through it, an it semms to stuck every few clicks.

Lakeside does the GUI gfx in the game, but I think he only removed the standart gfx.

I'm asking because I can't find some scripting for the inventory anywere.

DraX




 

Title: Re:inventorywindow buttons
Post by: Mnemonic on April 13, 2004, 06:22:43 PM
Sorry, DraX, I'm not sure a fully understand. What exactly would you like to achieve?
Title: Re:inventorywindow buttons
Post by: Drax on April 13, 2004, 06:50:33 PM
No Problem.

Fast clicking the buttons in my inventory isn't possible.

I always have to move my mouse a little bit before I can click again. So I can't do this multible clicking thing to get to the first Item if i've been at the last.  :-\ Clear?

With a lot of Items it's very nerved to get from the left to right, because I can't click fast at the button. I always have to move the mouse or wait till the next click is noticed.

It would be nice if i can click fast and multible times and the invetory scrolls as fast as I click. The cream of the crop would be that I could hold the mouse down and the inventory scroll till I release.

   
Title: Re:inventorywindow buttons
Post by: odnorf on April 13, 2004, 07:01:58 PM
Let me rephrase what DraX is asking for.  ;)
He wants the engine to have a queue memory and log how many times you click the button and do the action. So when he clicks REALLY FAST (for example) 5 times on the inventory button then it does the action 5 times and not just once.

Hm... I can think of times where this might can in handy (especially in non-adventure games like a tetris ;)) but I don't think that it should be always enabled.
Title: Re:inventorywindow buttons
Post by: Drax on April 13, 2004, 07:15:26 PM
Is the Scrolling procedure so dead slow?
 I mean It haven't to mermory all my clicks, but reacting on every click, whithout changeing mous position every time. I'm not intended to click on the button like a mashinegun ;)

It would be interesting if It is just in my Inventory. But I can't believe that. If anybody has the fancy to add a lot of items and trying to click as fast as he can to the end (right) and back to the beginning (left). It very hard and if you should do that a whole times (playing a adventure) it's realy distempering.

I hope its not just a mistake in my game
 :-X
Title: Re:inventorywindow buttons
Post by: Mnemonic on April 13, 2004, 07:30:24 PM
Oh, I understand now :) Well, the problem is, that two fast clicks actually trigger a double-click event, resulting in pauses in scrolling. You could probably explicitly handle double-click events in your buttons's script and convert them to normal presses.
If you have that many items, you might also consider redesigning the inventory, either to make it scoll the entire "row", not just one item a time, or create a multi-row inventory-
Title: Re:inventorywindow buttons
Post by: Drax on April 13, 2004, 07:44:59 PM
 ;D Ahhh, jear. That's the fault!

I think the Inventroy hasn't be redesigned. The actual number of Items is not to be exceeded.

While developing I use a cheat to get all Items  :-X(it will be removed in the final version  8)) and then I got a lot of Items that wouldn't exist because of resulting by using two items together. If the doubleclick would be a normal, all would be fine!

Back to the problem.
Where can I script these Events for the buttons?

Quote
I'm asking because I can't find some scripting for the inventory anywere.




 
Title: Re:inventorywindow buttons
Post by: Mnemonic on April 13, 2004, 07:48:24 PM
Create a new script, containing something like:

on "LeftDoubleClick" this.Press();


And attach the script to both scrolling buttons. In the inventory definition file add SCRIPT = "path\name.script" to both buttons.

I didn't test it but it might work :)
Title: Re:inventorywindow buttons
Post by: Drax on April 13, 2004, 08:02:47 PM
 ;D ;D ;D

Now It scroll's like a jung princes swimming in golden water  ???

 :) No, really. It's so mutch better.

ThX for your help

DraX

p.s. you should implement this in the next update. If you want to.
Title: Re: inventorywindow buttons
Post by: Igorrr on July 23, 2004, 06:52:44 PM
I was searching the posts because I have a problem concerning scripting with the inventory (yes I am using build 1.2.044).

How can I attach a script to the inventory definition?
When I add this line to the code:
Code: [Select]
SCRIPT = "interface\close.script"

I get this error message in wme.log:
Code: [Select]
Syntax error in INVENTORY_BOX definition
Error parsing INVENTORY_BOX file 'interface\inventory.def'

I am trying to create an inventory similar to Sierra games. Meaning it opens when you press the inventory button (or a hot key) and that it has some buttons included like look, use, drop, exit.
Title: Re: inventorywindow buttons
Post by: Mnemonic on July 23, 2004, 06:56:59 PM
The inventory definition file has a WINDOW definition embedded inside. You'll have to attach the script to that window, not the inventory itself.
Title: Re: inventorywindow buttons
Post by: Igorrr on July 23, 2004, 07:35:49 PM
Emmm...yeah... I knew that...  ::)

Thanks

going to find a place to hide from shame...
Title: Re: inventorywindow buttons
Post by: revvin on March 20, 2005, 02:16:43 PM
Quote
or create a multi-row inventory

This is exactly what I am looking for. :)  But there is no mention anywhere else on the forums about multi-row inventories - and its not in the Help?

I have nine cells each 75px/75px. The grid is 3x3.  No matter what size I define the "AREA" - it still only populates a single row? (the first three cells)

Does anybody have any code or even just instructions for creating mult-row inventories?

Many thanks,
Rev
Title: Re: inventorywindow buttons
Post by: McCoy on March 20, 2005, 02:58:46 PM
The inventory in Fred is multi-row, you can check out the code.
Title: Re: inventorywindow buttons
Post by: Mnemonic on March 20, 2005, 03:21:15 PM
But it's really given by the area only. WME will automatically make the inventory multi-row if multiple rows fit into the area. Can you post your inventory definition file?
Title: Re: inventorywindow buttons
Post by: revvin on March 21, 2005, 12:05:48 AM
McCoy: Thanks for your quick response. :)

Mnemonic:  Thats what I thought - but it wasnt working... I must just be misunderstanding the AREA definition.

You see - this is my code definition (which now works fine). But if I change the AREA Width (currently 375) to anything less than 152 - I dont see anything. I am not sure why - because the cell is 75px - and even if you add 32px (spacing both sides of the cell) its only 107px ?

Code: [Select]
   ITEM_WIDTH = 75
  ITEM_HEIGHT = 75
  SPACING = 16
  SCROLL_BY = 3
  HIDE_SELECTED = TRUE
  AREA { 77, 115, 375, 375 }
  EXCLUSIVE = TRUE

Anyway - I just increased the AREA to a figure way above what I actually need (space+cell+space+cell+space+cell+space = 289px  - so in theory AREA { 77, 115, 289, 289 } should work fine) and it now works perfectly!

Thanks for the help again.  ;D