RPG Maker VX Ace

RPG Maker VX Ace

View Stats:
Script questions (Vocab module/shop processing)
1. I want to rewrite some lines which appear during the battle. However, lines such as the following puzzle me:

ActorRecovery = "%s recovered %s %s!"

How do I know which of the "%s" is the actor name and which is the parameter etc?

2. Can I make the shop's product range vary as a result of some action by the player? For example, as in Mass Effec 1, when you purchase licenses for selling specific products, the product range of Normandy's vendor expands.
< >
Showing 1-2 of 2 comments
Kio Kurashi Jul 21, 2017 @ 3:41pm 
1. The %s as I'm sure you know are the symbol for replacement strings. They go in order of what is used when they are called. For the particular one you showed I'd suggest using Ctrl+Shift+F to search through all of the scripts for Vocab::ActorRecovery. You should find two assuming that you haven't added any scripts that use that vocab as well. There you will find a bit of code that looks like below:
fmt = @battler.actor? ? Vocab::ActorRecovery : Vocab::EnemyRecovery sprintf(fmt, @battler.name, Vocab::hp, -hp_damage)
To break it down the fmt is looking to see which of the Vocabs to call (Since the method is used for both actors and enemies) which it then passes on to the sprintf call. The sprintf call is the actual part that calls the vocab string, and as you can see it first calls the Vocab line and then passes each of the replacement texts in order after it.

2. Depending on how you want them to obtain these unlocks you can do it in two ways. The first is with events which works well if they can only get the unlocks in order like an upgrade system. Just have conditional branches inside each other that check for the next tier of unlock. In each of the else sections you put the shop command with all of the available merch.

As for the other method it would be to use a script. This one has the benifit of being able to add items based on the upgrade independantly of the others. For example having the Fruit and Meat upgrade, but not the Toys upgrade would be possible so players could pick and choose what items they want their store to sell before they eventually get them all. This also means that if you have upgrades that could potentially be missed you wont have to have your player back track all the way to wherever it is before they can use any of the upgrades after it. I think there might be a script already made for this particular purpose, but I haven't seen it recently.


If you want to make it yourself this take a look at the code below (Warning Dificulty is Increasing)
goods = [[type, id, price_override_flag(, price)]] SceneManager.call(Scene_Shop) SceneManager.scene.prepare(goods, true) # Example Script Call: goods = [[0,1,1,25],[0,2,0]] SceneManager.call(Scene_Shop) SceneManager.scene.prepare(goods, true)
I get that is quite complex so let me break it down some before I tell you how to add things dynamically.
First the type is either 0(Items), 1(Weapon), or 2(Armor).
The ID of the item is simply the item's Number.
Price_override is either 0(No) or 1(Yes) and indicates if you want to change the item's price
And then the Fourth part is for the adjusted price which should be left off if you aren't adjusting the price.
Thus a Potion selling for an adjusted price of just 25G is [0,1,1,25]
One last thing, If you want your player to be able to sell things to the shop thenchange that "true" to "false" as that is the "Purchance Only" flag that you would normally check or uncheck in the shop command.

Alright to add an item dynamically based on a collected upgrade (I'll use a switch that can be turned on for my example, but you can use a key item or something else by changing the condition needed)

Adding Full Potion Dynamically
goods = [[0,1,1,25],[0,2,0]] if $game_switches[1] == true; goods.push([0,3,0]); end SceneManager.call(Scene_Shop) SceneManager.scene.prepare(goods, true)
Last edited by Kio Kurashi; Jul 21, 2017 @ 3:42pm
crystalsilence0451 Jul 22, 2017 @ 12:53am 
Thank you so much for such a detailed comment!
< >
Showing 1-2 of 2 comments
Per page: 1530 50

Date Posted: Jul 21, 2017 @ 5:58am
Posts: 2