RPG Maker Forums

Code:
js/plugins/Olivia_AntiPlayerStress.js:331 TypeError: Cannot read property 'initialize' of undefined
    at Game_Player.initialize (js/plugins/TAMAMO_ActorManager.js:85)
    at new Game_Player (rpg_objects.js:7396)
    at Function.DataManager.createGameObjects (rpg_managers.js:213)
    at Function.DataManager.setupNewGame (rpg_managers.js:217)
    at Function.DataManager.setupNewGame (js/plugins/OrangeOverlay.js:223)
    at Scene_Boot.start (rpg_scenes.js:402)
    at Function.SceneManager.updateScene (rpg_managers.js:2019)
    at Function.SceneManager.updateMainNoFpsSynch (YEP_FpsSynchOption.js:210)
    at Function.SceneManager.updateMain (YEP_FpsSynchOption.js:203)
    at Function.SceneManager.update (rpg_managers.js:1907)
I have no idea what is going on anymore. I added a custom new script I wrote. And all of sudden crash at launch, :(
Here is the script I added.

Code:
//=============================================================================
// Studio Tamamo - Actor Manager
// Tamamo_ActorManager.js
//=============================================================================

var Imported = Imported || {};
Imported.ActorManager = true;

var Tamamo = Tamamo || {};
Tamamo.ActorManager = Tamamo.ActorManager || {};

//=============================================================================
 /*:
 * @plugindesc v1.0 Manages the actors' despair and insanity.
 * @author Palpaleos
 *
 * @param Soul Switch
 * @desc This switch will trigger the common event. It should be unique.
 * @default 1
 *
 * @param ---Despair---
 * @default
 *
 * @param Despair Variable
 * @desc A set of variables that represent this value.
 * @default 1
 *
 * @param Despair Switch
 * @desc This switch will trigger the common event. It should be unique.
 * @default 1
 *
 * @param ---Insanity---
 * @default
 *
 * @param Insanity Variable
 * @desc A set of variables that represent this value.
 * @default 5
 *
 * @param Insanity Switch
 * @desc This switch will trigger the common event. It should be unique.
 * @default 1
 *
 * @param ---Mood---
 * @default
 *
 * @param Mood Variable
 * @desc A set of variables that represent this value.
 * @default 9
 *
 *
 * @param ---Hunger---
 * @default
 *
 * @param Hunger Variable
 * @desc A set of variables that represent this value.
 * @default 13
 *
 * @param Hunger Switch
 * @desc This switch will trigger the common event. It should be unique.
 * @default 1
 */
//=============================================================================

//=============================================================================
// Parameters
//=============================================================================
Tamamo.Parameters = PluginManager.parameters('Tamamo_ActorManager');
Tamamo.Param = {};

Tamamo.Param.SoulSwitch = Number(Tamamo.Parameters['Soul Switch'] || 2);
Tamamo.Param.DespairVariable = Number(Tamamo.Parameters['Despair Variable'] || 1);
Tamamo.Param.DespairSwitch = Number(Tamamo.Parameters['Despair Switch'] || 3);
Tamamo.Param.InsanityVariable = Number(Tamamo.Parameters['Insanity Variable'] || 5);
Tamamo.Param.InsanitySwitch = Number(Tamamo.Parameters['Insanity Switch'] || 4);
Tamamo.Param.MoodVariable = Number(Tamamo.Parameters['Mood Variable'] || 9);
Tamamo.Param.HungerVariable = Number(Tamamo.Parameters['Hunger Variable'] || 13);
Tamamo.Param.HungerSwitch = Number(Tamamo.Parameters['Hunger Switch'] || 5);
var HungerTimer=0;

//=============================================================================
// Game_Player
//=============================================================================
Tamamo.ActorManager.Game_Player_initialize = Game_Player.prototype.initialize;
Game_Player.prototype.initialize = function() {
    Tamamo.Game_Player.initialize.call(this);
}

Tamamo.ActorManager.Game_Player_update = Game_Player.prototype.update;
Game_Player.prototype.update = function(sceneActive) {
    if(sceneActive && $gameSwitches.value(Tamamo.GameInit)) {
        this.updateParams();
    }
    Tamamo.ActorManager.Game_Player_update.call(this);
};

Game_Player.prototype.updateParams = function() {
    var index=null;
    var despairEnd=false;
    var insanityEnd=false;
    var hungerEnd=false;
    if ($gameUnit.deadMembers().length > 0) {
        $gameSwitches.setValue(Tamamo.Params.SoulSwitch, true);
    }
    HungerTimer+=1;
    if(HungerTimer===3600){
        HungerTimer=0;
    }
    for (var i = 0; i < 4; i++) {
        index = $gameParty.actors[i].actorId;
        //hungertimer
        if(HungerTimer===0){
            $gameParty.actors[i].gainMp(-1);
            var shorthand =index+Tamamo.Params.HungerVariable;
            if($gameParty.actors[i].mp===0){
                $gameVariables.setValue($gameVariables.value(shorthand)+1);
                $gameParty.actors[i].gainMp($gameParty.actors[i].mmp);
            }
        }
        //dead ends
        //despair
        if($gameVariables.value(index+Tamamo.Params.DespairVariable-1)===1000) {
            despairEnd=true;
        }
        //insanity
        else if($gameVariables.value(index+Tamamo.Params.InsanityVariable-1)===1000) {
            insanityEnd=true;
        }
        //hunger
        else if($gameVariables.value(index+Tamamo.Params.HungerVariable-1)===4) {
            hungerEnd=true;
        }
    }
    if (despairEnd) $gameSwitches.setValue(Tamamo.Params.DespairSwitch, true);
    if (insanityEnd) $gameSwitches.setValue(Tamamo.Params.InsanitySwitch, true);
    if (hungerEnd) $gameSwitches.setValue(Tamamo.Params.HungerSwitch, true);
}

//=============================================================================
// Game_Interpreter
//=============================================================================
Tamamo.ActorManager.Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand
Game_Interpreter.prototype.pluginCommand = function(command, args) {
    Tamamo.ActorManager.Game_Interpreter_pluginCommand.call(this);
    if(commmand === 'setMood')
    {
        var index = $gameParty.actors[args[0]].actorId;
        var feelinfine = true;
        var mood;
        if(index+Tamamo.Params.DespairVariable-1 >=500) mood = 6;
        else if(index+Tamamo.Params.InsanityVariable-1 >=500) mood = 7;
        else {
            mood=args[0]
        }
        $gameVariables.setValue(Tamamo.Params.MoodVariable,mood);
    }
    if(commmand === 'fillHunger')
    {
        $gameActors.actor(args[0]).gainMp($gameActors.actor(args[0]).mmp);
        var index = $gameParty.actors[args[0]].actorId;
        var shorthand = index+Tamamo.Params.InsanityVariable-1;
        if($gameVariables.value(shorthand) > 0) {
            $gameVariables.setValue(shorthand,$gameVariables.value(shorthand)-1);
        }
    }
};
Did I make a mistake?

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,454
Members
137,821
Latest member
Capterson
Top