- Joined
- Jan 6, 2015
- Messages
- 8
- Reaction score
- 10
- First Language
- English
- Primarily Uses
- RMMV
I'd be interested in seeing the solution to that question as well ^^Are you still looking for a solution? If so, let me know and I'll help you out.
I'd be interested in seeing the solution to that question as well ^^Are you still looking for a solution? If so, let me know and I'll help you out.
Howdy, developers!
How do I:
- Completely nullify TP natural Gain?
- Hide TP Bars outside of battles?
I want TP Bars only to be shown in battle, and each character will have it's own methods of gaining TP.
I'm assuming you are using MV.I'd be interested in seeing the solution to that question as well ^^![]()
//this will only have enemies gain tp by damage
Game_Battler.prototype.chargeTpByDamage = function(damageRate) {
if (this.isEnemy()) {
var value = Math.floor(50 * damageRate * this.tcr);
this.gainSilentTp(value);
}
};
//this will only have enemies gain tp each round
Game_Battler.prototype.regenerateTp = function() {
if (this.isEnemy()) {
var value = Math.floor(100 * this.trg);
this.gainSilentTp(value);
}
};
//this will only have enemies gain tp by item effects (this might cause trouble if you want to
//have actors gain tp through item effects. If so, just delete this part.
Game_Action.prototype.applyItemUserEffect = function(target) {
var value = Math.floor(this.item().tpGain * this.subject().tcr);
if(this.subject().isEnemy()) this.subject().gainSilentTp(value);
};
//turns off initial tp given at beginning of battle
Game_Battler.prototype.initTp = function() {
if (this.isEnemy()) this.setTp(Math.randomInt(25));
};
Unless there is an option in the plugin to carry gabs over to a new map, this problem is not solvable without some more or less extensive coding.Is there a way to prevent Gab Window from clearing gabs on map change? It's a bad feature given what I use it for.
Thanks CHKNRAVE, but the item is still not reducing. I ran a few turns in battle to be sure, but the -regen did not happen, and when I escaped the battle, my inventory still had the item.Tryuser.consumeItem(itemID)
to consume items in combat. It's the recommended command for damage formulas.
$gameParty._items[itemID] >= n
, in your case the first line should be if($gameActors.actor(1).isAlive() && $gameParty._items[$gameVariables.value(25)] >= 1) {
. The reason why your item count doesn't decrease could be that the condition is just never true because of that.Thanks for the response, but it doesn't work either. It does not detect the item and went straight to the 2nd condition. However, with what you responded, I managed to adjust my original code, and the below does work perfectly, so thank you very much!Are the 2 conditions still valid? You need Actor 1 to be alive, and for the item whose ID is in variable number 25 to still be in the inventory. Try making a battle event that just displays as a message \V[25]. Is this the ID of the item that needs to be checked and consumed?
Also, apparently, the correct syntax for an item owned condition is$gameParty._items[itemID] >= n
, in your case the first line should beif($gameActors.actor(1).isAlive() && $gameParty._items[$gameVariables.value(25)] >= 1) {
. The reason why your item count doesn't decrease could be that the condition is just never true because of that.
Can you try this condition and tell me if it works?
Watch out, you're missing a little closing parenthese in the first line of code.Thanks for the response, but it doesn't work either. It does not detect the item and went straight to the 2nd condition. However, with what you responded, I managed to adjust my original code, and the below does work perfectly, so thank you very much!
<Custom Regenerate Effect>
if ($gameActors.actor(1).isAlive() && $gameParty._items[25] {
$gameParty.loseItem($dataItems[25], 1);
} else {
var regen = -100;
user.gainHp(regen);
user.startDamagePopup();
user.clearResult();
}
</Custom Regenerate Effect>
thanks for pointing out! I totally missed it when I copied it over into the forum (it's correct in my notetag). The revised one is here:Watch out, you're missing a little closing parenthese in the first line of code.
Even if it works, the problem is that this apply effect will stay even after the states are removed.Hey all, so I'm using Yanfly's States Core plugin and I think I'm just lacking the proper syntax knowledge to achieve what I want.
I want states that buff stats, but to have the buff dependent on the intelligence of the character who applied the buff. I have been testing this with a state that should buff the targets intelligence by an amount dependent on the caster's intelligence, I have been messing around with the following basic notetag:
<Custom Apply Effect>
target.mat = target.mat * (1 + (origin.mat / 1000));
</Custom Apply Effect>
This does not cause any errors when I try to use the skill that applies the state in battle, but no change to damage dealt by spells dependent on intelligence occurs once the state is applied. Even when I make the change radical (e.g. target.mat = target.mat + 500). I'm guessing I just don't know the syntax well enough to properly refer to the things I want changed. Any help is greatly appreciated.
Thank you for the insight into how the notetags work and for the quick reply. The damage modification seems like it would be effectively the same thing, I will try to see if I can get the code to run.Even if it works, the problem is that this apply effect will stay even after the states are removed.
I am kind of copying some things over that I know (but it's super limited), but maybe the below works, as it amplifies damage, instead of boosting the state's user mat permanently. Idea from: http://www.yanfly.moe/wiki/Black_Resonance_(MV_Plugin_Tips_&_Tricks)
<Custom Confirm Effect>
// Check if this is a skill that deals HP damage
if (this.isSkill() && this.isHpEffect() && value > 0) {
// Make a pool of the skill types that uses mat
var skillTypes = [];
// Insert the skill types you want applied here
skillTypes.push(x, y, z);
// Create a pool of individual skills that uses mat (you might have skills within other skill types)
var skills = [];
// Add the individual skill ID's to that pool
skills.push(a, b, c);
// Check if the current skill has the skill type
if (skillTypes.contains(this.item().stypeId)) || skills.contains(this.item().Id)) {
// Use the origin mat as a multiplier
var multiplier = 1 + origin.mat/1000;
// Adjust the damage by the multiplier
value *= multiplier;
// Round up the damage
value = Math.ceil(value);
}
}
</Custom Confirm Effect>
However, I am not an expert in JS, so might need someone to run through this script and correct any syntax I might have missed out.
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).Thank you for the insight into how the notetags work and for the quick reply. The damage modification seems like it would be effectively the same thing, I will try to see if I can get the code to run.
Just out of curiosity, could you theoretically include both <Custom Apply Effect> and then<Custom Remove Effect> to edit stats and then have them revert? Assuming you have the math be properly inverted?
Edit: I have another quick question, I follow the logic of creating vectors of skill types and skills themselves to then check for when doing the multiplier, code-wise should I refer to them using their string name or using the two/three digit number they have?
Can I ask this again?Hey peeps!
How can I show a character's equipment on other screens, like on the main menu next to their HP/MP/TP/etc? I thought I could find it and it'd be easy, but I was wrong lol.