Resetting an Event while on the same map

To specify, the issue I'm running into is with Moghunter's Shatter Effects for Characters (events). After his shatter effect takes place I can't find a way to reset the graphic to the original appearance unless you exit the screen and return. I wondered if anyone knew if there was a way to force that event reset through either code or something I'm missing, thank you in advance I tried looking through an event search but all things pointed to people wanting to save changes, this one's kind of the opposite.

Specifically what follows it's the purple numbers 444. I've tried replacing the graphic of the event through change image, which when you click it a second time shatters the new image, but still doesn't show the new graphic. Tried moving the event up, down, jump, etc. And that doesn't reset it, neither does walking or stepping.

Thank you all again for any help

qniir25.png

M67Snqe.png

HCejx0w.png
Just a guess, but what if you had a different page on the event conditioned by a self switch, and when you want it to reset, just turn the self switch on and off again?

If that doesn't work, you could try to do a script call to make the event go through it's 'activate new page' cycle. Unfortunately I don't have access to MV at work, so I can't look up what that call would be.

Alternately, you could do a move route on the event to Change Graphic/Sprite to something else, and then immediately another to change it back again.
Thanks Shaz! But yes self switch 2 or more event pages with alternate images didnt reset it, neither did the move route change image/sprite. Stumped me too, and also moved and stepping on the graphic to try to reset it. The oddity is, transfer to new map, then return, its back and ready to break again. If you know the code youre talking of sounds like that may be the missing link.
well, switching it to another event page and back using self switches would have done the same thing the code was going to do.

Here are a few things to try. I don't have the plugin, and I don't really want to download Mog's massive demo project just to see it. So I'm just taking some wild stabs here. Try them in order, and if you find one that works, stop there. I suspect if one doesn't work, none of them will.

We'll assume the event you want to reset is event 15. Change that value to whatever your event id really is (the number, not the name you give it).

Try this first:
Code:
$gameMap.event(15).setupPage();

If that doesn't work, give this a go:
Code:
$gameMap.event(15).clearPageSettings();
$gameMap.event(15).setupPageSettings();

If that doesn't work, try the following:
Code:
var evt = $gameMap.event(15);
var img = evt.page().image;
if (img.tileId > 0) {
  evt.setTileImage(img.tileId);
} else {
  evt.setImage(img.characterName, img.characterIndex);
}

If none of those work, can you copy and paste your event so you have two identical events, then run the game and make the first one shatter. See if the second/identical one shatters as well.
Turns out I have an old copy of the plugin, hopefully no [major] changes have been made since then. 😅

This, placed in a Script command, seems to work for me:
Code:
var id = 21;   // event's ID, use 0 for "this event"
var ev = this.character(id);
var ss = SceneManager._scene._spriteset;
var sp = ss._characterSprites[ev.eventId() - 1];
// remove fragments and end shatter effect
sp.removeShatterSprites();
ev._shatter = [];
// restore priority & reset through flag
ev.setPriorityType(ev.page().priorityType);
ev.setThrough(false);
Just edit the number in the first line as needed~ 🙏
Thank you both so much for the speedy replies, soon as I woke up I caught Caethyril's post before finding Shaz, and hers did the trick. After a swift wait command it completely returns to normal and using the id=0. Pure perfection, thank you both so very very much! I know I'd never have figured to use any commands like the ones you listed, so I couldn't have done it without you both.
Turns out I have an old copy of the plugin, hopefully no [major] changes have been made since then. 😅

This, placed in a Script command, seems to work for me:
Code:
var id = 21;   // event's ID, use 0 for "this event"
var ev = this.character(id);
var ss = SceneManager._scene._spriteset;
var sp = ss._characterSprites[ev.eventId() - 1];
// remove fragments and end shatter effect
sp.removeShatterSprites();
ev._shatter = [];
// restore priority & reset through flag
ev.setPriorityType(ev.page().priorityType);
ev.setThrough(false);
Just edit the number in the first line as needed~ 🙏
Hi ! would It be possible to have this effect inverted ? I mean activate shatter effect on "this event".
I use yanfly event copier so I can't put an event id and would like to add shatter effect on copied events.
Hi ! would It be possible to have this effect inverted ? I mean activate shatter effect on "this event".
I use yanfly event copier so I can't put an event id and would like to add shatter effect on copied events.
Friendly warning that a mod may tag you at some point, as the last post before yours was in October of 2019 and necroposting is against the rules. It would be advisable to double check the date of a thread's last post before posting yourself.
Hi ! would It be possible to...activate shatter effect on "this event".
I use yanfly event copier so I can't put an event id
Literally the first line of code that you quoted says to put 0 to use this event.
Friendly warning that a mod may tag you at some point, as the last post before yours was in October of 2019 and necroposting is against the rules. It would be advisable to double check the date of a thread's last post before posting yourself.
Sorry didn't know, I should create another topic ? Thanks for the warning.

Literally the first line of code that you quoted says to put 0 to use this event.
No his script is for remove the shatter effect, not create it. I'm searching a way to create the shatter effect on "this event" but this isn't possible in the original script made by Mog, you have to define the event with his Id, so It can't work with an event copier.

@jay_adams__, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.


If your question isn't solved yet, please make a new thread.

Original thread: https://forums.rpgmakerweb.com/threads/resetting-an-event-while-on-the-same-map.114713/