Ver. 1.3.3 Modifiers (and more)


This is a highly encouraged(šŸ˜‰) feature update.

Features:

  • Rules and (for Events) marker Plugin Commands can now control Character modifiers, which can transition opacity, transform (scale, skew, angle, offset), tint, fade and blend mode over a number of frames according to a CSS timing function.

    This is automated to avoid discontinuities, so transitions can reverse partway through iff whether a modifier should be active changes. Additionally, Events can force modifiers to fully fade in or out once, skip current transitions one-way or completely and can wait for any set of modifiers to settle on any set of Characters.

    (Associated classes, functions and other properties have been added to the JavaScript API.)

  • Rules and conditions now have a sub-parameter to enter region IDs.

  • Added Event Page attributes (Commands prefixed with !) to statically apply tags and/or margins and to follow an Actor’s appearance (equipment, status, preset tags) automatically.

  • Added ā€œPersist Event tags on Maps:ā€ parameter to control where Event tags are persisted. This now defaults to none! Use an empty list or remove the value to get the previous behaviour of always persisting Event tags. (Use the areEventTagsPersistentOnMap function added to the API for more fine-grained control.)

  • Added parameters to optionally control (initial) Bitmap smoothing.

  • Added ā€œtilesets:ā€ parameter to rules and conditions, which allows you to match on specific tilesets only, for example to reuse terrain tags.

  • Added new ā€œTarget Groupsā€¦ā€ plugin parameter. With this parameter, you can easily maintain shared target lists across multiple rules.

Revisions:

  • Slightly optimised layer Z-sort.

  • The ā€œTargets:ā€ parameter now defaults to ["REQUIRED"] as reminder to not forget it. (Only when creating a new rule in the plugin settings.)

  • JSDoc formatting.

  • Help text clarifications.

  • Grouped ā€œ- MV Plugin Commands -ā€ Parameters under that heading, to make them easy to minimise when you don’t need them.

  • If a target is specified multiple times for a rule, that rule will still be evaluated only once for that target.

Known issues:

  • While rotating a Character, the Balloon position can shift slightly due to asymmetrical margins (like the default ones for non-tile Characters).

    As a workaround, you could add a transparent row of pixels below those characters’ feet and shift them down by one pixel unconditionally in-game (ā€œY-Offset (vertical):ā€ = 1), which allows you to use symmetric margins. (Ensure that the top row is (still) also transparent if you do this!)

Most of this functionality has been available for some time in the release candidate. However, this stable release was delayed because I didn’t find time to complete the web demo for this plugin yet. It’s too versatile šŸ˜…
I’d like to give a shout out to ManaBrent here, whose use of the release candidate gave me confidence that I didn’t seriously break anything.

I haven’t updated the itch.io page description and previews with the new features yet. I’ll try to get around to that soon, but for now you can look at these two Reddit posts for examples of what’s possible with Character modifiers:

You may notice that the help text says to check the demo for help with dynamic modifiers (like those floating bottles in the first post, but not the zones in the second post as those are ā€œnormalā€ modifiers with only constant effects at rest). Since the demo isn’t available yet (and in general, really), feel free to ask for implementation help for those. You can do so in the comments here or (perhaps more conveniently) in my Discord server.

Files

TS_Dynamic_Characters.js (MV+MZ) 283 kB
Version 1.3.3 2 days ago

Get Dynamic Characters MV + MZ

Buy Now$20.00 USD or more

Comments

Log in with itch.io to leave a comment.

(2 edits)

Here’s the code I used for the swimming potion bottle modifier:
(You don’t need the typedef or comments.)

/**
 * This is the type definition for modifier varying functions.
 * You can copy it into your own plugin to get type annotations.
 *
 * @template T
 * @typedef {((
 * 	this: ModifierDefinition,
 * 	t: number,
 * 	character: Game_CharacterBase,
 * ) => T) & { [CONSTANT]?: T }} Varying
 */

// This likely doesn't look great on moving Events!
const phase = (x, y) => (x * 147 + y * 15) % 11 / 5.5 * Math.PI;
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.

	// Note that using a custom function for any "offset" will turn off offset rounding by default!:

	/** @type {Varying<number>} */
	yOffsetVertical: function (t, { x, y }) {
		// The second argument above is a `Game_CharacterBase` instance, which (among many more) has `x` and `y` properties.
		// `this`, here, is the `ModifierDefinition` instance.
		return -3 * t * Math.sin(phase(x, y) + Graphics.frameCount / 20);
	},

	// You can also write this more concisely, but without `this`:
	/** @type {Varying<number>} */
	angle: (t, { x, y }) => 5 * t * Math.sin(phase(x, y) + Graphics.frameCount / 15),
}));

This goes in a separate plugin loaded after Dynamic Characters, but the new bob-and-sway modifier can still be used within Dynamic Characters itself. Note that this is an early sketch, so it won’t look good on Characters that move around.