romepizza

Veteran
Veteran
Joined
Nov 9, 2015
Messages
45
Reaction score
1
First Language
German
Hey guys & girls,


is there a script call command to change a battlers element rate (increase or decrease the incoming elemental dmg)?


You can get these rates by battler.elementRate(<elementId>) but I haven't found a way to change it. Apparently battler.setElementRate(<elementId>, <rate>) doesn't exist. I'm using Yanfly's Element Core, but there is nothing of a funktion to do so. To be clear, I would like to change it inside of my states attach/detach method, or where ever, but I don't have the command for that yet.


Does anyone if there is a command for that?
 

shockra

Bored Code Guy
Veteran
Joined
Feb 16, 2016
Messages
472
Reaction score
219
First Language
English
Primarily Uses
RMMZ
Do you have Yanfly's Buff and States Core?  If so, you can use:


<Custom Apply Effect>


code


</Custom Apply Effect>


<Custom Remove Effect>


code


</Custom Remove Effect>


These will run the code when the state is applied or removed.  But I feel like you're over-complicating the problem.  Can't you just alter the element rate through a trait?
 

romepizza

Veteran
Veteran
Joined
Nov 9, 2015
Messages
45
Reaction score
1
First Language
German
Sure, I use the Buff and State Core :)


To specify what I'd like to do: I wanted to create states, which can be applied to either an ally or an enemy. Depending on wether the "victim" of that state is an actor (if(user.isActor()) or not, the state should act differently. For example I have the "Life Orb" - state, which, when attached to an ally will heal him at the end of his turn, but when attached to an enemy, the enemy has a chance on healing his target when he hits it. I have six different types of orbs with similar effects (all depend on wether the victim is an actor or not), but they also all (should) increase the damage of a specific element if the victim is an actor (easily done with Yanfly's Element Core, "user.elementMagnifyRate(id, x%)), but increase the incoming damage if the victim is an enemy. If so, the only way of getting that done is by altering the element rate in the states traits, just as you said. But that also would alter the element rate of the victim, if it was an actor, and that is something I certainly don't want.


So the easiest way of solving this is to use a script call similar to the "user.elementMagnifyRate(id, x%)" for the elementRate.


What I did now is to simply create twelve states, six states for actors and six states for enemies.


So I already did something to avoid that problem, but if anyone knows this command, I still would appreciate that intel :)
 

Latest Threads

Latest Posts

Latest Profile Posts

By the power of timezones! This picture shall still be posted on december 1st!!!
7xI2Gc2.jpg

This is not something I'd ever even considered but wow! What a way to use music in a game.
I am a complete fool. I went through the trouble of making a clone sprite and setting up a system to have the characters flash, when it turns out - I never noticed that the "._mainSprite" was the actual bitmap being used. I'm happy since that makes compatibility easier, but I also want to scream.
Synchronizing bust and sprite expressions! Plus using a phone behaviour :kaopride:
BVadZby.gif

Long gif tho, let it load first :kaoswt2:
Wondering how to force a Save State in VNMaker with a name and how to call it with a scene event in order to double check if this Save State exists or not. Phew... Leaving breadcrumbs for chapter DLCs to pickup would be more than half the fight in order to finish this visual novel :LZSsad:

Forum statistics

Threads
117,116
Messages
1,104,716
Members
153,156
Latest member
ridge_tim
Top