[SV] Attack Motion for each Weapon and Skill/item Attack Motion

Discussion in 'Editor Suggestions and Improvement' started by Victor Sant, Jan 30, 2016.

?

Would you like this feature?

  1. Yes

    73 vote(s)
    91.3%
  2. No

    0 vote(s)
    0.0%
  3. Yes but not important

    7 vote(s)
    8.8%
    Tags:
  1. Victor Sant

    Victor Sant Veteran Veteran

    Messages:
    1,694
    Likes Received:
    1,429
    Location:
    Brazil
    First Language:
    Portuguese
    The new SV battler are nice, but the options to customize it are rather limiting.
    I don't know how viable it is. Looking at the script side it shouldn't be so hard to implement, but it would depend on how much changes to the framework it would be needed, although I belive it woudn't be so much hard, as most of the framework already exist.


    - Assign the Attack Motion to weapons:


    To remove the very high limitation on how you can assign graphics for weapons, The idea is to allow the user to assign the graphic and motion for each weapon.


    First would be needed to add the option on the weapon window:

    Weapon1.png



    The [SV] Attack Motion would be divided into two part: a dropdown and a image selection


    The dropdown would be very similar to the one that alread exist, showing the options "None" "Thrust" "Swing" and "Missile"


    Weapon2.png



    The image selection would be very similar to the charset selection. It should also include the option to add the "$" sign the same way as it is possible to charchets, to allow the use of "single" weapon sprites.


    This would basically use the same framework as the Charset selection, so it wouldn't be hard to re-create. Also, the weapons graphics should have their own folder, since we don't want non- weapon files to be shown on the list.

    Weapons3.png



    This would add 3 new values to the Weapon data:
    - 'attackMotion' (A numeric value ranging from -1 to 2, that would be set by the "Motion" dropdown).
    - 'weaponImageName' (the name of the Weapon Graphic, would be get from the Image selection window the same way as the charset data).
    - 'weaponImageId' (the index of the Weapon Graphic, would be get from the Image selection window the same way as the charset data, with the difference that it will range from 1 to 12, with the first index being 1, since the system uses 0 for no-weapon).
     


    - Assign the Attack Motion to skills and items:


    Now this is to solve one of the major flaws from the SV system from MV. While you can set weapon motion for basic attacks, you can't do the same for skills. So, even if you have a physical skill, it will not show the weapon.


    To assign the attack motion to skills and items, A single dropdown is enough.

    Weapons4.png



    It would be similar to the 'Animation' dropdown, but instead of listing the Animations, it would list the weapons along the 'Normal Attack' and 'None' options. The 'Normal Attack' would make the skill call the current weapon motion, and None would call the default motion for the action ('guard', 'skill', 'magic' or 'item' motions, depending on the action)


    Weapons5.png


    This would add one new value to the Skill and Item data: 
    - 'attackMotion' (A numeric value ranging from -1 to the number of weapons, that would be set by the "Attack Motion" dropdown).


    Since each weapon now have it's own Attack motion, the '[SV] Attack Motion' option on the 'System' tab would be obsolete. To not leave a huge gap there, i would reorganize the windows like this:

    Weapons6.png

    This way the gap is smaller and the 'Sounds' would have more space, since it have a lot of options.


    Here is a example of the changes needed to implement on the game .js files:

    rpg_objects.js changes:



    Game_Battler.prototype.startWeaponAnimation = function(weaponImageId, weaponImageName) {
    this._weaponImageId = weaponImageId;
    // added the 'weaponImageName'
    this._weaponImageName = weaponImageName;
    };

    Game_Actor.prototype.performAction = function(action) {
    Game_Battler.prototype.performAction.call(this, action);
    // changed to call the new 'actionMotion' function, wich checks for the 'attackMotion'
    // set on the action to decide if will call default motion or weapon motion
    if (action.isAttack()) {
    this.performAttack();
    } else if (action.isGuard()) {
    this.actionMotion(action.attackMotion(), 'guard');
    } else if (action.isMagicSkill()) {
    this.actionMotion(action.attackMotion(), 'spell');
    } else if (action.isSkill()) {
    this.actionMotion(action.attackMotion(), 'skill');
    } else if (action.isItem()) {
    this.actionMotion(action.attackMotion(), 'item');
    }
    };

    Game_Actor.prototype.performAttack = function() {
    // Sice the attack motion will be also performed by skills, get the weapon ID
    // and call a new function to perform the attack
    var weapons = this.weapons();
    if (weapons[0]) {
    this.performAttackMotion(weapons[0].id);
    }
    };




    rpg_sprites.js changes:



    Sprite_Actor.prototype.setupWeaponAnimation = function() {
    if (this._actor.isWeaponAnimationRequested()) {
    // adding the weaponImageName to the setup call
    this._weaponSprite.setup(this._actor.weaponImageId(), this._actor.weaponImageName());
    this._actor.clearWeaponAnimation();
    }
    };

    Sprite_Weapon.prototype.setup = function(weaponImageId, weaponImageName) {
    this._weaponImageId = weaponImageId;
    // now each weapon have it's own image name.
    this._weaponImageName = weaponImageName;
    this._animationCount = 0;
    this._pattern = 0;
    this.loadBitmap();
    this.updateFrame();
    };

    Sprite_Weapon.prototype.loadBitmap = function() {
    // it's no longer needed to check for the 'pageId'
    if (this._weaponImageId > 0) {
    this.bitmap = ImageManager.loadWeapon(this._weaponImageName);
    this._isSingleWeapon = ImageManager.isSingleWeapon(this._weaponImageName);
    } else {
    this.bitmap = ImageManager.loadSystem('');
    }
    };

    Sprite_Weapon.prototype.updateFrame = function() {
    if (this._weaponImageId > 0) {
    var w = 96;
    var h = 64;
    // changed for the check for single weapons
    var sx = this.weaponPatternX() * w;
    var sy = this.weaponPatternY() * h;
    this.setFrame(sx, sy, w, h);
    } else {
    this.setFrame(0, 0, 0, 0);
    }
    };


    rpg_managers.js new functions:



    ImageManager.loadWeapon = function(filename, hue) {
    return this.loadBitmap('img/weapons/', filename, hue, true);
    };

    ImageManager.isSingleWeapon = function(filename) {
    return filename.charAt(0) === '$';
    };


    rpg_objects.js new functions:



    Game_Action.prototype.attackMotion = function() {
    return this.item().attackMotion;
    };

    Game_Battler.prototype.weaponImageName = function() {
    return this._weaponImageName;
    };

    Game_Actor.prototype.actionMotion = function(attackMotion, motion) {
    // check the 'attackMotion' for the skill.
    if (attackMotion > 0) {
    this.performAttackMotion(attackMotion);
    } else if (attackMotion < 0) {
    this.performAttack()
    } else {
    this.requestMotion(motion);
    }
    };

    Game_Actor.prototype.performAttackMotion = function(weaponId) {
    var weapon = $dataWeapons[weaponId]
    // get the attack motion from weapon instead of the weaponTypeId
    var attackMotion = weapon ? weapon.attackMotion : -1;
    if (attackMotion > 0) {
    if (attackMotion === 0) {
    this.requestMotion('thrust');
    } else if (attackMotion === 1) {
    this.requestMotion('swing');
    } else if (attackMotion === 2) {
    this.requestMotion('missile');
    }
    // the 'weaponImageId' and 'weaponImageName' are now set on the weapon.
    this.startWeaponAnimation(weapon.weaponImageId, weapon.weaponImageName);
    }
    };


    rpg_sprites.js new functions:



    Sprite_Weapon.prototype.weaponPatternX = function() {
    if (this._isSingleWeapon) {
    return this._pattern;
    } else {
    var index = this._weaponImageId - 1;
    return (Math.floor(index / 6) * 3 + this._pattern);
    }
    };

    Sprite_Weapon.prototype.weaponPatternY = function() {
    if (this._isSingleWeapon) {
    return 0;
    } else {
    var index = this._weaponImageId - 1;
    return Math.floor(index % 6);
    }
    };

    This code is fully working with the changes suggested (I tested them by adding the new values directly on the .json files on the data folder), so all it would be needed is to make the editor assign them to the weapons, skills and items.



    I really hope that this change is not dismissed, as it would greatly improve the new sideview feature.
    As it presented, there is no reason to not implement it other than "Kadokawa didn't allow us to make this change", wich would be sad, but nothing can be done about that.
     
    Last edited by a moderator: Jan 31, 2016
    #1
    Shake0615, Dodo_Down, vico and 11 others like this.
  2. StarWarrior00

    StarWarrior00 ~ King of Cuteness ~ Veteran

    Messages:
    769
    Likes Received:
    88
    Location:
    Shreveport, LA, United States
    First Language:
    English (US)
    Primarily Uses:
    N/A
    I support this idea of a feature over 9000 (!!!!!) percent.
     
    #2
    Jeysonmcfly likes this.
  3. Makeratore

    Makeratore Veteran Veteran

    Messages:
    187
    Likes Received:
    51
    Location:
    Rome, Italy
    First Language:
    Italian
    Very nice suggestion!!! I want it! :D
     
    #3
  4. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,522
    Likes Received:
    14,150
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    This should be doable and I agree with it since it's something Rm2k3 did as well. But I hope we will be able to implement it later after all issues are sorted. I'm unsure if we have enough time to do it, hopefully we do though!
     
    Last edited by a moderator: Jan 31, 2016
    #4
  5. Victor Sant

    Victor Sant Veteran Veteran

    Messages:
    1,694
    Likes Received:
    1,429
    Location:
    Brazil
    First Language:
    Portuguese
    I'm glad to know that. If there is anything I can help feel free to ask. As someone that really like to customize battles, this is something I'm really hoping to see done.
     
    #5
  6. Vendon

    Vendon LVL 255 Veteran

    Messages:
    103
    Likes Received:
    21
    Location:
    Germany
    First Language:
    German, English
    This one is highly needed and also an extra selection for (Sword - Move to enemy) and for (Bow - Stay still and shoot). I am always extremely stressed because MV does not have that feature. Even plugins etc. are not working like I would like to because Attack is the only skill which is used for normal attack. So a sword will do the same animation like a gun will do if you put a code into the notebox. So it will looks like that. Player moves close to the enemy and shoots their arrows at the enemy but I do not want that to happen for normal attack. We rlly need a much better way to choose in the editor without using codes for easier access to do our skills,weapons etc.

    This combined with Victor Sant's idea would be gold
     
    #6
  7. SOC

    SOC "God is my Judge" Veteran

    Messages:
    552
    Likes Received:
    470
    Location:
    KY, USA
    First Language:
    English
    Primarily Uses:
    RMMV
    So any updates on this?
     
    #7
  8. Krystek_My

    Krystek_My Veteran Veteran

    Messages:
    162
    Likes Received:
    38
    First Language:
    Polish
    Primarily Uses:
    RMMV
    Hi. How to make this work? And can I add custom motions like "Slash" or "Stab" for example?
     
    #8
  9. Brett_Aldrich

    Brett_Aldrich Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Too bad this never got implemented. Would have been very very useful.
     
    #9
  10. eluukkanen

    eluukkanen Composer Veteran

    Messages:
    259
    Likes Received:
    166
    Location:
    Finland
    First Language:
    Finnish
    Primarily Uses:
    N/A
    This feature would be very neat
     
    #10

Share This Page