[Vx Ace] Need a Variable Shop

Soul Tech

Time Traveler
Veteran
Joined
Mar 20, 2015
Messages
68
Reaction score
186
First Language
Spanish
Primarily Uses
RMVXA
I need help, I would like to know if there is a way to buy variables, ie a store of variables ...
I do not mean the currency of the game, nor the prices.
In case I was not clear, I refer to a store where you buy an item and when you buy it gives +1 to a specific variable, the item does not remain in the inventory, as if it were consumed instantaneously.
If there is a script (that I have not found) or by means of items in the database, please someone tell me.

Thanks in advance!:kaoslp:
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
574
Reaction score
217
First Language
English
Primarily Uses
RMVXA
You could event this instead.

Create a variable item, it doesn't have to do anything.
Create a common event; parallel processing.
Have this event check the player's inventory for the item in question.
Remove the item, increase the variable count by 1.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,157
Reaction score
12,431
First Language
English
Primarily Uses
RMMV
A parallel event will run that check 60 times a second. How many times a second are you expecting them to open the shop screen and buy these items? Probably 0 times a second for the majority of the game.

Thankfully, if they can only get them through the shop screen, and you have to enter the command to open the shop screen, then you know exactly when they have the opportunity to buy them. So you can just put the commands into the same event and not worry about a common event or parallel processes at all (though a common event would be appropriate if you were going to let them buy from several shops - then you could just do a Call Common Event command from the shop event).

Also, if there's a chance they might buy more than one at a time, alter the above logic to use Control Variables to see how many of the item are in inventory, then use that variable in both the remove items and increase variable commands.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Who shares/sells their scripts/plugins on itch.io? Can I pick your brain?
If you ever need fantasy names and you're bored, make a fictional alphabet. Switch around the letters and see what you get :p
I JUST GOT PROMOTED TO 9TH GRADE BOIS!
On a scale of one to I just drew a pineapple with hairy legs how bored are you today?
Everybody else: We want this, this, this, this, this, and this, and don't forget that, plus that.... we need all of it added to the new RM.

Me: Just don't make me learn a new programming language. :kaoback:

Forum statistics

Threads
98,167
Messages
949,892
Members
129,453
Latest member
tanzx
Top