Its really late so please excuse my abruptness: this script has worked before but now it doesn't. It runs on a container so I never needed to explicitly set its reference in the script. Anyone got any ideas why? Nothing is printed and the game CTD's instantly.
;Test script for interacting with triggers. Controls the removal and;of sub-components and triggering of the actual trapbegin iio_sc_trigTest01short doOnceshort error ;0 if the thing can be made, 1 if it can'tshort numGearsshort numBowlsshort numCorrect ;number of materials that are there in their correct quantitiesshort buildGo ;if its one it means we can build itshort resetAllshort scanCompleteshort scanTestSpdrshort activatedGoshort menuGoshort checkInventoryfloat myXfloat myYfloat myZfloat workVar1float workVar2float workVar3float timeDelayfloat delayForCTDfloat killTimerlong invitem ; name of the item (i.e. gold_001, ingred_ruby_01, etc.)long invcount ; amount of the item (i.e. 327 gold_001, etc.)long invref ; pointer to next item (unused in this script)long pcreflong prospectidlong tempif ( doOnce == 0 ) set doOnce to 1 set numGears to 2 set numBowls to 1 set numCorrect to 2 set timeDelay to 1 set delayForCTD to 0 set killTimer to 0 Messagebox"Finished init..."endifset checkInventory to 1ifx ( checkInventory ) Messagebox"Checking inventory..." set checkInventory to 0 setx invitem,invcount,invref to xInventory ; get first item Messagebox"HERE 1" whilex ( invcount ) Messagebox"HERE 2 " setx invitem,invcount,invref to xInventory ; get another item Messagebox"HERE 3 " endwhile Messagebox"Scan is complete." endifend iio_sc_trigTest01