Please login or register.

Login with username, password and session length
Advanced search  


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

Pages: [1]
Technical forum / Re: Placing items in a scene
« on: September 24, 2012, 02:19:57 PM »
Hi metamorphium,

Yes, I was aware of this, but thanks for the post.

The problem is that the source of the dried leaves item is not an entity, it's actually part of the background. The dried leaves item comes from a pile of dried leaves which is perpetual within the scene. The puzzle involves setting the dried leaves alight which then burn out if the player does not place another item on top of the fire. If the fire burns out, more dried leaves need to be picked up from the "infinite" pile of leaves to set fire to again.

I hope this provides a bit more context.


Technical forum / Re: Placing items in a scene
« on: September 22, 2012, 11:28:30 AM »
How frustrating.

This is how I was originally going to do it, but I totally didn't realise there was an "active" check box next to the entity in the Scene editor!

What a numpty. That's a much easier way of doing it.

Thanks lof!


Technical forum / Placing items in a scene
« on: September 22, 2012, 10:41:11 AM »
Hello all,

I'm having issues with placing an inventory item in a scene. To give you some context, I have an inventory item (Some Dried Leaves) that need to be placed on a campfire (a regional entity in my scene). I'm using an entity file to do this currently, and the issues are:

Issue 1 - The entity originally did not appear when I set its active property to true (in the script below). I assumed this was because it was being "made active" behind the background layer, as the rest of the code worked. I'm not sure what I did, but now the entity appears, but now overlays all other entities including the actor. I only have 1 layer in my scene. I had originally tried the below code as a global variable in the game.script, but the entity would not appear at all, so I moved its declaration to the regional entity script (campfire.script). I can only assume this is what fixed it not appearing at all.

Issue 2 - The entity appears when the campfire code is executed, but it can then be seen in all other scenes in my game. I only want it to appear in one. How can this be done?

Please see a code snippit below to help:

In my campfire.script:

Code: WME Script
  1. //declare what DriedLeavesEntity is
  2. var DriedLeavesEntity = Game.LoadEntity("entities\driedleaves\driedleaves.entity");
  3. //make it inactive until we need it
  4. DriedLeavesEntity.Active = false;
  6. //when dried leaves are used on the campfire
  7. on "leaves"
  8. {
  9.   //go to the campfire
  10.   actor.GoToObject(this);
  11.   //unselect the leaves item as we are using them
  12.   Game.SelectedItem = null;
  13.   //drop the item. We do not want to delete as the fire will only burn for a certain amount of time.
  14.   //If the player has not applied the chimney before the fire burns out, we need to be able to pick up the leaves again.
  15.   //whether the leaves can be picked up again are controlled by a separate global variable.
  16.   Game.DropItem("leaves");
  17.   //show the leaves on the campfire
  18.   DriedLeavesEntity.Active = true;
  19.   actor.Talk("It's the beginnings of a fire");
  20.   actor.Talk("I feel just like Bear Grylls");
  21. }

and here's the driedleaves.entity definition:
Code: [Select]
  CAPTION="Dried Leaves"
  FONT = "fonts\outline_red.font"

After the above, I want to place a chimney over the leaves once they have been set on fire. I assume the answers to the above will allow me to do this also.

I could be going about this the completely wrong way and there may be a better way of doing this. Any help would be greatly received.


Technical forum / Re: Stop inventory item from being selected
« on: September 21, 2012, 05:30:13 PM »
Thanks to lof for providing an immediate workaround, but I think Mnemonic's solution is a bit smoother.

Either way, thanks for the help guys.


Technical forum / Re: Stop inventory item from being selected
« on: September 21, 2012, 04:25:18 PM »
Thank you for the reply. That works great.

I wondered if there was another way of implementing this? The reason I ask is that if you had multiple object that you didn't want to be selected, this section of the code could get quite cumbersome. Is there a way of defining a list of items?


Technical forum / Stop inventory item from being selected
« on: September 21, 2012, 11:41:25 AM »
I have yet another inventory question (sorry). I have tried searching the forum, but it's quite hard to search for.

I basically just want to make an item in the inventory "unselectable". I have an item you can pick up and read (a note), but I don't want the player to be able to select it is an item to be used with other objects.

Any help on how to do this would be great.


Technical forum / Re: Inventory "boxes" in window
« on: September 19, 2012, 03:39:28 PM »
Just in case anyone looks at this and wonders how it was solved, I found what I needed in the below documentation:

I'll make sure I look harder next time :)


Technical forum / Inventory "boxes" in window
« on: September 18, 2012, 01:42:36 PM »
Hello again, I have a new issue whilst working on the inventory in my game.

I have an inventory icon (window), which when clicked, displays another window which will be the inventory. This process works when I have a normal window as the inventory (although no items appear on it as the inventory item areas are not defined).

This issue I am having is that I don't understand how to code where the item should appear in the inventory window.

In the example project, there is an "inventory.def" file which is essentially a window with extra boxes to determine where the items go.

I found this post:

but I'm still not sure on this.

I have placed this code in my game.script and referenced it to be visible when you click on the icon:
Code: WME Script
  1. global WinInventoryOpen = Game.GetInventoryWindow("interface\inventory.def");

The above does not seem to work and nor does this as the file is not a window:
Code: WME Script
  1. global WinInventoryOpen = Game.LoadWindow("interface\inventory.def");

And I'm not sure how else you get the inventory boxes in a normal .window or how to reference the .def file in the game.script.

I hope the above makes sense!

Could anyone help me one this?


Technical forum / Re: Inventory window hidden
« on: September 16, 2012, 05:53:53 PM »
Amazing! Works a treat. Thank you very much for the assistance. I'm sure I'll have loads more questions ;D

Technical forum / Re: Inventory window hidden
« on: September 16, 2012, 10:55:03 AM »
Oh and just to add, I do not appear to be getting any errors in the log or debug mode.


Technical forum / Inventory window hidden
« on: September 16, 2012, 10:52:48 AM »
I'm new to this forum so I'll start by saying hello to everyone. Hello!  :)

I've been using Wintermute (which is an awesome bit of kit) for a few months now, and I think I understand the basics.

Now things are getting a bit more advanced, I'm having a bit of trouble with utilising windows to create an inventory that opens when the player clicks on an inventory icon in the top left hand corner of the screen (a bag).

The icon displays great. It's hidden when I don't need it and it doesn't break the game. What I'm trying to do now is when the player left clicks the icon, a window appears displaying the "inventory" (although I haven't coded this bit yet).

The code I have implemented thus far is as follows:


Code: WME Script
  1. //load the inventory window
  2. var WinInventoryOpen = Game.LoadWindow("interface\inventory\inventory.window");
  3. //load the inventory bag icon
  4. var WinInventoryIcon = Game.LoadWindow("interface\inventory\inventoryicon.window");
  6. //Hide the inventory window
  7. WinInventoryOpen.Visible = false;
  8. WinInventoryOpen.Active = false;
  10. //hide the inventory icon
  11. WinInventoryIcon.Visible = false;
  12. WinInventoryIcon.Active = false;

scene_init.script (for a scene in which I don't want the inventory icon OR window to display:
Code: WME Script
  1. //load the inventory window
  2. var WinInventoryOpen = Game.LoadWindow("interface\inventory\inventory.window");
  4. //Hide the inventory window
  5. WinInventoryOpen.Visible = false;
  6. WinInventoryOpen.Active = false;
  8. //load the inventory icon
  9. var WinInventoryIcon = Game.LoadWindow("interface\inventory\inventoryicon.window");
  11. //Hide the inventory icon
  12. WinInventoryIcon.Visible = false;
  13. WinInventoryIcon.Active = false;

scene_init.script where I want the icon to display, but not the window
Code: WME Script
  1. //get the inventory icon
  2. var WinInventoryIcon = Game.LoadWindow("interface\inventory\inventoryicon.window");
  3. //and display it
  4. WinInventoryIcon.Active = true;
  6. //load the inventory window
  7. var WinInventoryOpen = Game.LoadWindow("interface\inventory\inventory.window");
  8. //but make it disappear until needed
  9. WinInventoryOpen.Visible = false;
  10. WinInventoryOpen.Active = false;

and finally, the script for when you click the icon, when the inventory window should display:
Code: WME Script
  1. var WinInventoryOpen = Game.LoadWindow("interface\inventory\inventory.window");
  3. ////////////////////////////////////////////////////////////////////////////////
  4. on "LeftClick"
  5. {
  6.   WinInventoryOpen.Active = true;
  7.   WinInventoryOpen.Visible = true;
  8. }

The behaviour at the moment is that the inventory icon displays and hides when I want it to, but the inventory window is always there.

What have I done wrong here?

Thanks for your responses in advance.


Pages: [1]

Page created in 0.039 seconds with 21 queries.