Trying to make a morality system script

I am trying to make a script that allows me to change the nickname based on a morality system that is based upon the game variable #0001. I did not add a string parameter for bad, because it is not working with the good string parameter either. I am not experienced with plugin making so any help would be appreciated.

/*:

* @plugindesc This is a morality system plugin.

*

* @author Mnis101

*

*@param good

*@desc displays when good

*@default good

*

* @help make morality var 1 and add or subtract this variable depending on the situation.

*This will change your nickname to one of the parameters.

*/

 

var parameters = PluginManager.parameters('morality');

var good = String(parameter['good']);

 

if (!!$dataSystem.variables[1]){

    if (!!$dataSystem.variables[1].value > 0){

    $gameActors.actor(1).setNickname(var good);

    }

};
You don't use $dataSystem. You use $gameVariables.


$dataSystem.variables simply has a list of variable names as you assigned them in the editor. $gameVariables has the values of those variables for the current game.


Use $gameVariables.value(1)


I'm not sure what your !! is for either. If it has not been populated, it will be 0.

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-make-a-morality-system-script.54631/