Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Drop items without using $ITEMSTATE?

6 years ago

I created some items and made them available on a certain page. You then get to click on icons to add them to your inventory, which I think is pretty cool. However, reading the tutorials, it appears that if you want the items to be automatically dropped when the user clicks on a page link, you have to use $ITEMSTATE := 1 to add the item and then $ITEMSTATE := 0 to drop it, meaning that while there IS a way to have items automatically dropped, you have to sacrifice the mechanic of clicking on a picture of the item to get them, and instead rely on page links to add them.

Is there a way that I can add the items by the player clicking on the item picture, but then have the items all dropped later by the player clicking on a page link? Or do I have to just deal with not being able to click on the item pictures to add them to the inventory?

Drop items without using $ITEMSTATE?

6 years ago

I thought of one clunky solution, but I'm hoping for something more efficient. Would this work, though?

Suppose I have a sword I want to add. Have an item (with the picture of the sword) called "Check condition of sword," with instructions to click on the item to add it. When the player clicks on that item, it takes them to an identical looking page, except I add the script $ITEMSTATE1 := 1, and when they go to that page the sword is in their inventory. I could add a limit of uses to the "Check condition of sword" item to 1, and then I assume it disappears. From then on you should have the normal sword in the inventory, except it is tied to $ITEMSTATE, which means I can script $ITEMSTATE := 0 later to get rid of it.

Could that work? Also, is there a better way?

Drop items without using $ITEMSTATE?

6 years ago
I was pleasantly surprised to see that this works, but it is pretty damned clunky.

Drop items without using $ITEMSTATE?

6 years ago
"you have to sacrifice the mechanic of clicking on a picture of the item to get them"

You shouldn't have to. ITEMSTATE is just another way of manipulating an item.

Drop items without using $ITEMSTATE?

6 years ago
Half the time I'm left wondering why people even use items. I've seen very few games with inventories that couldn't have been replaced with variables.

Drop items without using $ITEMSTATE?

6 years ago
Yes, this is how you turn on and off Items with Links (when the ItemState bug is still in effect).

Set an Item to be Usable 3 times.
Set $ITEMSTATEXX := 1
Set $ITEMUSEDXX := 3 to hide the Item
Set $ITEMUSEDXX := 1 to unhide the Item

Set a Global Script
IF $ITEMUSEDXX < 3 THEN $ITEMUSEDXX := 1

If you go with this method, then you will have to track uses with something other than $ITEMUSEDXX

Drop items without using $ITEMSTATE?

6 years ago
As mentioned, having users click on an item is just one way to manipulate them. You can auto-add them or auto-remove them with scripts in general, and in link scripts. Honestly, I prefer adding them in scripts automatically because I don't like to have to read a page, then click on an item to add it, only to have the same page re-load itself. But that's just me.

Drop items without using $ITEMSTATE?

6 years ago

If that's the case I may scrap the idea altogether. I thought the click to add was pretty cool, but I suppose if people are tired of that, they'll be quite annoyed at what I have now, where you click a treasure chest, then use it, to get your item.