Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Show inventory when something is picked up?  (Read 3713 times)

0 Members and 1 Guest are viewing this topic.

Maun

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 8
    • View Profile
Show inventory when something is picked up?
« on: August 13, 2004, 11:27:03 PM »

I use the same inv. as the WME demo. To make things more clear for the player(s) I want to show the inventory for 1 or 2 seconds when something is being added ot it. But doing Game.ShowInventory=true; and then back to false a second or two later doesn't work. I think game_deamon is making it not work?? Do you know a way to do this? Thanks  ::rock
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Show inventory when something is picked up?
« Reply #1 on: August 14, 2004, 08:29:36 AM »

Yes, it's caused by game_deamon, which hides the inventory depending on mouse pointer position.

Probably the most ellegant way how to overcome is:

1) Add the following piece of code to game.script. We override the standard TakeItem method and set a global variable "InventoryHint" to true for one second:

[code]
method TakeItem(var ItemName)
{      
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Maun

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 8
    • View Profile
Re: Show inventory when something is picked up?
« Reply #2 on: August 15, 2004, 10:17:12 PM »

Thanks, it works  ::rock

However the inventory now shows up for like a 1 second at the start up of the game. (Not a big deal but it's not very pretty.)

I tried adding
Game.InventoryVisible = false;

or

global InventoryHint = false;

right at the very beginning of game.script before evertyhing else is initiatlised, but that doesn't take it away

Any ideas?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Show inventory when something is picked up?
« Reply #3 on: August 16, 2004, 07:06:28 AM »

Perhaps you are adding some item(s) to the inventory at startup of the game? You could add another global variable to specify if the inventory hint is enabled or disabled and only enable it after you're done initializing the game.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.042 seconds with 20 queries.