[Vx Ace] Need a Variable Shop

Discussion in 'RGSS3 Script Requests' started by Soul Tech, Jan 19, 2018.

  1. Soul Tech

    Soul Tech Time Traveler Veteran

    Messages:
    68
    Likes Received:
    185
    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:
     
    #1
  2. Rinobi

    Rinobi Veteran Veteran

    Messages:
    563
    Likes Received:
    209
    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.
     
    #2
    Soul Tech likes this.
  3. Shaz

    Shaz Veteran Veteran

    Messages:
    36,914
    Likes Received:
    10,851
    Location:
    Australia
    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.
     
    #3
    Soul Tech likes this.
  4. A-Moonless-Night

    A-Moonless-Night WINTER IS COMING Veteran

    Messages:
    470
    Likes Received:
    334
    Location:
    New Zealand
    First Language:
    English
    Primarily Uses:
    RMVXA

Share This Page