MV Help with a mime

I have a mime class in my game. it *functions* just fine surface level. it gives a state to itself that has a restriction that it cannot move and it gives a state to its mime target that forces it to use the same skills/items its mimic target uses to the same target. additionally, i have 3 passive states (yanflys auto passive states) on the class with the purpose of checking the mime's target's stateMotionIndex() so that it performs the same SV state motion as its target.

Issue is that it's a little jank visually.

the "cannot move" restriction makes it stay still while ideally it should be looping through its idle motion. I know i can work around it by removing the restriction and clearing the battler's actions at the start of its turn, but i dont intend on the allowing the player to directly control the actor while the state is active. allowing the player to input commands just to never use them sounds bad.

then the passives to mirror the state SV motions seemingly only update at the end of every turn, but i cannot identify a function i can use to be able to force it when the target is deselected for a skill and the state motion indices between the mime and target dont match

any ideas?

EDIT: the passives arent just for visual benefit either. they do serve a mechanical purpose, so id like to keep them
...show the notetags/code you're using?

the "cannot move" restriction makes it stay still while ideally it should be looping through its idle motion.
You'll have to modify the code beyond the state.

Tweak the logic of the conditionals in Sprite_Actor.refreshMotion() so that a battler with the mime state is picked up by a different motion.

The very last one might do it:
Code:
else if (actor.isUndecided() || actor.isStateAffected(mime))

then the passives to mirror the state SV motions seemingly only update at the end of every turn, but i cannot identify a function i can use to be able to force it when the target is deselected for a skill and the state motion indices between the mime and target dont match
Couldn't offer you any advice here without seeing what you've already done.

The code in notetags will be executed at the time specified by that notetag. I don't know of any tags that will do any kind of constant checks during a different battler's turn to accomplish this.

Again, the thing might be to modify Sprite_Actor.startMotion(). Add a check to see if the actor has a property indicating they're being mimed (so when you start miming, you'd do something like target.mimed = user

So if the actor has a mimed property, you call startMotion() again on that actor.
...show the notetags/code you're using?
yeah, i was light on the details since the states function more or less how they should, but only the visual information was off. Other than that, the states themselves are simple. I should have showed them one time, but i wasnt sure how relevant it would have been with how it is currently. I think i hit most of the important details.


This one goes on the target and does most of the work. no issues here. I tried doing stuff like requesting motions and refreshing here on the user's ._mime within deselect effects but ive removed them since then
1703783458697.png

Code:
<Category: Bypass Death Removal>

<Custom Action End Effect>
var action = user.currentAction();
if (action && action._item._itemId && !action._forcing && action.isSkill())
  BattleManager.queueForceAction(user._mime, action._item._itemId, action._targetIndex);
else if (action && action._item._itemId && !action._forcing && action.isItem() && $gameParty.hasItem($dataItems[action._item._itemId])){
    user._mime.clearActions();
    user._mime._actions.push(action);
    user._mime.currentAction().setSubject(user._mime);
    BattleManager.forceAction(user._mime);
}
</Custom Action End Effect>

<Custom Remove Effect>
user._mime.removeState(stateId-1);
delete user._mime;
</Custom Remove Effect>


This is what the mimic gets
1703783633077.png



The 3 passives are pretty much the same. the only difference is the state motion they check and the assigned motion each one has
1703783781067.png

Code:
<Custom Passive Condition>
condition = user._miming && user._miming.stateMotionIndex() == 3;
</Custom Passive Condition>

the mime's ._miming and the target's ._mime properties are both set by the skill that places the states on both of them

The code in notetags will be executed at the time specified by that notetag. I don't know of any tags that will do any kind of constant checks during a different battler's turn to accomplish this.
It was my initial thought that passive conditions were checked checked constantly, but recent events have proven otherwise 😉. After a look into the plugin i couldnt actually tell where it was taking place other than somewhere adjacent to Game_BattlerBase.meetPassiveStateCondition(), but I couldnt use anything that would sound like it'd lead to anything from the console or the state.

Again, the thing might be to modify Sprite_Actor.startMotion()
Ill take a look into this

You'll have to modify the code beyond the state.

Tweak the logic of the conditionals in Sprite_Actor.refreshMotion() so that a battler with the mime state is picked up by a different motion.
i had gotten so caught up in finding out how to access a battler's sprite_actor and trying to force the motions from deselect effects within the states I didnt even think of changing the sprite's refresh method directly and checking for the state there. Definitely going to try that. another entry for the patch file!

Thanks again!
It was my initial thought that passive conditions were checked checked constantly, but recent events have proven otherwise
They're checked pretty frequently, I just don't see how that helps you set motions on a different actor at the same time the current one changes. The checking of the passive condition doesn't correspond to the timings when new motions are assigned.
Came back and did some poking around. i think i have my solutions now.

You'll have to modify the code beyond the state.

Tweak the logic of the conditionals in Sprite_Actor.refreshMotion() so that a battler with the mime state is picked up by a different motion.

The very last one might do it:

I tried that one after the suggestion, but no luck. I forgot to mention it before, but the mime also didnt perform the step forward or the step back during actions either. they were stuck forward from the initial skill and never moved from there.
I ended up adjusting Game_BattlerBase.canMove(). instead of making multiple adjustments in a few different places i just did it there since they all used it. I probably should have changed Game_BattlerBase.restriction() to not consider the state, but it was easier to just stick a state check into canMove(). if it backfires, then i know where to go

Again, the thing might be to modify Sprite_Actor.startMotion(). Add a check to see if the actor has a property indicating they're being mimed (so when you start miming, you'd do something like target.mimed = user

So if the actor has a mimed property, you call startMotion() again on that actor.

I was able to get the mid round motion mimicking down by making a new refresh for mimes thats basically the old one but uses another's battler's motion status instead of the mime's to update their sprite, and then calling the mimeRefresh() both at the end of the regular refresh when the actor has a ._mime and also in place of the regular refresh when the actor themself is an active mime.
Additionally, the 3 pasives are no longer passives. I had the mimeRefresh method now just give the mime the appropriate motion state directly and remove the others if present.

everything appears to look just fine now. In testing, i found a "quirk" with state categories and your buff and states death removal patch, but thatll be mentioned in detail elsewhere. ive already looked and seemingly ironed it out

Original thread: https://forums.rpgmakerweb.com/threads/help-with-a-mime.164227/