Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


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.

Topics - Squinage

Pages: [1]
1
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;
  5.  
  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. }
  22.  

and here's the driedleaves.entity definition:
Code: [Select]
ENTITY
{
  NAME="driedleaves"
  CAPTION="Dried Leaves"
  ACTIVE=TRUE
  X=667
  Y=385
  SCALABLE=FALSE
  INTERACTIVE=TRUE
  COLORABLE=FALSE
  SPRITE="entities\driedleaves\sprites\driedleaves.sprite"
 
  SCRIPT="entities\driedleaves\driedleaves.script"
  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.

Squin

2
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.

Squin

3
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:

http://forum.dead-code.org/index.php?topic=5167.msg29296#msg29296

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?

Squin

4
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:

game.script

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");
  5.  
  6. //Hide the inventory window
  7. WinInventoryOpen.Visible = false;
  8. WinInventoryOpen.Active = false;
  9.  
  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");
  3.  
  4. //Hide the inventory window
  5. WinInventoryOpen.Visible = false;
  6. WinInventoryOpen.Active = false;
  7.  
  8. //load the inventory icon
  9. var WinInventoryIcon = Game.LoadWindow("interface\inventory\inventoryicon.window");
  10.  
  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;
  5.  
  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;
  11.  

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");
  2.  
  3. ////////////////////////////////////////////////////////////////////////////////
  4. on "LeftClick"
  5. {
  6.   WinInventoryOpen.Active = true;
  7.   WinInventoryOpen.Visible = true;
  8. }
  9.  

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.

Squin

Pages: [1]

Page created in 0.06 seconds with 18 queries.