Strengthening a potion?

Status
Not open for further replies.

Woland

Veteran
Veteran
Joined
Mar 26, 2017
Messages
308
Reaction score
55
First Language
Polish
Primarily Uses
RMMV
I'd like an event to permanently make my potions stronger. From restoring X hp to X+1 hp or something. Is there a clever JS for it or do I have to do the messy thing with swapping the potions for a different item?
 

Animebryan

Need more resources!
Veteran
Joined
Jul 31, 2012
Messages
383
Reaction score
175
First Language
English
Primarily Uses
RMMV
Have you tried Yanfly's Item Synthesis plugin? It lets you mix items together to make new ones. Say you have like 3-5 tiers for potions:
Potion (Heals 20% HP)
Hi-Potion (Heals 40%)
Mega Potion (Heals 60%)
Hyper Potion (Heals 80%)
Ultra Potion (Heals 100%)

So what you could do is make recipes where you can take lower tier potions & mix them together with either other potions or with certain synthesis materials to make them into higher tier potions.

Yanfly's Item Synthesis plugin
 

Woland

Veteran
Veteran
Joined
Mar 26, 2017
Messages
308
Reaction score
55
First Language
Polish
Primarily Uses
RMMV
Won't work for me as I am using mogs chrono engine and this won't be compatible
 

Eliaquim

Raze: The Rakuen Zero's Guardian!
Veteran
Joined
May 22, 2018
Messages
1,263
Reaction score
537
First Language
Portuguese - Br
Primarily Uses
RMMV
I think you can use a common event for this when the item is used.
Inside the event, you put the condition which will make your potion stronger.
Let's do an example:
Let's say the potion gets stronger each time he is used.
So, every time you use the potion, you raise a variable inside the event. If the variable is X then you recover X+ hp.
Can you tell the condition which will make your potion stronger? Maybe we can work some more specific solutions.
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
406
Reaction score
258
First Language
English
Primarily Uses
RMMV
Won't work for me as I am using mogs chrono engine and this won't be compatible
Making yanfly's item core work with chrono engine is a 1 line fix. I haven't tried synthesis on top of it but it's worth a shot
 

Woland

Veteran
Veteran
Joined
Mar 26, 2017
Messages
308
Reaction score
55
First Language
Polish
Primarily Uses
RMMV
It just feels like a huge overkill to employ a big crafting plugin or play around with an elaborate eventing system to just change this little value:

1590170789136.png
I mean, it has to be accessible somewhere, right?
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
406
Reaction score
258
First Language
English
Primarily Uses
RMMV
It just feels like a huge overkill to employ a big crafting plugin or play around with an elaborate eventing system to just change this little value:

View attachment 144800
I mean, it has to be accessible somewhere, right?
Wait, are you trying to make all potions stronger forever, or just specific ones.
 

Woland

Veteran
Veteran
Joined
Mar 26, 2017
Messages
308
Reaction score
55
First Language
Polish
Primarily Uses
RMMV
Yes, all potions need to be upgraded. Instead of giving you x hp they give you y hp
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
406
Reaction score
258
First Language
English
Primarily Uses
RMMV
If it's all potions, would giving the characters an inherent pharmacology sp-param work?

The general issue as I understand it, is that the database doesn't save item values if they get changed ingame, so you need to do some extra stuff to alter potion values.

You could do the healing in a common event, I guess
 

Wavelength

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
4,927
Reaction score
4,115
First Language
English
Primarily Uses
RMVXA
If it's ALL potions and ALL things that heal you (rather than just all potions that use a certain Item ID, such as "all Max Elixirs"), you can use the Pharmacology special parameter like @Restart stated.

---

If it's just all of a certain Item ID, then I don't think there's a real easy way to do it, because even if you were to change an entry in the item's "Features" array in the database, that would be reset as soon as you saved, quit, and loaded your game back up (because AFAIK the database itself isn't saved as part of a Save file - when you Load, the game's database is read from the game package).

The best solution would probably be to have a plugin that allows you to set a variable for each Item ID which can grow stronger, and when the Item is used, the variable is added (or multiplied) to the base item effect. That would probably work. But it would require at least a small plugin, not just a single snippet of code.
 

Woland

Veteran
Veteran
Joined
Mar 26, 2017
Messages
308
Reaction score
55
First Language
Polish
Primarily Uses
RMMV
It is fine if it resets. I know it is not persistent. I can make sure it persists on the few maps I care about. But I need the JS to make it restore 250 instead of 200.
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
406
Reaction score
258
First Language
English
Primarily Uses
RMMV
The best solution would probably be to have a plugin that allows you to set a variable for each Item ID which can grow stronger, and when the Item is used, the variable is added (or multiplied) to the base item effect. That would probably work. But it would require at least a small plugin, not just a single snippet of code.
Well, technically you could make some kind of really awful hack by just going in and changing the item apply code

Code:
Game_Action.prototype.itemEffectRecoverHp = function(target, effect) {
    var value = (target.mhp * effect.value1 + effect.value2) * target.rec;
    if (this.isItem()) {
        value *= this.subject().pha;
    }
    value = Math.floor(value);
    if (value !== 0) {
        target.gainHp(value);
        this.makeSuccess(target);
    }
};
And stick in a
Code:
 if((this._item._itemId == 55) && (Gameswitch whatever)){value =whatever}
but that's a super ugly way of doing things
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,130
Reaction score
12,404
First Language
English
Primarily Uses
RMMV
I haven't read all through this thread, but can't you just have the event turn on a switch or set a variable, then use that switch or variable in the damage formula?

You'd need some kind of plugin if you want the item's description to change.

I also have a Dynamic Traits & Effects plugin that will let you change other parameters during the game, that might be helpful, if the above isn't useful.
 
Last edited:

Wavelength

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
4,927
Reaction score
4,115
First Language
English
Primarily Uses
RMVXA
I haven't read all through this thread, but can't you just have the event turn on a switch or set a variable, then use that switch or variable in the damage formula?

You'd need some kind of plugin if you want the item's description to change.
Oh, that's a really good idea. Use "HP Recover" in the damage formula area, and type something like 100 + \V[28] into the formula box to reference the value of Variable #28. Then, erase the recovery effect from the Effects box.

EDIT: I think Shaz is correct below; \V[28] would be for showing the variable in a message box; v[28] should work fine in the damage formula.
 
Last edited:

Woland

Veteran
Veteran
Joined
Mar 26, 2017
Messages
308
Reaction score
55
First Language
Polish
Primarily Uses
RMMV
This worked brilliantly. I'm dumb for not looking at the damage section of the item.

Thank you everyone :)
 

Wavelength

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
4,927
Reaction score
4,115
First Language
English
Primarily Uses
RMVXA

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

Stream will be live shortly with some pixel art! Feel free to drop by!

Can't believe I forgot to put an image of my drawing pad! It looks kinda like this, maybe I'll get a better pic tomorrow...
Backup tip: If you don't want to back up your whole project every day, at least back up everything *except* your Image and Audio folders, which you can do weekly/as needed/etc.
The final version of our game is already available both in English and Spanish! ^___^
Can't believe this day has finally come... T_T
Im so happy that Dead By Daylight is getting a Silent Hill chapter! Cant wait to play as pyramid head

Forum statistics

Threads
97,814
Messages
947,149
Members
129,035
Latest member
Tauron7
Top