- Joined
- Aug 1, 2016
- Messages
- 879
- Reaction score
- 566
- First Language
- English
- Primarily Uses
- RMMV
Ah, that. I should patch that in my version, too, just to avoid compatibility issues at all.The counter "patch" simply adds a if($gameSystem.srpgMode()) conditional to the SRPG_core.js rewrite of counterattacks; so basically if the game is in SRPG mode then it will use SRPG counterattacking and if the game is not in SRPG mode (aka default MV battle system) then it reverts back to normal counterattacking. It's not really important unless you want to use both battle systems
Unfortunately srpg_core.js does not have a "find event based on active unit" function so you have to make your own. This function basically finds the event that represents the battler.
<Custom Execution>
var defaultSpeed = 5;
for (var i = 0; i < $gameMap._events.length; i++) {
if ($gameSystem.EventToUnit(i) !== undefined) {
if ($gameSystem.EventToUnit(i)[1] == user) {
var userEvent = $gameMap._events[i];
break;
}
}
}
if (userEvent !== undefined) {
$userEvent._characterName = "$Soldier"; //Changes charset of unit.
$userEvent._moveSpeed = 8; //Frequency of stepping animation and movement speed; higher = faster.
user.forward(4);
$userEvent._characterName = "$Soldier"; //Changes charset of unit.
$userEvent._moveSpeed = defaultSpeed; //Frequency of stepping animation and movement speed; higher = faster.
}
</Custom Execution>
If you use $gameMap._events._characterName you can change the charaset of the character to say an charset with the user in an attacking animation. I would recommend you use the $characterName format and give all units an "attacking charset" with an _attack suffix and then set it _characterName = _characterName + "_attack". If you use the 8 characters per charset then it's a bit more complicated because you also have to get the index of the charset ($gameMap._events._characterIndex). Completely optional though.
Also, if you're using... almost any of my SRPG extensions, I add a "battler.event()" function that does exactly that, since it's so useful.