Need help with script inside of a variable.

Ok, I'm using YanFly's common event shop to be able to smith weapons, armor, etc, but I seem to have encountered a problem...

I'm trying to put this in the variable script:
$game_party.item_number($data_items[153])

However, the window cuts me off at this:
$game_party.item_number($data_items[153

So obviously it's not going work... How do I fix this? A lot of the things I'm using items for are requiring me to have items in the upper slots that would shorten it(1-9) so I can't put them up there. Plus, it wouldn't be enough to have all the materials for smithing things when you consider how many there would be.

So I guess my question is:

How do I get that up there ^ to fit in the variable? If there's a work around that would take longer, I don't mind it. I'll do it.
I've moved this thread to Ace Support (even if it were a script question, it would go into Script Support, not Scripts). Please be sure to post your threads in the correct forum next time. Thank you.


By "in the variable script", do you mean you are using a Control Variables command to put the number of items held into the variable?


You don't need to do that in script. There is an option in Control Variables that lets you do exactly that.
This is what I'm using to set up my shop:
https://ccrgeek.wordpress.com/ways-to-use-scripts-2/how-to-make-a-weaponsmith-shop-using-yanflys-common-event-shop-script/

Variable.jpg

That is what I'm trying to do.

Variable2.jpg

But that's what happens when I try to add $game_party.item_number($data_items[153]) to that 'script' thing, like the guide tells me to do.

It cuts off at $game_party.item_number($data_items[153
1. You have an old version of the engine. The newest version gives you more room.


2. You don't need to use a script for that. Control Variables > Game Data > Item [x] in Inventory.
1. You have an old version of the engine. The newest version gives you more room.

2. You don't need to use a script for that. Control Variables > Game Data > Item [x] in Inventory.
1. Whoa. How do I go about getting the newer version? Do I have to rebuy the newer one since I already own VX Ace? lol

2. Awesome. Thank you very much.

I actually feel kind of dumb now, lol. I was taking the hard way around.
no, you just redownload it. Where did you purchase it from?


Don't feel dumb. The person who wrote the tutorial probably didn't know about it either, so did it the hard way.
no, you just redownload it. Where did you purchase it from?

Don't feel dumb. The person who wrote the tutorial probably didn't know about it either, so did it the hard way.
Steam.

That's actually nice to know, though. I can fix this up much faster now.
I would have thought steam would give you the update automatically?
Yes, steam updates automatically unless disabled in program properties.

The script command box is larger in the newer versions, but that does not apply to the script line of the control variables command, that is still limited.

But as said, the control variables command does not need the script line to read the inventory numbers anyway...
The screenshots provided show the Control Variables command with a script, and the whole line of text fits.


Edit - oh, just realized that's because it's only looking at items where the id is a single digit. They must have JUST made it in.


So the new version won't help you (and you may in fact already have it in that case). Nevertheless, the Game Data is the way to go.
Yes, steam updates automatically unless disabled in program properties.

The script command box is larger in the newer versions, but that does not apply to the script line of the control variables command, that is still limited.

But as said, the control variables command does not need the script line to read the inventory numbers anyway...
Ah, alright. Then I already have the updated version. Good to know.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-script-inside-of-a-variable.52786/