I'm having a bug with the script WeaponOverActor

● ARCHIVED · READ-ONLY
Started by SushiAssado 5 posts View original ↗
  1. @LadyBaskerville when I activate this script and I do not have any equipped weapons and enter into battle, this error appears "can not read property 'meta' of null" ,but when I'm equipped with a weapon nothing happens, sSorry for the inconvenience, I do not want to be boring. ;c
  2. @LadyBaskerville asked for screenshots showing how you set up the actors and their equipment, as she needs to know that to confirm if her suspicions are correct. Unfortunately the screenshot you provided is of very little use. If you get that error, press F8 to open the developer tools, go to the Console tab, and grab a screenshot of that, which us much more useful. But also provide the actor/equipment info.

    I'd also be interested to know if you've set up your party members correctly - if you don't want all 4 actors in the starting party, did you delete them from the System tab (which is the correct way) or from the Actors tab (which is the incorrect way that a lot of people mistakenly do, as you then have "empty" party members).
  3. Shaz said:
    @LadyBaskerville asked for screenshots showing how you set up the actors and their equipment, as she needs to know that to confirm if her suspicions are correct. Unfortunately the screenshot you provided is of very little use. If you get that error, press F8 to open the developer tools, go to the Console tab, and grab a screenshot of that, which us much more useful. But also provide the actor/equipment info.

    I'd also be interested to know if you've set up your party members correctly - if you don't want all 4 actors in the starting party, did you delete them from the System tab (which is the correct way) or from the Actors tab (which is the incorrect way that a lot of people mistakenly do, as you then have "empty" party members).
    I did not know about the console, here is f12 :c
  4. I couldn't test it yet, but try replacing the plugin's content with this:

    Code:
    /*:
     * @plugindesc For sideview battle, change the order in which weapon and actor are drawn.
     * @author LadyBaskerville
     *
     * @help
     * Use the notetag <Weapon Over Actor> in the actor or weapon notebox
     * to draw the weapon image on top of the actor image.
     * Might not work when changing weapons during battle.
     *
     * Free for use in both non-commercial and commercial games.
     * No credit required.
     * Edits and reposts allowed.
     */
    
    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] && $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);
        }
    };

    I only added a check whether the actor has a weapon equipped in the first play before trying to access the notetag of the equipped weapon; hopefully that was everything that was wrong. If you still get an error, please post a screenshot of the console with again with the new error.
  5. LadyBaskerville said:
    I couldn't test it yet, but try replacing the plugin's content with this:

    Code:
    /*:
     * @plugindesc For sideview battle, change the order in which weapon and actor are drawn.
     * @author LadyBaskerville
     *
     * @help
     * Use the notetag <Weapon Over Actor> in the actor or weapon notebox
     * to draw the weapon image on top of the actor image.
     * Might not work when changing weapons during battle.
     *
     * Free for use in both non-commercial and commercial games.
     * No credit required.
     * Edits and reposts allowed.
     */
    
    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] && $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);
        }
    };

    I only added a check whether the actor has a weapon equipped in the first play before trying to access the notetag of the equipped weapon; hopefully that was everything that was wrong. If you still get an error, please post a screenshot of the console with again with the new error.

    Worked perfectly C: thank you very much, sorry for the way I did the post, it's my first time here