- Joined
- May 11, 2020
- Messages
- 153
- Reaction score
- 83
- First Language
- French
- Primarily Uses
- RMMV
I think that's definitely not a question that would get you a short answer, try asking this in JS Plugin Requests.
This would require a plugin. I think your best bet might be SRD's Menu Status Customizer and SRD's Super Tools Engine.Can I ask this again?
origin
instead.Are you looking for this?Hi, everybody.
Is there a way to change the target of a skill in a Custom Select / React Effect? I'm trying to make a skill where the actor who gave a state is taking damage for the wearer.
An alternate solution I'll take would be for the damage to be nullified (with a "missed" result on the target) and the damage being applied toorigin
instead.
Thanks in advance!
That's the right effect, except that it's an active ability which applies the state to a single ally, for a set number of turns. So here's what I came up with, and now it works:Are you looking for this?
<Custom Apply Effect>
if(target===origin) {
target.result().missed = true;
target.removeState(20); //Immediately removed if used on one's self
}
origin.addState(5); //Another unrelated state given to the user
</Custom Apply Effect>
<Custom React Effect>
if(origin.isDead()) {
target.removeState(20); //Removed if the protector died since then
} else {
if((user.isActor()!==target.isActor())&&(value>0)) {
origin.gainHp(-value);
value = 0;
origin.startDamagePopup();
if (origin.isDead()) {
origin.performCollapse();
}
origin.clearResult();
}
}
</Custom React Effect>
if(this.isPhysical()) {
value \= target.pdr;
value *= origin.pdr;
}
<Custom Apply Effect>
if(target===origin) {
target.result().missed = true;
target.removeState(20);
}
origin.addState(5);
target.setStateCounter(20, target.pdr);
<Custom React Effect>
if(origin.isDead()) {
target.removeState(20);
} else {
if((user.isActor()!==target.isActor())&&(value>0)) {
var dmg = value;
origin.gainHp(-dmg);
value = 0;
origin.startDamagePopup();
if (origin.isDead()) {
origin.performCollapse();
}
origin.clearResult();
}
}
</Custom React Effect>
...
var dmg = value;
dmg \= target.pdr;
origin.gainHp(-dmg);
...
Why not just use a notetag to set the original effect as a passive state on an the actor or class you wish to apply the "cover" effect on, instead of applying it via a skill? This way, the state will always be on, instead of being an active skill.That's the right effect, except that it's an active ability which applies the state to a single ally, for a set number of turns. So here's what I came up with, and now it works:
Now I just need to make the defensive stats work which I should handle, but how do I replace the 0 damage pop-up on the original target by a Miss result?JavaScript:<Custom Apply Effect> if(target===origin) { target.result().missed = true; target.removeState(20); //Immediately removed if used on one's self } origin.addState(5); //Another unrelated state given to the user </Custom Apply Effect> <Custom React Effect> if(origin.isDead()) { target.removeState(20); //Removed if the protector died since then } else { if((user.isActor()!==target.isActor())&&(value>0)) { origin.gainHp(-value); value = 0; origin.startDamagePopup(); if (origin.isDead()) { origin.performCollapse(); } origin.clearResult(); } } </Custom React Effect>
Edit: Nevermind about that part I thought I could handle, somehow the damage transfer is cancelled when I add this
right before the part that inflicts damage to the state's sender. Now I'm also stumped as to how I'm going to fix this.JavaScript:if(this.isPhysical()) { value \= target.pdr; value *= origin.pdr; }
2nd edit: It's weird as hell. This redirects:
but this cancels everything out.JavaScript:<Custom Apply Effect> if(target===origin) { target.result().missed = true; target.removeState(20); } origin.addState(5); target.setStateCounter(20, target.pdr); <Custom React Effect> if(origin.isDead()) { target.removeState(20); } else { if((user.isActor()!==target.isActor())&&(value>0)) { var dmg = value; origin.gainHp(-dmg); value = 0; origin.startDamagePopup(); if (origin.isDead()) { origin.performCollapse(); } origin.clearResult(); } } </Custom React Effect>
JavaScript:... var dmg = value; dmg \= target.pdr; origin.gainHp(-dmg); ...
is this copied from your project?but this cancels everything out.
JavaScript:... var dmg = value; dmg \= target.pdr; origin.gainHp(-dmg); ...
dmg /= target.pdr
Because I want this protection to have a cost, to be an action during the character's turn, and most importantly to have one target. I really mean this protection to be a state given through a skill.Why not just use a notetag to set the original effect as a passive state on an the actor or class you wish to apply the "cover" effect on, instead of applying it via a skill? This way, the state will always be on, instead of being an active skill.
Oh, that's... Quite a mistake. A few fixes and the reattribution issue is solved:is this copied from your project?
If so, try it with a normal slash ("/") instead of a backslash ("\") like:
Code:dmg /= target.pdr
<Custom Apply Effect>
if(target===origin) {
target.result().missed = true;
target.removeState(20);
}
origin.addState(5);
</Custom Apply Effect>
<Custom React Effect>
if(origin.isDead()) {
target.removeState(20);
} else {
if((user.isActor()!==target.isActor())&&(value>0)) {
var dmg = value;
if(this.isPhysical()) {
dmg /= target.pdr;
dmg *= origin.pdr;
dmg = Math.floor(dmg);
}
if(this.isMagical()) {
dmg /= target.mdr;
dmg *= origin.mdr;
dmg = Math.floor(dmg);
}
origin.gainHp(-dmg);
value = 0;
origin.startDamagePopup();
if (origin.isDead()) {
origin.performCollapse();
}
origin.clearResult();
}
}
</Custom React Effect>
Thank you again for the insight! I've been messing around on my own the past couple of days, getting successful code for some states. There's something I've been trying to do in the notetags that I was wondering if you knew the proper syntax for. I'd like to identify the party position of a targeted character and save it as an integer in a local variable that will then be used as the index for a global array that I'd like to edit the position of.Hi, I tried the <Custom Apply Effect> and then <Custom Remove Effect>, but the problem is, the maths needed got a bit too complicated (mostly I was using Math.round() function, so it always returns an integer, and then I added that value in Custom Apply Effect, but when I do the same for Custom Remove Effect, the amount to remove had to be recalculated, and was calculated on the higher user mat, which caused the removal to be higher than the added amount. Theoretically, you could create variables to store the original mat, but if you have a big cast of actors, you would need 1 variable for each (including any "guest" characters).
For the vectors you mentioned, you just need the ID of the skills or type in the database as an integer, so 0001 would be just 1, 0020 would be just 20, so on and so forth.
Assuming you want this for MV (it should work for MZ too but I didn't check), the event command for conditional branch lets you check if a particular weapon or armor is equipped (see page 2 of the event command).Is there a script call I can use to check if the first party member has a certain armor/accessory equipped?
$gameParty.leader().equips()[n]
$gameParty.leader().equips()[0] && $gameParty.leader().equips()[0].id === 5
Window_Message.prototype.windowWidth = function() {
return 500;
};
So all the relevant code that you want is in rpg_windows.js. Changing the window height will automatically change the y position of the message box to fit the new height (the y position is actually calculated by the updatePlacement function, but for your purposes it doesn't look like you need to fiddle with that).@SeaPhoenix Ooooh perfect thanks so much! Is there also a way to move the message box up a bit and increase the space between lines/add another few lines as well? The message skin is set to transparent so how that ends up looking isn't an issue for me~ Just need that text aligned with my image![]()
Window_Message.prototype.numVisibleRows = function() {
return 4;
};
Window_Base.prototype.lineHeight = function() {
return 36;
};