JavaScript questions that don't deserve their own thread

MiddleMang

Villager
Member
Joined
Jan 24, 2019
Messages
26
Reaction score
2
First Language
English
Primarily Uses
RMMV
Hello all. Is there a way to use states to check for misses in MV? Ideally I want to check and apply a state counter for each miss, but "if (b.result().missed){" doesn't seem to work w/Custom Action Effects
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,158
Reaction score
9,109
First Language
English
Primarily Uses
RMMV
@MiddleMang You might want to start your own thread with greater detail.

Per the first post in this thread, it's not for plugin support - state counters come from a plugin, and I'm not sure what you're referring to with Custom Action Effects, but that sounds like plugin stuff, too.

So as far as the JavaScript question goes, that conditional is correct for seeing if an attack missed. For help getting it to do what you want with plugins, I'd suggest making a thread with the names and links to plugins you're using.
 

bookco

Regular
Regular
Joined
May 29, 2023
Messages
161
Reaction score
155
First Language
English
Primarily Uses
RMMZ
Is there a plugin for MZ that changes damage output per weapon? I would like to make this possible in MZ the way that HIME’s Weapon Damage plugin worked for MV. Apologies if this is the wrong thread in which to post this question.

Right now, my workaround is to use @ATT_Turan's custom hit formula plugin serve as a means for Armor Class, have Max MP serve as Armor Class, and relegate the Defense stat to a 'damage die' variable, but this will only work for 1d4-1d12. I'm not too concerned with following 5e to the T, so this workaround might end up being my method, but it would be great if there was a proper solution somehow.
 
Last edited:

ShockerWizard

Warper
Member
Joined
Jun 2, 2023
Messages
2
Reaction score
0
First Language
Portuguese
Primarily Uses
RMMZ
[using MZ]

I'm trying to make a small plugin just to disable the "step forward" when a character takes an action in SV battle, but i've only managed to find the function that plays the sprite animation (.requestMotion), so the character remains in their ready pose, but still moves forward and back when it's their turn.

Can someone point me to where i can find the code that initiates that step forward? If i can just find it, i think i'll be able to figure things out on my own.

Thank you.

(The way i've been teaching myself is to just poke around until i find what i need, but that gets a bit confusing sometimes, and googling it has been a bit hard because i don't know the correct term for some stuff.)
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,158
Reaction score
9,109
First Language
English
Primarily Uses
RMMV
Is there a plugin for MZ that changes damage output per weapon? I would like to make this possible in MZ the way that HIME’s Weapon Damage plugin worked for MV. Apologies if this is the wrong thread in which to post this question.
Well, it is and isn't. The way you're asking it is about plugins, and the first post of this thread says it's not about plugins. This should be a new thread in Plugin Requests. However, it can be done without one, it's just not a great solution.

You could put it in the damage formula.
Code:
if (a.isActor() && a.weapons().length)
will make everything right after it only execute if the attacker is an actor wielding a weapon, since enemies don't have weapons. Then you'd do:
Code:
if (a.weapons()[0].id==X)
where X is the ID of the weapon you're checking. So you'd have to do this long, nested thing:
Code:
if (a.isActor() && a.weapons().length) {if (a.weapons()[0].id==1) some_formula; else if (a.weapons()[0].id==2) some_other_formula; ... } else enemy_formula

Right now, my workaround is to use @ATT_Turan's custom hit formula plugin serve as a means for Armor Class, have Max MP serve as Armor Class, and relegate the Defense stat to a 'damage die' variable, but this will only work for 1d4-1d12.
I don't understand how doing that would limit you to what "die size" is in the Defense stat. But, honestly, I suggest asking for help with a plugin. I'm pretty sure you can do this with VisuStella's Battle Core, there are notetags for different damage calculations.

I'm trying to make a small plugin just to disable the "step forward" when a character takes an action in SV battle, but i've only managed to find the function that plays the sprite animation (.requestMotion), so the character remains in their ready pose, but still moves forward and back when it's their turn.

Can someone point me to where i can find the code that initiates that step forward?
It is - appropriately and amusingly? - stepForward()

So if you just want to entirely disable it, you can do:
Code:
Sprite_Actor.prototype.stepForward = function() {};

(The way i've been teaching myself is to just poke around until i find what i need, but that gets a bit confusing sometimes, and googling it has been a bit hard because i don't know the correct term for some stuff.)
I'm surprised - I Google "rpg maker mz step forward" and I find several threads. None of them are about disabling the step, but they all reference the name of the function.
 

ShockerWizard

Warper
Member
Joined
Jun 2, 2023
Messages
2
Reaction score
0
First Language
Portuguese
Primarily Uses
RMMZ
Thank you for the help.

I'm surprised - I Google "rpg maker mz step forward" and I find several threads. None of them are about disabling the step, but they all reference the name of the function.

Well, i feel silly now. The only time i even considered calling it a "step forward", was when i was trying to figure out how to explain it more clearly in here (to make that post), but not when i was messing around with the code. Sorry about that.
Edit: I feel double silly now, because the sprites.js was a file i wouldn't have thought to check. I thought it would be core, or object, or even manager, but sprites? :p
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,158
Reaction score
9,109
First Language
English
Primarily Uses
RMMV
Edit: I feel double silly now, because the sprites.js was a file i wouldn't have thought to check. I thought it would be core, or object, or even manager, but sprites? :p
I suggest ignoring the files. That is, just search for stuff in the entire js directory. That way it will come up regardless of which file you think it might be in.
 

Puppet Knight

Knight on a Crossbar
Regular
Joined
Aug 3, 2022
Messages
644
Reaction score
759
First Language
English
Primarily Uses
RMMZ
Hey all,

If I use a <JS Pre-Start Action> note tag that sets the value for m as var m = (my code here to get value) will that m be usable in a damage formula? Or do I have to set var = m in the damage formula itself always?
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,158
Reaction score
9,109
First Language
English
Primarily Uses
RMMV
If I use a...note tag that sets the value for m...will that m be usable in a damage formula?
No. Code inside notetags is executed by another function (eval() ), so nothing you declare inside of it can go back out to a larger scope, unless you declare it globally (which is both poor practice and unnecessary).

I mean, even if it weren't executed by a third function, just the fact that your notetag and your damage formula aren't the same function means you can't use locally-declared variables back and forth unless you're passing them as function arguments.

The obvious-ish alternative is to do what you might see in a ton of Yanfly Tip & Tricks, where you put the variable on the battler.
In a notetag,
Code:
user.m=whatever;
can then be accessed in a damage formula with
Code:
a.m

You could also, of course, use one of MZ's global variables.
 

DrBuni

Regular
Regular
Joined
Dec 27, 2020
Messages
234
Reaction score
142
First Language
.
Primarily Uses
RMMV
Is it possible to make a skill that deals damage to an enemy while healing the caster in the process?
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,158
Reaction score
9,109
First Language
English
Primarily Uses
RMMV
Is it possible to make a skill that deals damage to an enemy while healing the caster in the process?

But it's better not to put things like gainHp in the damage formula, so the preferred solution would be to use something like Yanfly's Skill Core to execute additional code when you use a skill.
 

DrBuni

Regular
Regular
Joined
Dec 27, 2020
Messages
234
Reaction score
142
First Language
.
Primarily Uses
RMMV

But it's better not to put things like gainHp in the damage formula, so the preferred solution would be to use something like Yanfly's Skill Core to execute additional code when you use a skill.
I have Skill Core installed, so that shouldn't be a problem. But I have to ask why is it ill advised to put things such as gainHp in damage formulas?
 

Puppet Knight

Knight on a Crossbar
Regular
Joined
Aug 3, 2022
Messages
644
Reaction score
759
First Language
English
Primarily Uses
RMMZ
How would I call the item window used in battle via script call?

Trying to set up a "Use" skill that functions like the item command without taking up a command window spot.
 

TESTOSTERONE

Nosey aren't ya?
Regular
Joined
Feb 11, 2017
Messages
500
Reaction score
2,603
First Language
English
Primarily Uses
RMMV
Hi everyone. Does anyone know what this selection window called inside Window_BattleActor (RPG Maker MV)?
I am trying to make its height taller so it goes all the way to the bottom:
1687460093238.png
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,764
Reaction score
892
First Language
English
Primarily Uses
RMXP
The gauge or the rectangle cursor?
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,158
Reaction score
9,109
First Language
English
Primarily Uses
RMMV
@TESTOSTERONE I think you're talking about Window_BattleActor, "The window for selecting a target actor on the battle screen."

There's also a corresponding Window_BattleEnemy.
 

TESTOSTERONE

Nosey aren't ya?
Regular
Joined
Feb 11, 2017
Messages
500
Reaction score
2,603
First Language
English
Primarily Uses
RMMV
@TESTOSTERONE I think you're talking about Window_BattleActor, "The window for selecting a target actor on the battle screen."

There's also a corresponding Window_BattleEnemy.
There's that rectangle selection cursor inside Window_BattleActor, and I haven't been able to figure out yet how to change its height or when/how this selection cursor gets created.

Edit: Oooh, is it this thing?
1687461496966.png
 
Last edited:

Latest Threads

Latest Profile Posts

I'm just gonna remove the Dark Spells from my game. They wouldn't be fighting Gods or Angels. So why have it?
Every day I'm getting rough-outs of another sprite sheet or two. Getting real close to just needing to make new original stuff and editing my tables and chairs to look correct for the taller sprites is among the top of the revisions list.
Eye_Guys.gif
Some eyew guys! One is absent for... reasons of taste
Eeee! X3 Ever since I started doing 3d Art ,my Pixel Art got sooo much better! I cant wait till im done with the tileset!
Crystal Shock Devlog #5 yay!



This week was super fun as I got to work on my favorite thing: Combat! A new boss has been added and some new mechanics on top of that. I also made some improvements to the first town.

Forum statistics

Threads
134,918
Messages
1,251,910
Members
177,755
Latest member
Sprk_3D
Top