Hello Forum,
bloody Javascript MV Plugin Noob here.
Basically im working on my first plugin fitted for only my game.
My goal:
Whenever a Party formation within the Game Menu occurs, change Variable 41 to Party Leader's Actor ID.
I copied the function of the Scene_Menu, when the formation function is applied.
I aliased it to "check_if_formation_change" in order to avoid overriding the original and set PluginManager.parameters
to add my Plugin to the game.
Then I simply added $gameVariables._data[41] = $gameParty._actors[0]; in the condition for
when party formation change is initiated.
I also of course added the plugin to the Plugins in MV.
But when I check the Variable 41 ingame, after a party formation change, it remains undefined, therefore it didn't work.
I appreciate anybody who goes through the first troubles of a bloody js noob.
Thank you in advance!
My plugin so far:
(function() {
var parameters = PluginManager.parameters('SetFormationChangeToVar');
check_if_formation_change = Scene_Menu.prototype.onFormationOk;
Scene_Menu.prototype.onFormationOk = function() {
var index = this._statusWindow.index();
var actor = $gameParty.members()[index];
var pendingIndex = this._statusWindow.pendingIndex();
if (pendingIndex >= 0) {
$gameParty.swapOrder(index, pendingIndex);
this._statusWindow.setPendingIndex(-1);
this._statusWindow.redrawItem(index);
$gameVariables._data[41] = $gameParty._actors[0];
} else {
this._statusWindow.setPendingIndex(index);
}
this._statusWindow.activate();
};
})
bloody Javascript MV Plugin Noob here.
Basically im working on my first plugin fitted for only my game.
My goal:
Whenever a Party formation within the Game Menu occurs, change Variable 41 to Party Leader's Actor ID.
I copied the function of the Scene_Menu, when the formation function is applied.
I aliased it to "check_if_formation_change" in order to avoid overriding the original and set PluginManager.parameters
to add my Plugin to the game.
Then I simply added $gameVariables._data[41] = $gameParty._actors[0]; in the condition for
when party formation change is initiated.
I also of course added the plugin to the Plugins in MV.
But when I check the Variable 41 ingame, after a party formation change, it remains undefined, therefore it didn't work.
I appreciate anybody who goes through the first troubles of a bloody js noob.
Thank you in advance!
My plugin so far:
(function() {
var parameters = PluginManager.parameters('SetFormationChangeToVar');
check_if_formation_change = Scene_Menu.prototype.onFormationOk;
Scene_Menu.prototype.onFormationOk = function() {
var index = this._statusWindow.index();
var actor = $gameParty.members()[index];
var pendingIndex = this._statusWindow.pendingIndex();
if (pendingIndex >= 0) {
$gameParty.swapOrder(index, pendingIndex);
this._statusWindow.setPendingIndex(-1);
this._statusWindow.redrawItem(index);
$gameVariables._data[41] = $gameParty._actors[0];
} else {
this._statusWindow.setPendingIndex(index);
}
this._statusWindow.activate();
};
})

