i guess it doesnt work because:
battler.srpgMove()
the damage formula has no idea who "battler" is..
"a" is active battler/attacker
"b" is passive battler/defender.
instead of "
battler.srpgMove()" try
"a.srpgMove()"
(only in damage formula)
Also if you want to keep it short in the damage formula, put the scripts in a $gamevariable:
"v1" means "$gameVariables.value(1)"
in damage formula
in a $gamevariable you probably want to use this :
JavaScript:
$gameSystem.EventToUnit($gameTemp.activeEvent().eventId())[1].srpgMove() - $gameTemp.activeUnitMoveRemain();
// in the script part of $gamevariable ..
For more detailled infos on damage formula, pls visit:
(i am no expert on this and its not really "srpg related only")
Please note: A discussion has already been started about different things you can do with these formulas so please direct those comments and question to the appropriate thread. https://forums.rpgmakerweb.com/index.php?threads/rmmv-damage-formula-ideas-and-help.47099/ A link to the list of...
forums.rpgmakerweb.com
-------------------------------------------------
@
Brother_Fox
i dont know which demo&plugins you use ect.However
1-
the issue that it gives no exp is because exp is related to Action usage..
but there are ways to add exp with script..so it should be possible to work around this issue..
the most simple would be to give this skill usage more exp by default.. i think shoukang made a plugin to give different exp-output to diefferent skill usage
2-
the issue "units dont disappear" only happens when the unit dies at the wrong timing.. without battle action..
in such case you can use a script that deletes the event if related battler is deathStateAffected but event is not erased
(and i am sure that this Issue was allready solved in this thread)
- a SRPG_UnitGroups script could be helpfull to check all battlers on map and delete events ect..
3-
the issue "the live/dead count dont change" is probably the same reason as above. In such case you could use the same UnitGroups script and add a variable change
to the variable that stores this "count"
edited code from SRPG_UnitGroups: (to solve 2&3)
Fix "if Units dont Die on Poison ect" by adding this to after action
(in a plugin that would be "SceneMap.prototype.afterAction")
Spoiler
JavaScript:
// If Units dont die próperly on poison ect , put this in the "after action"
for (var i = 1; i <= $gameMap.events().length; i++) {
var battleunit = $gameSystem.EventToUnit([i]);
var eventunit = $gameMap.event([i]);
if (battleunit && eventunit && (battleunit[0] === 'actor')) {
if ((battleunit[1].isDeathStateAffected()) && (!eventunit._erased)) {
battleunit[1].setActionTiming(-1);
battleunit[1].performCollapse();
$gameMap.eraseEvent([i]);
var oldValue = $gameVariables.value(1);
$gameVariables.setValue(1, oldValue - 1);
}
}
if (battleunit && eventunit && (battleunit[0] === 'enemy')) {
if ((battleunit[1].isDeathStateAffected()) && (!eventunit._erased)) {
battleunit[1].setActionTiming(-1);
battleunit[1].performCollapse();
$gameMap.eraseEvent([i]);
var oldValue = $gameVariables.value(2);
$gameVariables.setValue(2, oldValue - 1);
}
}
};
The code asks all Units if they are actors/enemys if they are deathState affected & if their event is erased, than it erases events and changes variable values
This code above assumes that :
actor count var is id 1
enemy count var is id 2
I am pretty sure this needs to be added to "after action" .
EDIT
i researched a bit, and edited the code above, fixed a mistake and added some more things which are used in normal battleActions aswell, .. i will add the same Fix to my edited srpg_core
edit2
some more fixes on code cose of typo mistakes and now its tested ^^