Hello Everyone,
Hope you are well! I have a question regarding damage variance and how I would put it into a JS code. I know that there is an option for damage variance build in into the editor.
This is an example of what I am trying to achieve: An item that that adds 10-40 extra fire damage when equipped.
I figured out how to do this using variables in the damage formula but in my particular case I would need to add this into the Note Box of a state using a Java Script code.
My question would be how to construct that code as my JS knowledge is quite limited.
Any advise would be very appreciated,
Thank you
JavaScript questions that don't deserve their own thread
● ARCHIVED · READ-ONLY
-
-
Create a passive state for every elemental type, assign them to everybody including actors, then compare the elemental type state of the actor to that of the enemy you want. (Hello everyone!
I'm trying to create a passive ability that if the actor and the enemy are of the same elemental type, the actor is given a buff of MAT and ATK.
The main problem here is, how do you designate a specific type for the characters to create the passive skill formula?
:LZSskeptic:if(ACTOR.isStateAffected(X) && ENEMY.isStateAffected(X))
Using the Buffs and States Core, set up a Custom Confirm effect. Along with Custom React Effect, it's one of the 2 parts where you can manipulate the HP the target will lose (by changing theHello Everyone,
Hope you are well! I have a question regarding damage variance and how I would put it into a JS code. I know that there is an option for damage variance build in into the editor.
This is an example of what I am trying to achieve: An item that that adds 10-40 extra fire damage when equipped.
I figured out how to do this using variables in the damage formula but in my particular case I would need to add this into the Note Box of a state using a Java Script code.
My question would be how to construct that code as my JS knowledge is quite limited.
Any advise would be very appreciated,
Thank youvaluevariable).
If you want to add this value to any fire damage dealt, you just have to detect the element of the skill / item used.
If you want to deal fire damage whenever you deal damage, just detect whether the wearer of the state is dealing HP damage to an enemy, then add tovaluethe base fire damage multiplied by the target's element rate for fire. -
Use Math.random() * 40Hello Everyone,
Hope you are well! I have a question regarding damage variance and how I would put it into a JS code. I know that there is an option for damage variance build in into the editor.
This is an example of what I am trying to achieve: An item that that adds 10-40 extra fire damage when equipped.
I figured out how to do this using variables in the damage formula but in my particular case I would need to add this into the Note Box of a state using a Java Script code.
My question would be how to construct that code as my JS knowledge is quite limited.
Any advise would be very appreciated,
Thank you
This will generate 0 ~ 39.99999999
Use 10 + Math.random() * 31
This will generate 10 ~ 40.9999999 -
So, in addition to creating a state for each element, I should also include ALL elements in the formula to make the comparison, right?Create a passive state for every elemental type, assign them to everybody including actors, then compare the elemental type state of the actor to that of the enemy you want. (
if(ACTOR.isStateAffected(X) && ENEMY.isStateAffected(X))
What would be the "custom effect" to use in this case? :LZSskeptic: -
Simple. Use a tag in the note box. You can literally use any tag.The main problem here is, how do you designate a specific type for the characters to create the passive skill formula?
Add <fire> for example
What you do to check if the element is match, if it is an actor to enemy
Code:a.actor().meta.fire == b.enemy().meta.fire -
sorry if i don't understand, but will this formula work for a passive state?Simple. Use a tag in the note box. You can literally use any tag.
Add <fire> for example
What you do to check if the element is match, if it is an actor to enemy
Code:a.actor().meta.fire == b.enemy().meta.fire
* I'm using yanfly plugins * -
Meta tag works without a plugin. How to get the metadata is just as I described. Basically, I'm strictly answering this question below.
how do you designate a specific type for the characters
If you're asking about the Yanfly plugin specifically, then I suggest you just create a new thread. -
Thx mate!Use Math.random() * 40
This will generate 0 ~ 39.99999999
Use 10 + Math.random() * 31
This will generate 10 ~ 40.9999999 -
Thx for that mate!Create a passive state for every elemental type, assign them to everybody including actors, then compare the elemental type state of the actor to that of the enemy you want. (
if(ACTOR.isStateAffected(X) && ENEMY.isStateAffected(X))
Using the Buffs and States Core, set up a Custom Confirm effect. Along with Custom React Effect, it's one of the 2 parts where you can manipulate the HP the target will lose (by changing thevaluevariable).
If you want to add this value to any fire damage dealt, you just have to detect the element of the skill / item used.
If you want to deal fire damage whenever you deal damage, just detect whether the wearer of the state is dealing HP damage to an enemy, then add tovaluethe base fire damage multiplied by the target's element rate for fire. -
Is there a simple way to charm/mind control an enemy but have them use their skills? I thought maybe you could cheat it with yanfly and there could be a lunatic code for selecting only allies or troop members, since the "attack allies" restriction on states only uses basic attacks.
-
This is better asked in either MV/MZ support or JS plugin support as a separate thread than being here.Is there a simple way to charm/mind control an enemy but have them use their skills? I thought maybe you could cheat it with yanfly and there could be a lunatic code for selecting only allies or troop members, since the "attack allies" restriction on states only uses basic attacks.
-
Is there a script call I can use to store a skill's description text in a variable? I'm hoping I can then use /v[21] to show the description in a message box.
EDIT: Additionally, it there a script call I can use to store a skill's name (who's ID is equal to a variable) in a variable? -
If you use the script commandIs there a script call I can use to store a skill's description text in a variable? I'm hoping I can then use /v[21] to show the description in a message box.
EDIT: Additionally, it there a script call I can use to store a skill's name (who's ID is equal to a variable) in a variable?$gameVariables.setValue(ID, value)you can store a string instead of a number.
ReplaceIDby the variable's ID.valueis to be replaced by$dataSkills[skillID].namefor the name of the skill you point at withskillID, and$dataSkills[skillID].descriptionfor the description. -
Hello! I was wondering how I would go about with rearranging the buttons inside of Window_ActorCommand in MZ. I have redefined the size to be much larger, and I was hoping to have the 4 buttons (Attack, Guard, Skill, Item) in each separate corner of the window. Thanks to anyone who can help!
-
Hi everybody, does anybody know a script command I could use to activate an event as if I interacted with it?
EDIT: after fumbling around with the console, I found that this worked:$gameMap._events[eventID].start() -
I don't know if this is the right place to ask this, but here I go. So like a lot of people, I've gotten used to using Yanfly's plugins as a base for a lot of my projects. Moving to MZ, though, I'm finding that a lot of the "ported" plugins are behind a paywall. I don't do the commercial game thing, so $100 for a full suite is kind of out of my price range.
So my question is, are there any names/sites you guys can point me toward of other plugin programmers with similar suites of plugins? Like, I know there are a LOT of plugin programmers, but I'm specifically looking for programmers who have a large array of different plugins that I at least know will be compatible with each other because they're all made by the same person. I try to not mix and match from too many programmers precisely because of compatibility issues, so any links for larger plugin libraries would be appreciated.
Sorry to be long-winded and demanding >_> -
It is not the right place, go to the plugin request.I don't know if this is the right place to ask this
However ...
At the same level of vs, there is nothing.but I'm specifically looking for programmers who have a large array of different plugins that I at least know will be compatible with each other because they're all made by the same person.
But you can try either
- LunaTech
- Hakuen Studio
- Raizen -
ty, I'll give those three a look. I thought plugin request was only to request for plugins to be made. My mistake.It is not the right place, go to the plugin request.
However ...
At the same level of vs, there is nothing.
But you can try either
- LunaTech
- Hakuen Studio
- Raizen -
I'm using YEP_HitAccuracy to have a nicer formula to calculate the sucess of an attack but i'm kinda
confused by what exactly those variables mean
Code:skillHitRate * (userHitRate - targetEvadeRate)
1) SkillHitRate = 'Sucess' parameter on the skill? Success =100% means skillHitRate = 1?
2) userHitRate refers to the trait of actors class+extra hit rates from equip, states?
3) A character with no HitRate traits whatsoever would always miss?
4) targetEvadeRate refers to the trait of actors class+extra hit rates from equip, states
5) A character with no Evade Ratetraits whatsoever would always be hit if the attacker were not hadicaped iin hit rate?
I feel like these are basic questions that doesnt deserve they own thread
thanks! -
skillHitRate is the listed success rate of the skill (represented as a decimal, so it takes the percentage and multiplies it by 0.01). So yeah, 100% means skillHitRate = 1.I'm using YEP_HitAccuracy to have a nicer formula to calculate the sucess of an attack but i'm kinda
confused by what exactly those variables mean
Code:skillHitRate * (userHitRate - targetEvadeRate)
1) SkillHitRate = 'Sucess' parameter on the skill? Success =100% means skillHitRate = 1?
View attachment 182210
2) userHitRate refers to the trait of actors class+extra hit rates from equip, states?
3) A character with no HitRate traits whatsoever would always miss?
4) targetEvadeRate refers to the trait of actors class+extra hit rates from equip, states
5) A character with no Evade Ratetraits whatsoever would always be hit if the attacker were not hadicaped iin hit rate?
I feel like these are basic questions that doesnt deserve they own thread
thanks!
userHitRate and targetEvadeRate are both determined by formulae in the plugin parameters. By default userHitRate is user.hit for physical and 1.0 for magical and certain hit, with targetEvadeRate defaulting to target.eva for physical, target.mev for magical and 0.00 for certain hit. user.hit and target.eva will be the combined value from the battlers's traits and whatever equipment/states etc they have. You are correct: if the battler had no hit rate traits whatsoever the value would be 0 and you'd always miss. A battler with no evade chance would not subtract anything from the user's hit rate.
Let's say your actor has a 80% hit rate from traits and they use a physical skill with 100% success. The enemy has no evade traits. The formula ends up being 1.0 * (0.8 - 0) = 0.8.
Now let's say the actor has 93% hit, the skill has a success rate of 87% and the enemy has 4% evasion. It becomes 0.87 * (0.93 - 0.04) which comes out to 0.7743 rounded to 0.77, so you'll end up with a 77% chance of hitting.
Obviously this is just the default formula used by the plugin; you can change that completely if you wish.