JavaScript questions that don't deserve their own thread

NotAHero

Villager
Member
Joined
Mar 27, 2018
Messages
13
Reaction score
0
First Language
Portuguese - BR
Primarily Uses
RMMV
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:
 

Klammsi

Veteran
Veteran
Joined
Nov 19, 2016
Messages
84
Reaction score
10
First Language
English
Primarily Uses
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
 

CHKNRAVE

Surprisingly not sponsored by Yanfly.
Veteran
Joined
May 11, 2020
Messages
216
Reaction score
124
First Language
French
Primarily Uses
RMMV
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:
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))
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
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 the value variable).
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 to value the base fire damage multiplied by the target's element rate for fire.
 
Last edited:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,134
Reaction score
7,310
First Language
Indonesian
Primarily Uses
RMVXA
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
Use Math.random() * 40
This will generate 0 ~ 39.99999999

Use 10 + Math.random() * 31
This will generate 10 ~ 40.9999999
 

NotAHero

Villager
Member
Joined
Mar 27, 2018
Messages
13
Reaction score
0
First Language
Portuguese - BR
Primarily Uses
RMMV
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))
So, in addition to creating a state for each element, I should also include ALL elements in the formula to make the comparison, right?
What would be the "custom effect" to use in this case? :LZSskeptic:
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,134
Reaction score
7,310
First Language
Indonesian
Primarily Uses
RMVXA
The main problem here is, how do you designate a specific type for the characters to create the passive skill formula?
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
 

NotAHero

Villager
Member
Joined
Mar 27, 2018
Messages
13
Reaction score
0
First Language
Portuguese - BR
Primarily Uses
RMMV
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
sorry if i don't understand, but will this formula work for a passive state?
* I'm using yanfly plugins *
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,134
Reaction score
7,310
First Language
Indonesian
Primarily Uses
RMVXA
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.
 

Klammsi

Veteran
Veteran
Joined
Nov 19, 2016
Messages
84
Reaction score
10
First Language
English
Primarily Uses
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 the value variable).
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 to value the base fire damage multiplied by the target's element rate for fire.
Thx for that mate!
 

MiddleMang

Villager
Member
Joined
Jan 24, 2019
Messages
15
Reaction score
2
First Language
English
Primarily Uses
RMMV
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.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,134
Reaction score
7,310
First Language
Indonesian
Primarily Uses
RMVXA
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.
 

Vis_Mage

Novice Magician
Veteran
Joined
Jul 28, 2013
Messages
636
Reaction score
211
First Language
English
Primarily Uses
RMMV
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?
 
Last edited:

CHKNRAVE

Surprisingly not sponsored by Yanfly.
Veteran
Joined
May 11, 2020
Messages
216
Reaction score
124
First Language
French
Primarily Uses
RMMV
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 command $gameVariables.setValue(ID, value) you can store a string instead of a number.

Replace ID by the variable's ID. value is to be replaced by $dataSkills[skillID].name for the name of the skill you point at with skillID, and $dataSkills[skillID].description for the description.
 

Hyo

Warper
Member
Joined
Feb 27, 2021
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMZ
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!
 

CHKNRAVE

Surprisingly not sponsored by Yanfly.
Veteran
Joined
May 11, 2020
Messages
216
Reaction score
124
First Language
French
Primarily Uses
RMMV
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()
 
Last edited:

Koru-chan

Veteran
Veteran
Joined
Jul 30, 2012
Messages
46
Reaction score
16
First Language
English
Primarily Uses
RMMV
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 >_>
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,134
Reaction score
7,310
First Language
Indonesian
Primarily Uses
RMVXA
I don't know if this is the right place to ask this
It is not the right place, go to the plugin request.

However ...
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.
At the same level of vs, there is nothing.
But you can try either
- LunaTech
- Hakuen Studio
- Raizen
 

matgraz

Veteran
Veteran
Joined
Feb 4, 2018
Messages
105
Reaction score
8
First Language
Portuguese
Primarily Uses
RMMV
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?
1615178663225.png
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!
 

Latest Threads

Latest Posts

Latest Profile Posts

I've decided "Attack on Equestria" should be released first... hence this new ARG channel! https://www.youtube.com/channel/UClKiUI8xOVx9dsF4kRXUmxw
Check it out, and subscribe! The ARG will lead up to the video game. It's not a creepy game, but I just thought it should follow ARG standards.
For anyone interested in my project M - i finally made a gamethread about it :D

Yay. I turned 39 today. Another year older, another year closer to the grave.
I'm sure the latest post/thread in the sidebar used to have 5 posts. Was it always been like this?

Made it to the 10th video doing this! :kaocry:

renderTimingPixel.png

Forum statistics

Threads
110,407
Messages
1,053,064
Members
143,468
Latest member
oldj
Top