Good to hear it works with the core scripts, at least!
😂
I guess VisuStella reorganises anim stuff. Is it only the casting animation that's affected, or the first animation per action? Odd that it works out like that, since in the core scripts these timing methods are called once per frame, per animation (
update ->
updateMain)...all in series, no complicated async or anything.
It may be worth testing with different casting animations, just to make sure it's not related to e.g. the frame when the SE is played.
👋
For testing, you could add a message to e.g.
varySe:
JavaScript:
const varySe = function(o) {
const r = Object.assign({}, o); // avoid mutating original data
console.log("Varying SE params for " + r.name + "."); // debug
This will log a message to the Console tab of the dev tools window (F8 or F12 during playtest) whenever the function hits that line.
If you want to randomise the SE that is played, that should be pretty simple: just change
r.name in the
varySe function before returning it. The harder part (as usual) would be design: how would the game know which name to use? Perhaps a lookup table, e.g.
Spoiler: name replacement idea
JavaScript:
/** random name replacements for specific SEs */
const NAMES = {
Hit1: ["Hit1", "Hit2", "Hit3"],
Heal1: ["Heal1", "Heal2"]
// etc
};
const varySe = function(o) {
const r = Object.assign({}, o);
const a = NAMES[r.name];
if (a)
r.name = a[Math.randomInt(a.length)];
// then the rest as usual
(Randomness in the
timing would be more challenging: you'd probably want to change the plugin structure for that.)
My code probably makes this look more awkward than it actually is, since I've taken a roundabout route to avoid a direct override. A simpler, direct override like
@bass2yang's might be a better option if you want to try to ensure this part plays out as intended...though if it does work, it might break related features from other plugin(s). The other method is
Sprite_AnimationMV.prototype.processTimingData, found in rmmz_sprites.js.