Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

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 - sharkbait

Pages: [1]
1
Feature requests, suggestions / Re: Physics engine in WME
« on: May 03, 2007, 09:15:38 AM »
FogGobbler, I think you could write a WME plugin for physics if you really need it. You could wrap an existing physics library in WME's plugin framework.

2
Community bulletin board / Re: Poll: What 3D software are you using?
« on: April 07, 2007, 07:17:05 PM »
I'm developing a 2D hand-drawn game, but I'm using Wings 3D to lay out the scene and get a sense of space. I then hand-draw the scene over the model doing alterations as necessary.

3
Technical forum / Re: GetSprite problem
« on: April 03, 2007, 04:24:24 PM »
I have to agree that I find the lower-casing annoying. Sometimes I even end up opending the files via a text editor to correct the cases but obviously the changes get lost as soon as I use the related editors. Is there a reason for the change of case?

4
Technical forum / Transfer actor inventory
« on: March 31, 2007, 01:33:38 PM »
Unless you're using a global inventory, rather than a per-actor inventory, you may also need to transfer the old actor's items to the new one. The following is a function I wrote to handle the item transfer. It assumes that the global actor variable is called 'g_actor'. If you kept the same naming as in the demo game, you should rename it to 'actor'.

I placed the function in base.inc to have it available in all game scripts, but how you organise your scripts is obviously up to you:

Code: [Select]
function TransferActor(actorResourceName)
{
    var actorSource = g_actor;
    var actorDestination = Game.LoadActor(actorResourceName);

    Game.Msg("Actor '" + actorSource.Name + "' transfered to '" + actorDestination.Name + "'.");
    Game.InventoryObject = actorSource;
    for (var nIndex = 0; nIndex < Game.TotalNumItems; nIndex = nIndex + 1)
    {
        var item = Game.QueryItem(nIndex);
        if (item != null)
        {
            if (actorSource.HasItem(item.Name))
            {
                actorDestination.TakeItem(item.Name);
                Game.Msg("Item '" + item.Name + "' transfered.");
            }
        }
    }

    Game.InventoryObject = actorDestination;
    Game.MainObject = actorDestination;
    g_actor = actorDestination;

    Game.UnloadObject(actorSource);

    return null;
}

Note: The Game.Msg(..) calls are there for debugging purposes and you can remove them if you want.

5
Technical forum / Re: entities and variables
« on: March 28, 2007, 11:21:50 AM »
I stand to be corrected, but I think you should be able to do such a comparison because the object variables are really references, so you could have two or more variables pointing to the same object, and you can compare any two (or use the 'this' reference) to compare whether they are the same object instance.

6
Technical forum / Re: elevator
« on: March 23, 2007, 05:24:30 PM »
If you simply want the actor to stand still in the elevator while it moves up or down, you can simply have the actor walk to the elevator, disable interactivity, turn off the actor, and activate a sprite for the actor moving in synch with the elevator. At the end of the animation (guided by a script), remove the static actor sprite, activate the actor again and set it's position using SkipTo().

If you want the actor to move around in the moving elevator I think you will need to retain the actor but have it's Y position changed in line with the elevator. You will also need to have a moving region to define the walkable area in the moving elevator. I'm not quite sure if it would work, but hopefully it's a start!

7
Done / Bitmap Font using PNG with alpha channel
« on: March 14, 2007, 11:57:48 PM »
Hi,

I've been trying to use a PNG image of a nice multi-coloured, smoothly outlined font using an anti-aliasing alpha channel to create a Bitmap Font. Unfortunately, WME appears to treat alpha values as either fully opaque or fully transparent. On a light background, the problem isn't noticible, but on a dark area of the screen, the semi-transparent outline pixels appear as gray dots. Is this a current limitation or is there as property I need to change? The only related setting I have found so far is using an ALPHA property for colour-key transparency.

Cheers

8
Technical forum / Re: Script error with the tutorial game
« on: February 19, 2007, 04:30:30 PM »
..and don't forget to set the walk-to coordinates for the door region in the scene manager.

9
Technical forum / Re: Inventory Item not Visible
« on: February 14, 2007, 10:05:31 PM »
For starters, as Mnemonic said, make sure that the item cell dimensions are less than those of the area dimensions.

For example, in inventory.def you have a section:
Code: [Select]
INVENTORY_BOX
{
  ITEM_WIDTH = 65
  ITEM_HEIGHT = 65
  SPACING = 10
  SCROLL_BY = 1
  HIDE_SELECTED = TRUE

  AREA { 30, 12, 770, 77 }
  EXCLUSIVE = FALSE
:
:
}

In thr above example, the CELL (item) width and height are both 65 pixels.

The AREA is the part of the inventory window that contains the items and in the above example it's width is 740 (770 - 30) and 65 (77 - 12). The WME engine will fit as many items in this area that fit, and spaced 10 pixels apart (because SPACING = 10). In fact, 10 items will fit (65 x 10 = 650) plus the 9 spaces in between (10 x 9 = 90) making an exact total of 740.

If you increase the are height to fit another 65 + 10 pixels (by changing 77 to 77 + 75 = 152), you can get an inventory of 10 items across by 2 items down.

You always need to be careful with the calculations as even specifying one pixel less can cause you to loose a whole column or whole row of items. In my case I ended up with an inventory of 10 x 0 items hence no items visible at all!

Hope that helps!

P.S. If you start dabbling with the ui_element images to change the window interface, you will notice a similar behaviour when the window size is not an exact multiple of the window image sizes.

10
Technical forum / Re: Inventory Item not Visible
« on: February 12, 2007, 11:21:07 PM »
I found the problem! :)

The AREA section needed to be one pixel wider and taller. I was assuming that for an area of size W x H set at X, Y, the co-ordinates are (X,Y) - (X + W -1, Y + H - 1). The correct coords are (X,Y) - (X + W, Y + H).

Thanks for pointing me in the right direction!

11
Technical forum / Re: Inventory Item not Visible
« on: February 12, 2007, 10:47:10 PM »
Ok I will try.

I don't know if this is of any relevance but I noticed that the Item definition in items.items uses an IMAGE property while the examples in the help file use SPRITE and SPRITE_HOVER. Are these equivalent? I tried using both of course.

Thanks

12
Technical forum / Re: Inventory Item not Visible
« on: February 12, 2007, 09:40:02 PM »
I tried reverting to the old bmp images but I still experience the same problem.

I also added a second object and the inventory appears consistent. For example, after I pick the two objects I can click the left and right buttons on the inventory twice in a row, consistent with the fact that the inventory contains two (invisible!) items. I'm also unable to do any action on the items once in the inventory, presumably because there is no mouse cursor - item overlap.

Is there anything I can check at my end? I tried inspecting the global actor variable (g_actor) for an 'Items' property or something similar but I didn't find anything.

Also, I don't know if this is relevant, but I reorganised the directory structure. As far as I am aware, all the references point to the right paths and everything else appears to be working. Could this be the source of the problem?

13
Technical forum / Inventory Item not Visible
« on: February 12, 2007, 01:53:46 AM »
Hi,

I'm experiencing a very strange problem with the inventory. I am planning to use multiple inventories attached to multiple characters. When I get a character to pick an item and place it in the (empty) inventory, it is automatically removed from the scene, however the item is not visible in the inventory. The weird thing is that the right scrolling button within the inventory becomes enabled and if I click it, the left scrolling button is enabled while the right is disabled again. So it is as if the inventory contains the item but for some reason it is not displayed, and nor am I able to pick up the item from it.

Here is what I've done:

Code in game.script:
Code: [Select]
// load our main actor
g_actor = Game.LoadActor("actors\Player\Player.actor");
Game.MainObject = g_actor;

// attach inventory to actor
Game.InventoryObject = g_actor;

The scene item is a sprite region called 'book' with an associated scene/scr script:
Code: [Select]
#include "scripts\base.inc"

on "LookAt"
{
  g_actor.GoToObject(this);
  g_actor.Talk("Hmmm.. it's the WME manual.");
}

on "Take"
{
Game.Interactive = false;
g_actor.GoToObject(this);
g_actor.Talk("I'll take it.");
g_actor.TakeItem("book");
Game.Interactive = true;
}

on "Talk"
{
  g_actor.Talk("Shouldn't I read it instead?");
}

on "LeftClick"
{
  g_actor.GoToObject(this);
}

The 'book' item itself is defined by some images, a script and an entry in item.items:

book item script:
Code: [Select]
#include "scripts\base.inc"

on "LookAt"
{
  g_actor.Talk("Guess I should read through this...");
}

on "Take"
{
}

item.items entry:
Code: [Select]
ITEM
{
   CURSOR_COMBINED = TRUE
   CAPTION = "WME User's Guide"
   NAME = "book"
   IMAGE = "items\book.png"
   CURSOR = "items\book.png"
   CURSOR_HOVER = "items\book_h.png"
   SCRIPT = "items\book.script"
}

I'm really stumped on this problem, as no error is being issued, so I have no idea why the inventory is refusing to display the item.
Hope you can help,
Regards,
Sharkbait

Pages: [1]

Page created in 0.042 seconds with 20 queries.