Change Element Rate via Script Call?

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

Slightly Crazy Programmer
Veteran
Joined
Feb 16, 2016
Messages
444
Reaction score
208
First Language
English
Primarily Uses
RMMV
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 :)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,018
Members
137,563
Latest member
MinyakaAeon
Top