Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Respawning Items

3 days ago

I have a very rudimentary understanding of items/variables so please excuse me if this is a dumb question. I understand that items can be discovered on specific pages, but is there a way of ensuring that the item only appears *once* when you arrive on that page, so the next time a link is clicked again taking you to said page, the item doesn't appear?

Respawning Items

3 days ago
Sort of. The item appears once. If the reader pick it up, it will be in their inventory. So, it shouldn't appear again. However, if they drop it, it defaults back to the page where it started. You CAN override that using scripts by setting the starting location of the item to somewhere that the reader cannot get to, if you want.

Respawning Items

3 days ago

I am unfamiliar with scripting but am willing to learn if it stops this issue. Are you telling me there's a way to change where the item spawns after the player drops an item? That would be fantastic because it'd be easy to make a 'dump' page which the player could never reach.

Respawning Items

3 days ago

This page has a link to all the articles on scripting and item use: Help & Info

I think the easiest way to fix your problem is to change the way the item is added to the player's inventory--instead of setting the item spawn page, use a link (or page) script to use the $ITEMSTATE variable to add it directly to their inventory. (This article explains it, but you should read intermediate articles on scripting and items first.)

Instead, you could also change $ITEMSTATE to 2 so that the item won't reappear in its original location when dropped. I'm not sure if there's a way to get the "drop" link to do this, but you can definitely do so for the item script itself. (This will also require you to read several other articles.)

You can also avoid the issue entirely by creating 2 copies of the page: one for the player's first visit (where they pick up the item) and one for future visits where the item won't appear.

Respawning Items

2 days ago
If you start the item on the dump page, when they drop the item, it will appear on that page.

However, that also means it will not appear on any other page. You would have to write some code on the page where you want the item to appear to check if the reader has the item. If they do not, you'd have to check to see if the user has ever had the item (with a variable). Then you could add a link to let them pick up the item (with more code).

In some ways, it's more trouble than it's worth if you don't know code. Is it really common that the reader picks up an item in one place, then drops it somewhere else, then returns back to the first place?

Respawning Items

2 days ago
Just swapping the pages out like Gryphon suggested seems the easiest thing, if it's needed at all.