Let's start from beginning.
I made a character that uses a rifle in battle, and he's equipped with gun. Skills using gun works fine and there are no problems.
However the problem starts with default Attack Command, because it looks silly when you attack enemy with rifle from really close position (like mafia in '20s dealed with traitors etc). So to make my project look more reliable I had few options to workaround that
problem... All failed...
Last option I came up is to Disable Attack command whenever actor is equipped with ranged weapon (gun, bow, longbow, slingshot etc). And I wrote that code, however it had a major bug. In team there are 8 heroes, and that code disabled Attack Command for all members. I need that Attack is disabled for actor(s) wielding a ranged weapons.
Or... perhaps you have another idea how to make ranged hero with default attack command using meelee weapon (sword, knife etc) and ranged skill that will show ranged weapon (gun, bow, longbow, slingshot etc) when using skill?
Disable default Attack Command with specific condition.
● ARCHIVED · READ-ONLY
-
-
For that, Victor Sant has VE_CommandReplace and VE_DirectCommands.
https://victorenginescripts.wordpress.com/rpg-maker-mv/
You can also use Yanfly's Action Sequences pack 2 to change how the animation for the rifle looks.
http://yanfly.moe/yep/
EDIT: You need to make a weapon with skill to replace the 'Attack' command. In my case, the protagonist can equip two type of weapons 'melee' and 'ranged' at the same time. (Like in Shin Megami Tensei Series) Equips Sword will replace 'Attack' with 'Sword'. Equips Bow will replace 'Stone Throw' with 'Bow'. (Stone Throw is a direct skill. I assigned this skill to the protagonist in the actor's notebox. That means. If i don't equips Bow, the protagonist can only Throw Stone which is much weaker than arrow shot from Bow.) -
Better option would be with Yanfly's sequence pack, since Victors scripts are in confilct with Yanfly's.
So tell me, how to change weapon look with Yanfly's Action Sequence Pack? -
This is animation for Rifle(ranged attack). Put this in the skill notebox.
<Target Action>
motion MISSILE: user
action animation
wait for animation
action effect
</Target Action>
Change how the weapon look? Do you mean turn the rifle into spear? -
Yes. My hero is dual wielding. In one hand (slot) have knife. Second slot contains riffle. What I want, when I attack with default command I see a knife, and when I use skill for rifle, I see a riffle
-
Er... This is much tricky than i thought. Maybe this?
https://forums.rpgmakerweb.com/index.php?threads/dual-weapon-in-action-sequence.90196/
EDIT: I have never used MV battler before. I draw the weapon in the battler sprite sheet itself. (if the actor equipped Hand gun. his/her sprite sheet will change to the one with handgun) -
@Thothdan, that wouldn't help much, but thanks anyway.
-
Pardon my mistake. I thought i can help, since i have the same problem before.
But i totally forgot that my game has large custom battlers which is not using the weapons animations. m(_ _)m -
Maybe this would help to visualize my problem, since my english became more rusty...
-
It might be a bit of work to set up but I think you could use (one of) Yanfly's action sequence plugins to call an event prior to the attack to check what type of weapon your actor has in his first slot similar toCode:
user.equips[1].id
Replacing "id" with the correct term for equipment type (if the term exists). If the type matches the skill then nothing happens. If the type doesn't match you could run a script to swap the first and second equipment slots - I assume by assigning the ID's to a variable then posting those values to the opposing equipment slot - then turn on a switch to say that this has been executed. After the attack has happened then run another common event to check if the equipment has been swapped by the first event (using the switch), and if it has do another equipment slot swap and turn off the switch.
I'll admit I don't have the scripting knowledge to execute this myself but I've seen you post a few times and you seem to know what you're doing so hopefully you can figure out my bumbling. I'll also admit I haven't used any of Yanfly's action sequence plugins, but I think sequence 1 might be able to do this.
This is roughly how I think the scripts would be. I've assumed that I need to replace "id" with "type" to check for the items type and that item type 1 is "knife" and item type 2 is "rifle". This would be for a rifle skill.
Common Event 1Code:if (user.equips[1].type != 2) { $gameVariables.setValue(1,user.equips[1].id); $gameVariables.setValue(2,user.equips[2].id); user.equips[1].id = $gameVariables.Value(2); user.equips[2].id = $gameVariables.Value(1); $gameSwitches.setValue(1,true); }
Common Event 2Code:if ($gameSwitches.Value(1) == true) { user.equips[1].id = $gameVariables.Value(1); user.equips[2].id = $gameVariables.Value(2); $gameSwitches.setValue(1,false); } -
thank you all, but I got finally better solution.
YEP_WeaponAnimation. I made skill that gives "state unlocking rifle skills, seal attack and in its state in notetags I simply replace weapon animation.
Odd solution, but works