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


Author Topic: Checking if there are no items in inventory  (Read 12245 times)

0 Members and 1 Guest are viewing this topic.

mowren

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 4
    • View Profile
Checking if there are no items in inventory
« on: July 30, 2008, 08:37:27 AM »

Is there a way to check if Game.NumItems oder Game.TotalNumItems is 0/null or undefined or if the inventory is empty?
The situation is that my character doesn't have any items in his inventory and so the inventory shouldn't be available until he takes his first item (and later it I intend to make it unavailable again if all items are used or droped).

Everytime I try something like this and the condition becomes true (in other words, if there are no items in the inventory), Wintermute closes with a crash log which talks about EXCEPTION_ACCESS_VIOLATION.

Code: [Select]
var z = Game.NumItems;
if(z == 0)
{
//Do Something
}
Logged

Prote1n

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 45
    • View Profile
Re: Checking if there are no items in inventory
« Reply #1 on: December 02, 2009, 02:28:28 PM »

I got the same problem. I want display a message when the inventory is empty. But simply calling Game.NumItems crashes the game when its null/0
Logged

Kinjal

  • WME Kinjal Edition Developer
  • Occasional poster
  • **
  • Karma: 1
  • Offline Offline
  • Gender: Male
  • Posts: 53
    • View Profile
Re: Checking if there are no items in inventory
« Reply #2 on: December 11, 2009, 10:26:30 AM »

Fixed. Will be released with "wme 1.9.0.1 (Kinjal Edition v1.2)".
Logged
 

Page created in 0.023 seconds with 24 queries.