actions requiring an empty inventory

Need help with using DizzyAGE then look here
Post Reply
Grandad
Hard Boiled Egg
Posts: 1489
Joined: Sat Aug 08, 2009 10:47 am
Location: Balham - gateway to the south

actions requiring an empty inventory

Post by Grandad » Mon Sep 27, 2010 11:49 am

When I first downloaded DizzyAge I'm sure I read a comment in one of the books about object items having 'weight', but have never seen it commented on in any of the script files. In my first game I really wanted the teleport in the 'the three trials' to only operate when Daisy's inventory was empty, but could never get it to work, so changed the puzzles.

I've recently been playing around with 'if (idx=-1)' as a way of getting a positive action if the inventory was empty when actioning a dynamic brush. It sort of works in that if the player has any items in their inventory the 'nothing happened' comment is displayed, but if the inventory is empty, the positive action only happens after the empty inventory box is displayed, which defeats the object of the puzzle.

Is there a way to 'check the inventory contents' without using -1, or is there some variable that can check the weight of items?

delta
Hard Boiled Egg
Posts: 3965
Joined: Fri Feb 09, 2007 7:08 pm
Location: North West
Contact:

Post by delta » Mon Sep 27, 2010 4:15 pm

Firstly, there is no 'weight' property or variable. If you want to create one, it would be fairly easy (just use an Object USER variable like I did in IID for the 'value' of the items)

secondly, the function you're looking for is InventoryCount(). so code similar to
if(InventoryCount()==0) should work. :)
Image

Image

"Quotes from the internet may not be genuine" - Abraham Lincoln

Grandad
Hard Boiled Egg
Posts: 1489
Joined: Sat Aug 08, 2009 10:47 am
Location: Balham - gateway to the south

Post by Grandad » Tue Sep 28, 2010 8:38 am

Oh how obvious!!!!! Thanks Jamie

Post Reply