Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - greg

Pages: 1 [2]
16
Technical forum / Compiler Bugs?
« on: September 24, 2006, 05:23:04 AM »
Hi Mnemonic,

I think I came across two bugs in the compiler:

1. The compiler (wme_comp.exe) complains when I use the following:

Code: [Select]
Game.SelectedItem.Name
However, it allows:

Code: [Select]
var SelItem = Game.SelectedItem;
SelItem.Name

Shouldn't Game.SelectedItem.Name be permitted?

2. In the following "if" statement...

Code: [Select]
if (SelItem != null && SelItem.GetHoverCursor() == null) ...

...if SelItem is null, shouldn't the conditional immediately evaluate to false, meaning (SelItem.GetHoverCursor() == null) would never be evaluated?

When I compile my game and run it, the console prints errors like crazy because it's trying to evaluate SelItem.GetHoverCursor() even when SelItem is null.

Thanks!  Please let me know if you need any additional information.

Greg

PS: For an Item object, what is the difference between the "standard" cursor and "Normal" cursor, e.g. Item.GetCursor() vs. Item.GetNormalCursor()?
PPS: Have you considered adding Item.{Has,Remove}{Normal,Hover}Cursor() to be consistent with Item.{Has,Remove}Cursor()?

17
Technical forum / Inventory Questions
« on: September 24, 2006, 02:42:08 AM »
Hi WME Folks,

I'm interested in creating a customized inventory so that I have more control over the interface.  (Basically, I'd like to make sure that all items, regardless of size, are centered within the cell.)

1. Within the builtin inventory structure, is it possible to center a sprite within a cell?

2. How would one go about creating a custom inventory?  My thought was to create a window and then position the inventory items within the window.  Can I do this with Item objects, or would I need to use Buttons or another form of UI object?  My first attempt was this which, as this post might suggest, failed miserably:

Code: [Select]
var current_point; // coordinates of upper-left corner of current tile
current_point.x = start_point.x;
current_point.y = start_point.y;

for (var i=0; i < Game.NumItems; i=i+1) {
var Item = Game.QueryItem(i);

// display and position the inventory item within the window
Item.X = current_point.x;
Item.Y = current_point.y;
Item.Active = true;

// update current_point
current_point.x = current_point.x + tile_size.x + tile_spacing.x;

// have we reached the end of the row?
if (current_point.x >= (start_point.x + ((tile_size.x + tile_spacing.x) * num_tiles.x))) {
current_point.x = start_point.x;
current_point.y = current_point.y + tile_size.y + tile_spacing.y;

// have we reached the end of the last row?
if (current_point.y >= (start_point.y + ((tile_size.y + tile_spacing.y) * num_tiles.y))) {
break;
}
}
}

3. So that I can center the item within a cell, is it possible to query the width and height of a sprite?

Thanks so much for your help!

Greg

18
Technical forum / Music and Sound Questions
« on: August 21, 2006, 06:41:54 AM »
Hi All,

I'm a newcomer to the Wintermute Engine, and I have a couple questions about its music and sound functionalities:

1. According to the manual, there are 5 music channels.  Are all five of these channels dedicated solely to music and not used by any PlaySound commands?  (Also, by default, does PlayMusic try to use Channel 0?)

2. I know there's not a built-in function for this, but could you suggest a way to filter an audio file within WME as to change the pitch or speed of the playback?

Thanks so much for your help!

Greg

Pages: 1 [2]

Page created in 0.042 seconds with 23 queries.