Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Restricting Items with Scripting

9 years ago

I'm making a part of my storygame where the user can choose between multiple items, but can only pick one. All the items are going to be on the same page. 

How do I script the link to restricting the player from the items once they choose one? 

An example of this would be going to a store and seeing a bucket of different color candy. You can only pick one candy from the bucket. I know I can do this with multiple pages, but is there an easier way to do this with just one page and scripting? Thanks!

Restricting Items with Scripting

9 years ago
It may be easier just to give them the options in the links, then using scripting to give them their choice.

Or you could be really creative, use links, hide them, then create picture links for each item (matching up to each link you've hidden). That way they have the impression they're picking up the item, but really they're just clicking a link and you're running a script in the background.

Restricting Items with Scripting

9 years ago
As already mentioned, there are a number of different ways to do this. One of the simplest might be with links. In the link script, you could set a variable, CANDYCOLOR to the value of the color selected (so you can reference it later). Then you can make all the links have a restriction of CANDYCOLOR = 0. Once a reader picks one color, all the other options disappear. You can also use that to actually add an item to the inventory by setting the ITEMSTATE variable at the same time (itemstate code help here).