Change weapon layer during SV combat

● ARCHIVED · READ-ONLY
Started by Mander 6 posts View original ↗
  1. I was told a plugin will be the only solution to this so here I am a mere peasant making humble requests to the acolytes of the javascript gods.

    The issue I have is that there is no option to load weapons as the top layer during combat leaving us with silly looking weapon situations like this one

    example.png

    We have the lame, I'd like the cool. If any of you wizards or keyboard witch doctors think you could conjure up a solution, myself and I'm sure many others would appreciate it.

    and as always, have a nice day.
  2. If you always want the weapon to appear on top of the actor image, it's simple (just swapping two lines in the code). Add this in a .js file as a new plugin:
    Code:
    Sprite_Actor.prototype.initMembers = function() {
        Sprite_Battler.prototype.initMembers.call(this);
        this._battlerName = '';
        this._motion = null;
        this._motionCount = 0;
        this._pattern = 0;
        this.createShadowSprite();
        this.createMainSprite();
        this.createWeaponSprite();
        this.createStateSprite();
    };

    Let me know if that works for you. If you want to specify the order for each actor or weapon, it would be slightly more complicated, but also possible.
  3. Brilliant, thank you so very much. I can make it work with all things in front but if you're capable of making it be specified I don't think I can resist asking you to go the extra mile. being able to specify would open up the possibilities for far more interesting weapon sets.
  4. Here you are:
    Code:
    Sprite_Actor.prototype.initMembers = function() {
        Sprite_Battler.prototype.initMembers.call(this);
        this._battlerName = '';
        this._motion = null;
        this._motionCount = 0;
        this._pattern = 0;
        this.createSprites();
    };
    
    Sprite_Actor.prototype.createSprites = function() {
        this.createShadowSprite();
        if (this._actor && ($dataActors[this._actor._actorId].meta["Weapon Over Actor"] ||
                            $dataWeapons[this._actor._equips[0]._itemId].meta["Weapon Over Actor"])) {
            this.createMainSprite();
            this.createWeaponSprite();
        } else {
            this.createWeaponSprite();
            this.createMainSprite();
        }
        this.createStateSprite();
    };
    
    Sprite_Actor.prototype.setBattler = function(battler) {
        Sprite_Battler.prototype.setBattler.call(this, battler);
        var changed = (battler !== this._actor);
        if (changed) {
            this._actor = battler;
            if (battler) {
                this.setActorHome(battler.index());
            }
            this.createSprites();
            this.startEntryMotion();
            this._stateSprite.setup(battler);
        }
    };

    Use the Notetag <Weapon Over Actor> on an actor or weapon to display the weapon above the character. (If either actor or weapon has the tag, the weapon will be drawn over the actor graphic.)

    However, the order might not get updated if you allow the player to change weapons during battle. I might work on that when I have a bit more time, but I can't promise anything right now ;)
  5. This is an absolutely wonderfull plugin. You should be very proud. For the part of the community using custom sprites and battlers like I am it is a huge step in the right direction.

    I was planning on posting any animations I made as free resources. I will point anyone interested in using them straight to your plugin
  6. That's cool! I'm looking forward to your creations!
    I should really make a thread in Plugin Releases to collect all those snippets ...
    I should probably also add Terms of Use:
    - Free to use in both commercial and non-commercial projects
    - Credit to LadyBaskerville is optional
    - Basically, do whatever you want with it ;)