Comments

Log in with itch.io to leave a comment.

Hello I'm back lol.

I have a question about actors drawn in windows. In the caution section you warn that  'Window_Base.prototype.drawActorCharacter' won't  be affected. But what is the valid method to draw them? I have a couple of plugins that use drawActorCharacter and I'm not sure what I should be aiming to replace that with.

(1 edit)

Right, that’s a tricky one since it basically assumes that the Bitmap is already in memory. Looking at the code… I think the help text may be wrong and it may just work anyway in most cases 😅

I think I misinterpreted how the save file dialogue works when I first implemented this.
I also wasn’t able to test this directly since the engine doesn’t use this function.


If it doesn’t work, what I’d do is something like this:

class Sprite_WindowCharacter extends Sprite_Character {
    initialize(character, x, y) {
        super.initialize(character);
        this.x = x;
        this.y = y;

        // If the positioning is wrong, then change
        // `this.anchor.x` and `this.anchor.y` here.
    }

    updatePosition() { /* Do nothing. */ }
}

Window_Base.prototype.drawActorCharacter = function(actor, x, y) {
    // This (tracking the sprites separately) may be unnecessary.
    let actorSprites = this._actorCharacterSprites;
    if (!actorSprites) actorSprites = this._actorCharacterSprites = [];

    const sprite = new Sprite_WindowCharacter(actor, x, y);
    actorSprites.push(sprite);
    this.addChild(sprite); // Could also be `addChildToBack` and (in MZ) `addInnerChild`, maybe.
};

// This should work for windows that *don't* use `this.contents.clear()`.
// For windows that do, the respective caller has to be hooked to remove the character sprites.

And I think that should basically patch that method to use real, asynchronously-loaded and dynamic character sprites. The downside is that they’ll appear in front of text.

If you tell me which plugins these are that use this function (and if they’re free), then I could look into implementing this workaround into Dynamic Characters as optional feature. No promises on the success though.

(1 edit)

Thanks again!

And the plugins I'm using are Yanfly Save Core and BM MV Shop

(2 edits)

The first link goes to Save Core (YEP), which doesn’t use the problematic method.
(Character sprites for saves work a bit differently and are already supported.)

BM MV Shop does clear the window, so the workaround is a little more involved but still very manageable.

YEP Shop Core appears to be paid, so technically it’s out of scope for free support.
That said, I thought of a way that may just work for all callers of Bitmap.prototype.clear and Bitmap.prototype.clearReact at once a bit earlier. I’ll test that with BM MV Shop and it’s pretty likely it’ll just work with the Yanfly shop plugin too.

I likely won’t have time to implement and test this this week, since I’ll be away over the weekend and a few days into next week. It’s pretty likely I’ll get it done at some point within this month, though.

Thanks a lot for your feedback, it makes development a whole lot easier!

Oh whoops, shop core was a typo (shop on the brain from the second link), save core is what I intended to put there. Sorry about that.

I'm really enjoying the plugin so far, currently using it for dynamic equipment, controlling character expression through switches during cutscenes, and a parallel process for making eyes blink.

I have run into one more piece of trouble, a couple of times the game has run into an error and crashed. I've taken a screenshot of the console when it happened.


I'm having trouble reproducing it reliably, currently my best lead is it happening when a section of tiles is changed using Shaz Tile Changer. Though it's not happening every time, only occassionally. Another detail is that immediately before one of these crashes, a dynamic layer change seems to fail (for example, swapping a piece of equipment but the character sprite doesn't reflect this) and moments later the crash occurs, which as far as I can tell so far seems to happen at the point where the Tile Changer plugin does its thing.

A more vague detail that might help point towards something. I'd managed to catch a save right before one of these and could reproduce it every time i loaded. Disabling the Tile Changer plugin stopped the issue, but when I reenabled it the crash no longer occurred on loading that save.

(3 edits)

It’s because I forgot to break; out of a backwards loop after shortening the array:

grafik.png

Hitting this depends on a bitmap load pending for I suspect at least two frames right before another change, which explains why this was inconsistent and how the tile changer could provoke it (by generating unrelated “network” load or by causing the game to update multiple times in a row to catch up with a short freeze).

I’ll include the fix alongside the target groups later today.

Edit: The fix and target groups are included starting in Ver. 1.3.2-RC.4, which is now online.

BM MV Shop-compatibility (i.e. dynamic on-window character sprites) will be delayed a bit. I caught a cold 🤧

Is there a way to add a layer to a character without a target? So that it works regardless of base sprite?

The reason I ask is because I am swapping my actor sprite a lot and it would be a prohibitive amount of work to setup rules for each variant.

(2 edits)

Not yet, but I can add wildcards (to the release candidate for now, but there should be no problem moving to the stable release once I complete that. Some things happened and nearly everything in my life got delayed, unfortunately).

It’s not too complicated, so I’ll likely do it today or tomorrow. I’ll let you know when it’s online.
The downside is that it will have considerably worse performance (only if you use that), since it will turn off some optimisations that are only possible with precise target lists.

(2 edits)

Note though that you can already select any number of targets for a single rule and can copy/paste the target list all at once with Ctrl+C/Ctrl+V while “Targets:” is highlighted. Does that work for you?

I’ll hold off on adding wildcards until you reply, since I’d rather avoid adding a feature that may perform quite badly.

I had a better idea that will work without performance downside: Target groups.

For any group, you’ll have to specify only one target in the rules and all other group members will be added as targets automatically. Groups will be editable in a separate parameter and at runtime through the JS API.

That still requires setting up the group once on your part, but I think that’s worth it in terms of making the game run smoothly on weaker systems. I’ll see if I can add it to the release candidate within the next few days.

(+1)

Copying and pasting targets does work thank you. I do like your idea of target groups though, that would save time if additional targets need to be added later on.

I also wanted to ask if there is a way currently to offset a layer from the target? I thought I found a way but it offset the whole character rather than the layer (which is still cool and useful). If not that's okay, I can increase the base sprite height if needed.

(1 edit)

Glad to hear that! And yes, I’ll still add target groups.

Individual layer offsets are not supported or planned.
I don’t think that’s possible without interacting with the spritesheet layout directly, which most likely wouldn’t be compatible with e.g. 8-dir or “more character frames” plugins.
(The layered bitmaps are “baked” into a single texture, since not modifying the scene graph is by far the most robust approach.)

Okay, all good! And thank you.

Hi there! Just found your page. This plugin and dynamic pictures looks awesome! I took a look at the DLC you mentioned, but your plugins frankly look more robust and useful and I would rather support our community of talented people.

I just saw your comment below about tying the two plugins together via the API? Any chance you might do that sometime soon-ish? That would be icing on the already very tempting cake.

Imma going to buy them either way of course :) They are just what I have been looking for.


(2 edits)

Thank you for the praise and consideration ☺️

I hadn’t really thought fully through the combination… but yes, this is feasible, if not quite as flexible as each plugin separately. (You could combine these approaches, of course, also on the same sprite(s).)

I assume you use Pictures for example as Actor talk sprites in cutscenes, and may also have Actors that appear as Events while not in the party?
The latter isn’t supported all that well by Dynamic Characters directly, but a controller that combines them can use the broader Actor condition implementation from Dynamic Pictures and apply them to both…
I should be able to give you a choice on whether to apply a rule to all Characters or only the specified Actors in the party, so that you can still use combined Actor character spritesheets if your Actors don’t appear as Events.

I won’t have to do much testing or new UX design (for the plugin parameters) for this, so I can give you a rough ETA of two weeks. I can’t fully guarantee this estimate due to some life stuff I have going on, but at least from a technical point of view, I don’t expect any obstacles.

(+1)

Hey! Wow, thanks for the thorough response. There's no rush! I'm just waiting for payday to roll around. My game likely wont be finished this year or next, so take your time :D life comes first.

I am no coder yet (I can do a bit of JS when I need to, but large scripts still make my head spin, very much a novice tutorial-follower). The reason the combination sounded appealing to me is this: I have decided to try to drive myself insane by making a single-player life-simulator game. Only 1 main actor, the rest of the cast will be NPC Events that (with a handful of possible exceptions) don't need to change an awful lot through the game. I can do most of that within the vanilla engine. 

But for the main player, nearly every choice you make will change your character in some way, for good or bad.  Much will be subtle, but some consequences will be major and need visually representing. Mood/status, clothing, scars, tattoos, fat/thin, etc. So I was looking for a way to represent as many of these changes as possible both in the player map sprite and character portrait (which would be visible when talking and when you open the skills and stats menus). And that is how I stumbled upon your plugins =)

The idea is the game plays out over a set timespan of 10-20 in game years, but it can be replayed many times for many different outcomes. I want the gameplay to be as non-linear as possible. But obviously, keeping up with the sheer number of sprites needed for that amount of player choice without plugins is a path to madness. lol

I have no idea if I can achieve everything I want with your plugins, nor of course would I expect that, but it seemed the combination of the two would be the best "starting block" currently available for me to study and (try to) build off. 

(1 edit)

I think what you describe is fully supported. I’m still making it a little more versatile than that so it’s useful for many kinds of games, though. (It’s really not much effort at all.)

Rules can influence later rules through the tag system, so it’s pretty easy to set up variations of a rule. You likely will have to use one rule per variation, though, unless you extend the plugins, and if something is at once in front of and behind something else that will need two rules too.
It’s possible to hide the base layer and replace it with a different one, so weight changes and different poses shouldn’t be a problem.

The default character portrait drawn onto the message box and menu unfortunately isn’t affected by my plugins. (It’s not really a Sprite normally, which makes it difficult to work with.)
If you add a (modified) Sprite_Picture sourced from a Game_Picture to the Scene_Status, or to the window directly, that will be affected though! Here’s the one I use in Live Menu and Pause (for the pause screen Picture):

class Sprite_Pause extends Sprite_Picture {
	/** @override */
	initialize() {
		super.initialize(0);
	}

	/** @override */
	picture() {
		return pausePicture;
	}

	/** @override */
	updatePosition() {
		super.updatePosition();
		// Because I don't use the standard Picture container.
		// (See `Spriteset_Base.prototype.createPictures`.)
		this.x += Math.floor((Graphics.width - Graphics.boxWidth) / 2);
		this.y += Math.floor((Graphics.height - Graphics.boxHeight) / 2);
	}
}

pausePicture is just a standard new Game_Picture() that I called .show(…) on to set it up. In theory you can make that a constant in a plugin if there are no changing parameters. The load order doesn’t matter vs. mine, since I hook into the Sprite_Picture and Game_Picture prototypes without changing the instances.

(2 edits)

-whoops, self replied-

The combined-rules plugin is now available: Dynamic Actors

I admittedly gave you a safe estimate on when I’d get this done, but it also just turned out to be much less work than expected. I guess I can thank past-me for good API design 😅

Enjoy, and let me know if there are any problems or features you’d like to see added.

(+1)

Hey man! Thank you so much :). I picked everything up just now. Looking forward to having a play with it this week. 

Thank you for your purchase! Please let me know how it works for you, especially if there’s anything you think could be improved.

I see that this states it only works for top down sprites, not sideview battlers. Would Dynamic Pictures be what I use to have dynamic SV sprites and what would be the best method to tie them together?

(2 edits)

I currently don’t have a plugin that adds bitmap composition to side-view battlers. (Dynamic Pictures only works on Sprite_Pictures showing Game_Pictures, usually shown with the “Show Picture…” command.)

The main reason is that the games I’m contributing to don’t use the side-view battle mode. If your game uses a Picture to represent the player character(s) and/or enemy, then Dynamic Pictures would work for that. Otherwise, a plugin layering battler bitmaps is needed.

The cleanest way to tie my plugins together is through their JavaScript APIs. I could make a plugin (at no extra charge) that specifically targets Actors and sets up those rules in both Dynamic Pictures and Dynamic Characters at once. It doesn’t sound like that would fit your use-case, though.

(+1)

Thank you for the reply. While sideview bitmaps would be nice (saves a lot of on asset compatibility), I understand why it isn't an option. I'll keep looking around for such then.

I do think, even if it wouldn't fit it, the Dynamic Actor/Picture tie-in rules would be a good idea.

I agree. For now I’ve created it as placeholder file in my project repository, though I’m probably too busy with other things to work on it soon.

(1 edit)

I should probably mention that here even if it costs me half the sales: Since one week after I published this plugin, there is now official DLC for RPG Maker MZ that has a lot of feature overlap and also covers other actor appearances like side-view sprites.

I haven’t used it and the Steam page doesn’t show the plugin settings, though, so I can’t comment on how easy it is to make use of.