WatchNon-threaded

Forums » Advanced Editor Forum » Read Message

Talk about it. Ask for help on it. Compliment it.

Tying a variable to an item

28 days ago

Let's say I have a story where a guy has to move boxes across a bridge. The boxes have different weights (3 pounds, 5 pounds, etc.)  but the guy can only carry ten pounds of weight.

Is there a way to tie the variables to the box items (I would make them items that you collect on the page) so that if someone tried to carry more than allowed, they couldn't? 

Thanks 

Tying a variable to an item

28 days ago
October's article here goes into the use of the hardcoded $ITEMSTATE variable although the rest of it isn't particularly relevant to what you're trying to do.

My advice, honestly is just to do away with the actual items and just use link restrictions to drop/pick up 'items' tracked within the story itself. But it is possible to use $ITEMSTATE to check if the player is holding a particular box and add to a %WEIGHT variable based on that. There'd have to be an intermediate page between picking them up and actually trying to cross the river so that the variable changes could kick in. After that the link to the river could check that they don't exceed the maximum weight redirect them to a try again or failure page. Anyhow, you may want to wait a bit, I'm sure someone else will show up with a simpler and more elegant solution because that's always what happens.

Tying a variable to an item

28 days ago

Okay, thanks. I picked through all the articles trying to find something useful, but I understand this is quite the oddly specific setup.

E:I need to slow down while typing.

Tying a variable to an item

28 days ago
I mean... you can do a bunch of logic for those kinds of checks sure, but you're better off just ignoring the items altogether for something like that. Items were never designed to be picked up intelligently.