WatchNon-threaded

Forums » Advanced Editor Forum » Read Thread

Talk about it. Ask for help on it. Compliment it.

Add/Removing Items through script. (Not Clear)

9 months 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)

9 months 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)

9 months ago

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

Add/Removing Items through script. (Not Clear)

9 months 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)

9 months 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)

9 months 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)

9 months 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)

9 months 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)

9 months 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)

9 months 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)

9 months 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)

9 months ago
The icon next to the page title when you're editing the page.

Add/Removing Items through script. (Not Clear)

9 months ago

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