Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Add/Removing Items through script. (Not Clear)

2 years ago

Hi...me again. Only issue I am now having is manipulating the inventory using link scripts. 

$ITEMSTATE1 := 1 just leads to an error page. 

I've played games where clicking a link adds an item but despite looking at the help and info section it just doesn't make it clear.

It says $ITEMSTATE can't be changed on link scripts but then where can it be changed?

Somebody save me!

Add/Removing Items through script. (Not Clear)

2 years ago
Try setting it with $ITEMSTATE01.

I vaguely, vaguely recall this being an issue with somebody before. If not you'll have to wait for somebody more knowledgeable to arrive, I don't really mess with items.

Add/Removing Items through script. (Not Clear)

2 years ago

Nah, didn't solve it. Thanks for the suggestion though. I appreciate it. I am baffled.

Add/Removing Items through script. (Not Clear)

2 years ago
Yes, you do have to use two digits, such as zero one, instead of just one. Edit: unless you want to use one, then you can use one, apparently.

Add/Removing Items through script. (Not Clear)

2 years ago

Can we have someone edit that you have to use two digits into the article on using item scripts?  I've been working around this problem by only using item commands on page scripts (which seem to allow the single digit for whatever reason), but it would be nice if we could add that to the article to clear up confusion people might have in the future.

Add/Removing Items through script. (Not Clear)

2 years ago
Wait, for it works without the leading zero on page scripts? If that works, then it doesn't need to be cleared up because it works. I wonder when you need the leading zero.

Add/Removing Items through script. (Not Clear)

2 years ago
Huh. Ok I just tested and both work: the single digit and with the leading zero. That's weird.

Add/Removing Items through script. (Not Clear)

2 years ago
Oh, and also, you can change itemstate on other scripts. In other words, you could put it in a page script.

Add/Removing Items through script. (Not Clear)

2 years ago
Oh, back to your original question: If you typed the code for ITEMSTATE and managed to save that script, the script isn't driving you to the error page, something else you did is doing that. If you get ITEMSTATE wrong, you will get the error when you try and save the script. So I'd suggest looking somewhere else in that section of code.

Add/Removing Items through script. (Not Clear)

2 years ago
Like Orge says, you need to change it on the page script, not link script. It LOOKS like its the link doing it, but you're really being given the item once you arrive on a page.

Add/Removing Items through script. (Not Clear)

2 years ago

There is only the one line of code on the link which is now $ITEMSTATE01

and I only have one item created. How do I access the page script or do I literally put the script on the page?

Add/Removing Items through script. (Not Clear)

2 years ago
The icon next to the page title when you're editing the page.

Add/Removing Items through script. (Not Clear)

2 years ago

That's great! Thanks to everyone that's replied to this thread. I've struggled with this for a couple of days now.