RPG Maker MV

RPG Maker MV

Passive skill problem
Hi I have been trying to make some passive skills like HP UP etc, to permanently add 25 HP points to the character, with no success, i did have some with Yanfly's passive states
but as states only seem to use percentages this would happen

if the hp was 100 and the state raised it by 125% you would get 125 exactly what i wanted,
but if i had an item that added 25 hp as well 100+25*125% = 156.25 and not 150

also the same for attack and defense,

how do i go about getting what i need done?
any advice is would be great.

AngelWolf
< >
Εμφάνιση 1-4 από 4 σχόλια
I see what you're trying to do and ran into the same problem. Decided to fix it myself. The problem is states can only hold traits and what we want to modify (set value) is only through params. I made a small script to do just that. Not really polished but it works. It basically does the same thing except you add armors instead of states. Armors have the added effect of params in addition to traits.

This script keeps the passive armors separate from regular armors, so they don't show in equips. They also do not follow the same limitations; it doesn't care if the actor has the skills to equip the armor

Since I don't have a site to post it, I'll just paste it here. Copy it into a .js in your plugin folder. Name doesn't matter but I just called it PassiveArmors.js

/*: * @plugindesc v1.0 Allows adding traits and params to actors via "passive" armors * * @author Sabi * * @help * This script allows traits and parameter adjustments to be made to an * actor with the use of passive armors. These can be tagged to a skill * and the traits and params of the associated armor will be added when * the skill is learned (or removed when the skill is forgotten). * * to add the passive armor to a skill, use the tag: * * <passiveArmor: id> * * where id is an armor id. */ (function () { Game_Actor.prototype.passiveArmors = function(){ var armors = []; this._passiveArmors.forEach(function(armor_id){ armors.push($dataArmors[armor_id]); }, this); return armors; }; Game_Actor.prototype.addPassiveArmor = function(armor_id){ this._passiveArmors.push(armor_id); this.refresh(); }; Game_Actor.prototype.removePassiveArmor = function(armor_id){ var i = this._passiveArmors.lastIndexOf(armor_id); if(i != -1){ this._passiveArmors.splice(i, 1);} this.refresh(); }; Game_Actor.prototype.removePassiveArmorAt = function(index) { if (index >= this._passiveArmors.length || index < 0){return;} this._passiveArmors.splice(index, 1); this.refresh(); }; Game_Actor.prototype.clearPassiveArmors = function(){ this._passiveArmors = []; this.refresh(); }; var OrgGAInitMem = Game_Actor.prototype.initMembers; Game_Actor.prototype.initMembers = function(){ OrgGAInitMem.call(this); this._passiveArmors = []; } var OrgGATraitObj = Game_Actor.prototype.traitObjects; Game_Actor.prototype.traitObjects = function(){ var objects = OrgGATraitObj.call(this); this.passiveArmors().forEach(function(armor) { objects.push(armor); }, this); return objects; }; var OrgGAParamPlus = Game_Actor.prototype.paramPlus; Game_Actor.prototype.paramPlus = function(paramId){ var value = OrgGAParamPlus.call(this, paramId); this.passiveArmors().forEach(function(armor){ value += armor.params[paramId]; }, this); return value; } var OrgGALearnSkill = Game_Actor.prototype.learnSkill; Game_Actor.prototype.learnSkill = function(skillId){ if (!this.isLearnedSkill(skillId)) { armor_id = $dataSkills[skillId].meta.passiveArmor; if(armor_id !== undefined){ this.addPassiveArmor(Number(armor_id)); } } OrgGALearnSkill.call(this, skillId); } var OrgGAForgetSkill = Game_Actor.prototype.forgetSkill; Game_Actor.prototype.forgetSkill = function(skillId){ var index = this._skills.indexOf(skillId); if (index >= 0) { armor_id = $dataSkills[skillId].meta.passiveArmor; if(armor_id !== undefined){ this.removePassiveArmor(Number(armor_id)); } } OrgGAForgetSkill.call(this, skillId); } }) ();
It worked perfectly! thanks so much i only thought i would get advice not a script,
but agin thanks a bunch will note you in the credits
No problem. Glad it was helpful. I'll work on cleaning it up so it plays well with others. In particular, allow you to use it's new script commands with Yanfly's lunatic mode commands. As it is, it should work with other plugins but it can't interact with them. :)
Update.

Took a little coding structure inspired from Yanfly's scripts. This version allows you to directly use the new script calls. It should still work with other plugins just fine.

/*: * @plugindesc v1.1 Allows adding traits and params to actors via "passive" armors * * @author Sabi * * @help * This script allows traits and parameter adjustments to be made to an * actor with the use of passive armors. These can be tagged to a skill * and the traits and params of the associated armor will be added when * the skill is learned (or removed when the skill is forgotten). * * to add the passive armor to a skill, use the tag: * * <passiveArmor: id> * * where id is an armor id. * * Script calls can also be made directly using the following * functions: * * gameActor.addPassiveArmor(id); * Adds a passive armor. * * gameActor.removePassiveArmor(id); * Removes a passive armor. * * gameActor.removePassiveArmorAt(index); * Removes a passive armor in the list at the given index. * * gameActor.clearPassiveArmors(); * Removes all passive armors from the actor. * * gameActor.passiveArmors(); * Returns a list of all armor objects contained in the passive armor * list. * * gameActor is a game actor from the $gameActors object, $gameParty object, * or from other specialized functions. */ var SabiPlugins = SabiPlugins || {}; SabiPlugins.passiveArmors = SabiPlugins.passiveArmors || {}; Game_Actor.prototype.passiveArmors = function(){ var armors = []; this._passiveArmors.forEach(function(armor_id){ armors.push($dataArmors[armor_id]); }, this); return armors; }; Game_Actor.prototype.addPassiveArmor = function(armor_id){ this._passiveArmors.push(armor_id); this.refresh(); }; Game_Actor.prototype.removePassiveArmor = function(armor_id){ var i = this._passiveArmors.lastIndexOf(armor_id); if(i != -1){ this._passiveArmors.splice(i, 1);} this.refresh(); }; Game_Actor.prototype.removePassiveArmorAt = function(index) { if (index >= this._passiveArmors.length || index < 0){return;} this._passiveArmors.splice(index, 1); this.refresh(); }; Game_Actor.prototype.clearPassiveArmors = function(){ this._passiveArmors = []; this.refresh(); }; SabiPlugins.passiveArmors.OrgGAInitMem = Game_Actor.prototype.initMembers; Game_Actor.prototype.initMembers = function(){ SabiPlugins.passiveArmors.OrgGAInitMem.call(this); this._passiveArmors = []; } SabiPlugins.passiveArmors.OrgGATraitObj = Game_Actor.prototype.traitObjects; Game_Actor.prototype.traitObjects = function(){ var objects = SabiPlugins.passiveArmors.OrgGATraitObj.call(this); this.passiveArmors().forEach(function(armor) { objects.push(armor); }, this); return objects; }; SabiPlugins.passiveArmors.OrgGAParamPlus = Game_Actor.prototype.paramPlus; Game_Actor.prototype.paramPlus = function(paramId){ var value = SabiPlugins.passiveArmors.OrgGAParamPlus.call(this, paramId); this.passiveArmors().forEach(function(armor){ value += armor.params[paramId]; }, this); return value; } SabiPlugins.passiveArmors.OrgGALearnSkill = Game_Actor.prototype.learnSkill; Game_Actor.prototype.learnSkill = function(skillId){ if (!this.isLearnedSkill(skillId)) { armor_id = $dataSkills[skillId].meta.passiveArmor; if(armor_id !== undefined){ this.addPassiveArmor(Number(armor_id)); } } SabiPlugins.passiveArmors.OrgGALearnSkill.call(this, skillId); } SabiPlugins.passiveArmors.OrgGAForgetSkill = Game_Actor.prototype.forgetSkill; Game_Actor.prototype.forgetSkill = function(skillId){ var index = this._skills.indexOf(skillId); if (index >= 0) { armor_id = $dataSkills[skillId].meta.passiveArmor; if(armor_id !== undefined){ this.removePassiveArmor(Number(armor_id)); } } SabiPlugins.passiveArmors.OrgGAForgetSkill.call(this, skillId); }
< >
Εμφάνιση 1-4 από 4 σχόλια
Ανά σελίδα: 1530 50

Ημ/νία ανάρτησης: 21 Μαρ 2016, 8:20
Αναρτήσεις: 4