Custom RMMV Battler Sprites Assistance

masterschief

Warper
Member
Joined
Jan 2, 2019
Messages
2
Reaction score
0
First Language
english
Primarily Uses
RMMV
Hello all. I'm using custom sprites in my game and my main issue I'm running into is that I'd like to use different sprites for each weapon the player equips. The problem is, I can't find a plugin that supports that.

Currently, I am using VE (Victor Engine)'s Battler Graphic Setup for more detailed battler sprites, but I'm still limited to the 13 default sprite animations. Is there a plugin that exists that allows me to go beyond the default side view sprite animation count for custom attack animations?

In the image attached the sprite has the weapon the player can equip in game. And I'd like a different sprite for when the player doesn't have that specific gun.
 

Attachments

Sharq

Villager
Member
Joined
Jan 14, 2018
Messages
9
Reaction score
0
First Language
English
Primarily Uses
RMMV
I just finished a plugin that should help you out. Here it is:

Code:
//=============================================================================
// Sharq Plugins - Change sv_actor on weapon equip
// SHARQ_change_sc_actor_on_equip.js
//=============================================================================


//=============================================================================
 /*:
 * @plugindesc This plugin allows you to automatically change an actor's
 * sv_actor image when they equip a weapon.
 * @author Sharq
 *
 * @help
 * ============================================================================
 * Description
 * ============================================================================
 *
 * This plugin will change the 'sv_actor' image tied to an actor
 * anytime they equip a weapon according to the ID of the weapon.
 *
 * The weapon's ID is found in your database.
 *
 * Simply name an 'sv_actor' file the ID of the weapon.
 *
 * Example: You just created a weapon called 'Iron Sword' and it has ID 26 in
 * the database. Create an 'sv_actor' image in '/img/sv_actors' called 26.png.
 * Anytime an actor equips that weapon, their entire 'sv_actor' sheet will
 * change to 26.png.
 */
//=============================================================================
 


Game_Actor.prototype.changeEquip = function(slotId, item) {


    // console.log("before "+$gameActors._data[1]._battlerName)
    // console.log("item.id = " + item.id)
    // console.log("setting new sv to "+item.id.toString())
    $gameActors._data[1]._battlerName = item.id.toString()
    // console.log("after "+$gameActors._data[1]._battlerName)

    //console.log("item.id = " + item.id)//
    if (this.tradeItemWithParty(item, this.equips()[slotId]) &&
            (!item || this.equipSlots()[slotId] === item.etypeId)) {
        this._equips[slotId].setObject(item);
        this.refresh();
    }
};

// var obj = JSON.parse(yourObject);
// console.log(obj);

// exampleObj = {'a':1,'b':2,'c':3};
// console.log(JSON.stringify(exampleObj));


Game_Actor.prototype.changeEquipById = function(etypeId, itemId) {


    // console.log("before "+$gameActors._data[1]._battlerName)
    // console.log("itemId = " + itemId)
    // console.log("setting new sv to "+itemId.toString())
    $gameActors._data[1]._battlerName = itemId.toString()
    // console.log("after "+$gameActors._data[1]._battlerName)
 
    var slotId = etypeId - 1;
    if (this.equipSlots()[slotId] === 1) {
        this.changeEquip(slotId, $dataWeapons[itemId]);
    } else {
        this.changeEquip(slotId, $dataArmors[itemId]);
    }
};
This plugin is really only suitable for changing one actor's image, since it changes the entire sv_actor sheet, you cannot use it for 2 different actors.
 
Last edited:

masterschief

Warper
Member
Joined
Jan 2, 2019
Messages
2
Reaction score
0
First Language
english
Primarily Uses
RMMV
I just finished a plugin that should help you out. Here it is:

Code:
//=============================================================================
// Sharq Plugins - Change sv_actor on weapon equip
// SHARQ_change_sc_actor_on_equip.js
//=============================================================================


//=============================================================================
 /*:
 * @plugindesc This plugin allows you to automatically change an actor's
 * sv_actor image when they equip a weapon.
 * @author Sharq
 *
 * @help
 * ============================================================================
 * Description
 * ============================================================================
 *
 * This plugin will change the 'sv_actor' image tied to an actor
 * anytime they equip a weapon according to the ID of the weapon.
 *
 * The weapon's ID is found in your database.
 *
 * Simply name an 'sv_actor' file the ID of the weapon.
 *
 * Example: You just created a weapon called 'Iron Sword' and it has ID 26 in
 * the database. Create an 'sv_actor' image in '/img/sv_actors' called 26.png.
 * Anytime an actor equips that weapon, their entire 'sv_actor' sheet will
 * change to 26.png.
 */
//=============================================================================
 


Game_Actor.prototype.changeEquip = function(slotId, item) {


    // console.log("before "+$gameActors._data[1]._battlerName)
    // console.log("item.id = " + item.id)
    // console.log("setting new sv to "+item.id.toString())
    $gameActors._data[1]._battlerName = item.id.toString()
    // console.log("after "+$gameActors._data[1]._battlerName)

    //console.log("item.id = " + item.id)//
    if (this.tradeItemWithParty(item, this.equips()[slotId]) &&
            (!item || this.equipSlots()[slotId] === item.etypeId)) {
        this._equips[slotId].setObject(item);
        this.refresh();
    }
};

// var obj = JSON.parse(yourObject);
// console.log(obj);

// exampleObj = {'a':1,'b':2,'c':3};
// console.log(JSON.stringify(exampleObj));


Game_Actor.prototype.changeEquipById = function(etypeId, itemId) {


    // console.log("before "+$gameActors._data[1]._battlerName)
    // console.log("itemId = " + itemId)
    // console.log("setting new sv to "+itemId.toString())
    $gameActors._data[1]._battlerName = itemId.toString()
    // console.log("after "+$gameActors._data[1]._battlerName)
 
    var slotId = etypeId - 1;
    if (this.equipSlots()[slotId] === 1) {
        this.changeEquip(slotId, $dataWeapons[itemId]);
    } else {
        this.changeEquip(slotId, $dataArmors[itemId]);
    }
};
This plugin is really only suitable for changing one actor's image, since it changes the entire sv_actor sheet, you cannot use it for 2 different actors.
My man. Will give this a try and let you know how it works. :- )
 

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

Latest Threads

Latest Posts

Latest Profile Posts

"You can thank my later", "But you haven't done anything", "Well, that's why ..."
Are we allowed to post about non-RPG Maker games?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

Forum statistics

Threads
105,884
Messages
1,017,242
Members
137,609
Latest member
shododdydoddy
Top