Page 1 of 1

actions requiring an empty inventory

Posted: Mon Sep 27, 2010 11:49 am
by Grandad
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?

Posted: Mon Sep 27, 2010 4:15 pm
by delta
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. :)

Posted: Tue Sep 28, 2010 8:38 am
by Grandad
Oh how obvious!!!!! Thanks Jamie