MV [Yanfly Event Spawner] Issue when changing room

Hi everyone,

I'm having an issue with the Yanfly Event Spawner.

I'm generating a crowd, each character is separated from 2 empty tiles.

A.png


One of the generator of event look like this :

C.png


It starts by deleting any clone event with the ID stored in the VAR number "note", in our example, it's number 61.

Then, it spawns the event.

Next, it copies the ID of the event into the VAR number "note" (still 61 here).

Then, it choose a skin for the last spawned event between 27 possibles skins.
(Maybe it's here the issue ? Does it select an other event that the one store in the VAR 61 ?)

D.png


At the end, I set the last event spawned to choose the original pattern 1, or else there is a bug of charset.

Next, it increment the counter, wait, then try to delete it.
Finaly, it delete the event.

---

If I change room, and I return here, ALL event must reset (making my increment counter useless, I know).

But, clone event are still here, but they loose their skin, since no one gave them one in this new instance of room. This is the reason why I started by killing it, this works sometimes, sometimes it doesnt work.
And I dont know why.

Sometimes, they exist without skins, sometimes, they doesnt exist at all, sometimes, some exists with a skin and some exists without a skin...

Can you help me to figured out why this doesnt work everytime please 😮 ?
Moved to: Plugin Support
Hmmm, maybe I was wrong to tag it as "only related to Yanfly Event Spawner", since this is maybe more general, I dont know.

I will wait, and if there is no answer I will untag the topic.

Video of the issue :


EDIT : I found a tips : when I renter a new zone, I can clear all clones from the MapID I want.
Okay, good, this fixed my main issue (I had to re-code a large amount, but this works).
The problem is : I have some NPC with a dialog (the ones against on the walls).
I need to find a way to say to them to remember when the dialog is passed (I cant have 2 pages, the game delete them if it's the case...).

I tried with an other mod of Yanfly, storing the number of the variable inside the note zone.
So, now, I need to give to the clone the number of the variable :

$gameMap.LastSpawnedEvent.event(this.eventId()).event().note = $gameMap.event(this.eventId()).event().note

OR

$gameMap.LastSpawnedEvent().event(this.eventId()).event().note = $gameMap.event(this.eventId()).event().note

Doesnt work.
Well, I fixed the issue, and I didnt write it here.

7 hours ago, I noticed that it was not working anymore, but I dont know what I did, and I cant find a previous version.

I took note on some notepad file that "self var and notes were the key"....... I should have took MORE notes.........................
I even made a backup... After I modified something, because it doesnt work too on my backup.........................................

Return to the start case. Any idea ?

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-event-spawner-issue-when-changing-room.143317/