Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Help with item states

11 years ago

Why doesn't this work?

IF $ITEMUSED1 = 0 THEN
$ITEMSTATE1 := 1

It is accepted by the editor, but when I test it the page itself returns an error. 

Help with item states

11 years ago

Does it look like this?

Help with item states

11 years ago

Did you remember to put BEGIN and END?

Help with item states

11 years ago

Nice catch.

Help with item states

11 years ago

What are you trying to do with this code?

If $ITEMUSED1 = 0 (So if an Item has not been used?)
$ITEMSTATE1 := 1 (Make Item 1 appear in the Inventory?)

 

Help with item states

11 years ago

My experience with this is that you have to FIRST pick up the item before you can do it like that. If you don't, this error page shows up. In the case of my Pill Shop, I'd set it up so that AFTER you buy the pill, (pick the item up) whenever you used up the pill you bought, you can always go back to the store to buy it again, as many times as you want.

I just put this code in the previous button of the item page:

$ITEMSTATE1 := 1

$ITEMUSED1 := 0

BUT this ONLY works after you pick up the item, not before. It's just an unsolved bug I guess. *Shrugs. 

Help with item states

11 years ago

Are you doing it on a page script or link script?

Because it doesn't work in a link script.

Help with item states

11 years ago

It does if the item was already picked up, and used up. 

Help with item states

11 years ago

Thanks everyone, I should be able to figure it out now.