So I'd like to make it so there is an item that gives Growth to Max HP +5, but I'd like to not be able to use it if the character's max HP is over 2000. Is there a way to do this?
[VX Ace] Is there a way to make it so you can't use an item on a character with high Max HP?
RPG Maker VXAce SupportHmmm you can make the item run a common event where you check the max HP of the actor, if its below 2000, change Max HP, else just refund the item.
If it's a consumable item then the damage formula could be used.
Otherwise you may be using common events like Adiktuzmiko said.
If it is armor or weapons, either common events or ask for a script that could maybe use a notetag to add the health if < 2000 HP.
Otherwise you may be using common events like Adiktuzmiko said.
If it is armor or weapons, either common events or ask for a script that could maybe use a notetag to add the health if < 2000 HP.
Is there a way to do If/Else in the damage formula?
Something like :
if a.mhp < 2000... how would you do Growth though? :/
Code:
if a.mhp < 2000; a.param_plus[0]+=value;end
basically, you modify the param_plus array, 0 is the ID of Max HP in the array
Problem might be that you waste the item though without the player realizing. Conveying that it does not work under certain conditions is important (unless you intentionally make it that type of game), so a CE that give a "it won't work" message would be the better solution. It also allows you to refund the item.
For that I use Tsukihime's Scene Interpreter. Create a common event to be called when the item is used, use Stop SE command and immediately call the buzzer sound, then I add 1 of the item back. Works like a charm... only in menu, though.
There's also a Tsukihime's script that stores the last user/target in a variable so the whole process could pretty much be made in a common event if the add item back feature is implemented.
A script that prevents usage if the formula returns 0 would be good though, and also simplier.
You dont even need to use the Scene Interpreter script to make the item run a CE unless of you want it to show inside the menu itself. xD
You can also extend the DF code to return the item
Not sure of the parameters for the gain_item though, iirc its ID,amount.
You can also make it play the buzzer sound if you want.
For CE use, IIRC there is actually a script call in the base Ace code that can be used to get the last actor who used an item in the menu, but i forgot the exact call.
BTW, if you're gonna use the DF, you might need to add a dummy Effect like "Add TP 0" together with Damage Type "HP recover" to make it work because the DF settings actually have restrictions out of battle which can make your item unusable out of battle.
You can also extend the DF code to return the item
Code:
if a.mhp < 2000; a.param_plus[0]+=value;else;$game_party.gain_item(ID of item,1);end;return 0
Not sure of the parameters for the gain_item though, iirc its ID,amount.
You can also make it play the buzzer sound if you want.
For CE use, IIRC there is actually a script call in the base Ace code that can be used to get the last actor who used an item in the menu, but i forgot the exact call.
BTW, if you're gonna use the DF, you might need to add a dummy Effect like "Add TP 0" together with Damage Type "HP recover" to make it work because the DF settings actually have restrictions out of battle which can make your item unusable out of battle.
The item's description will say "to a maximum of 2000 HP"
And I'm calling the item something along the lines of "HP Seed|2000"
There will also be a HP Seed|5000 and a HP Seed|9999. ^^
Original thread: https://forums.rpgmakerweb.com/threads/vx-ace-is-there-a-way-to-make-it-so-you-cant-use-an-item-on-a-character-with-high-max-hp.109254/