I'm trying to understand, but much of this is going over my head.
I've tried copying your examples, but I'm not seeing anything happen in game.
What I've done is put this into a new plugin which sits below yours in the load order.
@template T
@typedef {((
this: ModifierDefinition,
t: number,
character: Game_CharacterBase,
) => T) & { [CONSTANT]?: T }} Varying
TS_Dynamic_Characters.parameters.modifierDefinitions.push(new TS_Dynamic_Characters.ModifierDefinition({
name: 'bob-and-sway',
bushDepth: 25, // This (by default) also turns on bush display for tile Events.
anchorY: 50, // To rotate around the (vertical) centre, not the bottom.
yOffsetVertical: function (t, { x, y }) {
return -3 * t * Math.sin(phase(x, y) + Graphics.frameCount / 20);
},
angle: (t, { x, y }) => 5 * t * Math.sin(phase(x, y) + Graphics.frameCount / 15),
}));
I've kept the name for testing purposes and changed my character rule to look for bob-and-sway.
I'm not sure where I'm going wrong.
Thanks for all the help, and wishing you well.
