Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Using link to restore item

11 years ago

I have an item that only can be used one time.

When I click a certain link, I want to restore the item back into my inventory.

I tried putting

$ITEMSTATE2 := 1

on the link script, which translates to set the item, with the item id of 2, back into the inventory.

But it didn't work. Is that a bug, or?

Using link to restore item

11 years ago

It's a bug. You can use that code in the page script, but it won't work in the link script for some reason.

Using link to restore item

11 years ago

Is the page script on the top left, next to the title of the page the link's on?

I also tried that, and it didn't work.

Also, my link is a go to previous page link, just so you know.

 

Using link to restore item

11 years ago

It should work just fine in the page script, so you must be doing something else wrong.

Using link to restore item

11 years ago

Let me say that the item can only be use once, and I already used the item so it's gone.

It worked fine when the item haven't been used yet, but when I used the item, it doesn't go back to the inventory.

Using link to restore item

11 years ago

If that's the case, then set the number of times it's been used back to 0 ($ITEMUSED2 := 0).

Using link to restore item

11 years ago

Thanks! You're a genius!  :D

Now I have another problem.

I have an item call equipment. When I use this item it leads me to a page call equipment. Every time I use an item that you can wear (Such as a sword, or shirt, or pants) they disappear from my inventory, and the on the page call equipment a link will show up that go along the lines of "Unequip Sword" or "Unequip Shirt" or "Unequip Pants". When I click on it, it will lead me to another page title, "Unequip Sword" or "Unequip Shirt" or "Unequip Pants". Underneath those pages, there is a link call "Go back" that will take me about to the page "Equipment".

On the page called "Equipment' there is also another link call "Go Back" that links me to the previous page.

The problem here is when I use these three items, "Sword", "Shirt", "pants" and when the three links "unequip sword" "unequip shirt" "unequip pants" shows up, and when I click on all three links, and back to the page "Equipment" I have to click the link "previous page" at least 5 to 6 times to get back to my actual previous page.

Do you have any solutions for that?

 

Using link to restore item

11 years ago

Sounds like my article could help you out here:

http://chooseyourstory.com/help/articles/article.aspx?ArticleId=142

Basically, you always store what your last page was (in the storygame), except whenever you're in the equipment section (which is what I believe you want).

Using link to restore item

11 years ago

It works! Thanks.

I still don't know how did works though. Couldn't wrap my mind around it.

You're a genius! 

Using link to restore item

11 years ago

I deleted this duplicate Question out of the Bugs Forum.

Here was my answer (which Killa already shared above) - - -

Do you have the Item set for a Specific Number of Uses? If so, when the Item disappears after its last Use, it has not been rendered $ITEMSTATEX := 0 - it is still in fact $ITEMSTATE := 1 (which is why that would not work.

Instead, Reset the Number of Uses by Changing the value of $ITEMUSEDX := 0 (or whatever).

Using link to restore item

11 years ago

Okay. I already fix it.

Do you have an answer for my other question? It's a different question. It's like two post above this one I think.