Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

$ITEMSTATE1 := 0 throws an error?

13 years ago

And I don't mean in validation, I mean when I actually play through the storygame, I get a "PostProcessed Already" exception.

The script is in a page script. It's the only thing in the script. I'm picking up the item before I go to the page.

Any help would be appreciated!

-Morgan

$ITEMSTATE1 := 0 throws an error?

13 years ago

Copy and paste the script right here in this thread so we can see it 'as is'. It might help us help you better...

$ITEMSTATE1 := 0 throws an error?

13 years ago

$ITEMSTATE1 := 0

That's the script in its entirety. :P

 

I'm not clear on whether "preview" lets other people play your storygames or not, but if it does:

http://chooseyourstory.com/story/testbed

$ITEMSTATE1 := 0 throws an error?

13 years ago

Yes, preview (when checked) lets folks play through it, but nothing else. I'll check it out...

$ITEMSTATE1 := 0 throws an error?

13 years ago

Thanks! FWIW, this is actually my reproduction of the bug, after it appeared in my actual storygame.

$ITEMSTATE1 := 0 throws an error?

13 years ago

I see what you mean. Your script code is good. I seem to recall reading a post about this error before and a work around. I could be confusing it with something else though. I'll see if I can find it and post it here if I do.

$ITEMSTATE1 := 0 throws an error?

13 years ago

From the help in scripting:

Use $ITEMSTATE just like any other normal variable. But remember, you must include the item's ID at the end of the variable name. For example: $ITEMSTATE4 would mean the Item State for the item with an ID of four. And remember to put the $ in front, instead of %, because after all this is a system variable. Also, you can put this system variable in both page scripts and link scripts, but they cannot be changed in the link scripts (i.e. $ITEMSTATE := 1 will not work in a link script, but IF $ITEMSTATE = 1 THEN will work).

$ITEMSTATE1 := 0 throws an error?

13 years ago

So in other words, use $ITEMSTATE1 = 1  not := 1

$ITEMSTATE1 := 0 throws an error?

13 years ago

Nice Catch!

$ITEMSTATE1 := 0 throws an error?

13 years ago

Thanks, but it's definitely a page script, not a link script. And the colon before the equals means it's an assignment, which is what I want. "$ITEMSTATE = 0" just checks to see if the player has the item -- it doesn't take it away from them.

"$ITEMSTATE := 1" works just fine, BTW. It's only removing items that's a problem. I'm thinking it's a bug. :/

$ITEMSTATE1 := 0 throws an error?

13 years ago

Aha. Apparently this is a known issue:

http://chooseyourstory.com/forums/bugs-and-problems/message/4981

$ITEMSTATE1 := 0 throws an error?

13 years ago

$ITEMSTATE1 := 0 throws an error?

13 years ago

Yeah, that's the one I was looking for...

$ITEMSTATE1 := 0 throws an error?

13 years ago

Here’s My Workaround for Script Dropping Items

If you want an Item that can be Dropped by Script:

1: Create the Item (say a Spoon, hereafter ITEM #1) and Set the Number of Uses to 2 Times

2: In the Global Page Script, add: IF $ITEMUSED1 = 1 THEN $ITEMUSED1 := 0 (this allows the Spoon to be used any number of times)

3: In Any Link (or Page) Script where you want to Script Drop the Spoon from the Inventory, add: $ITEMUSED1 := 2 (this will cause the Spoon to drop out of the Inventory when the Link (or Page) is selected)

Hope this helps until a proper code fix can be implemented =)

$ITEMSTATE1 := 0 throws an error?

13 years ago

Nice! Thanks for sharing your solution!

$ITEMSTATE1 := 0 FIXED!

13 years ago

Thanks to alexp, the $ITEMSTATE BUG has been fixed for use on Page Scripts!!! Huzzah! Thank you alexp!

$ITEMSTATE1 := 0 FIXED!

13 years ago

Fantastic!

(I would tag October and TSMPaul here)

$ITEMSTATE1 := 0 FIXED!

13 years ago

Woot! Thanks AlexP! :D