- Joined
- Sep 7, 2018
- Messages
- 50
- Reaction score
- 10
- First Language
- English
- Primarily Uses
- RMMV
ok sooo ive been looking around to more or less no avail no one seems to of bothered making this or at least posting it for use at least i didnt find any. So im trying to replicate the tame/charm function from Final Fanatasy 11 where you use a skill "Tame" on a monster and have it fight along side the player for that battle.
I have got somewhat functional but it has to have a diffrent command for eahc and every tamable monster. I "tryed" lol being key word tryed to make it so any enemy defined in the parameters could be tamed and done the same and let the plugin handle the work fully instead of passing plugin commands to change the enemy and its image which just isnt a good way when theres around 30 tamable enemies lol.
My issue is i cant get this to pass the parameters to the plugin manager in Maker MV to allow adding and removing of enemy IDs that would then allow them to be tamed or not tamed depending on if there listed in this list or not
is what i got the above code did work till i started trying to pass it through the parameters in the Plugin Manager with in Maker MV. before i had it as Plugin Command: <enemyID> <image>
but as stated this wasnt a good way to handle a large amount of tamable monsters atleast not to me now its set up to just use
tameMonster($gameTroop.members()[targetIndex()]) as a plugin command to pass the argument to the function of the plugin which then if i can figure out what i did wrong xD if someone be kind enough should then go by the parameters of the plugin
i dont care if other use it if/when its functioning correctly just give creddit
the above code before i broke it with the parameters lol. does remove the monster the tame skill is used on and then flips the image of the tamed monster so its showing in the proper direction and then adds the monster as a temp member to the party and then sets it to row 1 (im using yanfly party manager and row formation) it then runs its normal skill list. The above also handles the fact tis a still image being added and not a spritesheet so no other plugin would of been needed aswell
I have got somewhat functional but it has to have a diffrent command for eahc and every tamable monster. I "tryed" lol being key word tryed to make it so any enemy defined in the parameters could be tamed and done the same and let the plugin handle the work fully instead of passing plugin commands to change the enemy and its image which just isnt a good way when theres around 30 tamable enemies lol.
My issue is i cant get this to pass the parameters to the plugin manager in Maker MV to allow adding and removing of enemy IDs that would then allow them to be tamed or not tamed depending on if there listed in this list or not
(function() {
// Plugin Parameters
var parameters = PluginManager.parameters('TamableMonstersPlugin');
var tamableMonsters = JSON.parse(parameters['Tamable Monsters']);
// Game_Enemy Modifications
Game_Enemy.prototype.isTameable = function() {
var enemyId = this.enemyId();
return tamableMonsters[enemyId] !== undefined;
};
// Game_Action Modifications
Game_Action.prototype.applyTame = function(target) {
var enemyId = target.enemyId();
var image = tamableMonsters[enemyId];
if (image) {
var actor = new Game_Actor(target.enemyId());
actor.setBattlerImage(image);
$gameParty.addActor(actor.actorId());
$gameTroop.removeEnemy(target.index());
} else {
$gameMessage.add("This monster cannot be tamed.");
}
};
// Plugin Command Modifications
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
_Game_Interpreter_pluginCommand.call(this, command, args);
if (command === 'Tame') {
var enemyId = parseInt(args[0]);
var image = args[1];
var target = $gameTroop.members()[enemyId - 1];
if (target) {
this.subject().addAction(new Game_Action(this.subject(), true));
this.subject().currentAction().setTame(enemyId, image);
}
}
};
// Tame Monster Function
function tameMonster(enemyId, battlerImage) {
var monster = $dataEnemies[enemyId];
// Check if the monster is tamable
if (monster.isTameable) {
// Create a new Game_Actor instance for the tamed monster
var tamedMonster = new Game_Actor(monster.actorId);
// Set the static battler image
var image = 'img/sv_actors/' + battlerImage + '.png';
tamedMonster.setBattlerImage(image, true); // Flip the image horizontally
// Add the tamed monster to the temporary party in row 1
$gameTemp.pushTempActor(tamedMonster.actorId(), 0); // 0 represents row 1
// Refresh the party to update the member list and formations
$gameParty.refresh();
} else {
$gameMessage.add('This is not a Tamable Monster');
}
}
})();
is what i got the above code did work till i started trying to pass it through the parameters in the Plugin Manager with in Maker MV. before i had it as Plugin Command: <enemyID> <image>
but as stated this wasnt a good way to handle a large amount of tamable monsters atleast not to me now its set up to just use
tameMonster($gameTroop.members()[targetIndex()]) as a plugin command to pass the argument to the function of the plugin which then if i can figure out what i did wrong xD if someone be kind enough should then go by the parameters of the plugin
i dont care if other use it if/when its functioning correctly just give creddit
the above code before i broke it with the parameters lol. does remove the monster the tame skill is used on and then flips the image of the tamed monster so its showing in the proper direction and then adds the monster as a temp member to the party and then sets it to row 1 (im using yanfly party manager and row formation) it then runs its normal skill list. The above also handles the fact tis a still image being added and not a spritesheet so no other plugin would of been needed aswell
Last edited: