Advanced Item Manipulation

by BerkaZerka

<< All Articles | Print

You don't have to have Items specifically tied to pages or use $ITEMSTATEXX to pick them up and drop them. This is how you turn on and off Items with Links.

Set all of your Items to be Usable 2 times, but do not assign them a page to be found on or allow them to be dropped.

Set the following in your Global Script for every Item in your game:

IF $ITEMUSEDXX < 3 THEN $ITEMUSEDXX := 1

On your very first page of the story add the following to the Page Script for every Item in your game:

$ITEMSTATEXX := 1
$ITEMUSEDXX := 3

This will load the Items into the Inventory in the order you specify, but then hide them. They are still there, but considered "used up."

Whenever you want a player to find/pick up an Item you just put this in the Link to the page you want it to be gained on:

$ITEMUSEDXX := 1

To drop/lose the Item just use $ITEMUSEDXX := 3 once again.

The nice thing about using this method is that your Inventory will always be organized the way you set it up -- Items will never jumble around as you gain and lose them.

The downside however, is that you will have to track actual item uses with something other than $ITEMUSEDXX.

For example, if you have a potion of healing that can be used 6 times, you will need to set up a Variable to track it separately each time it is used by the player. For Example:

%PO1USED := %PO1USED + 1
IF %PO1USED > 5 THEN
BEGIN
%PO1USED := 0
$ITEMUSEDXX := 3
END

Another issue is that you will have to use Scripting rather than HAVE ITEM to set Conditions (as the player will literally have every Item, but can't see or use them). For example -- The player needs the key to access the vault on page 100:

IF $ITEMUSEDXX < 3 THEN $DEST := @P100

Hope this helps. If it makes no sense to you, then you aren't ready for it -- good luck!