[Solved] Where are Traits applied to the actor?

SilverDash

Veteran
Veteran
Joined
Oct 11, 2015
Messages
424
Reaction score
171
First Language
Dutch
Primarily Uses
RMMV
I found where it happens for the Battler. But I can't seem to find where this happens for an actor. Say I equip a weapon and it has a trait that increases max_hp by 5%, where is the code located that actually adds this 5%? Same for unequipping.

I ctrl-f-ed through the files but no success :( . It's not internally done I hope.

I'd like to manually increase/decrease actor hp and would like to see how traits do this in case I would consider using custom-traits.
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
Game_BattlerBase is the superclass of Game_Battler, which itself is the superclass of Game_Actor and Game_Enemy, so you are already at the right place.
 

SilverDash

Veteran
Veteran
Joined
Oct 11, 2015
Messages
424
Reaction score
171
First Language
Dutch
Primarily Uses
RMMV
Good then I found it :) .

If I were to add say +10 max_hp to the actor (permanently, should remain through level-ups), how would I do this w/o adding buffs. This code looks so complex.

Just coding:

$gameActors.actor(1).mhp += 10; // Does nothing (it's a getter w/o a setter)alert($gameActors.actor(1).param(0)) // displays mhp, but can't alter it once againI can't find where it's retrieved from the database.

I checked the levelup, changexp, other stuff alike but could not find where it's done.

I found it here (even though it's very dirty to do it here but it works):

Code:
// for constant values:var testa  = Game_Actor.prototype.paramBase;Game_Actor.prototype.paramBase = function(paramId) {	var retVal = testa.apply(this, arguments);		if (paramId == 0) //mhp	{		retVal -= 1000;	}	    return retVal;};// for %-values:var testb  = Game_Actor.prototype.paramRate;Game_Actor.prototype.paramRate = function(paramId) {    var retVal = testb.apply(this, arguments);    retVal += 0.05; // add 5%    return retVal;};
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,015
Members
137,563
Latest member
MinyakaAeon
Top