Hello, I am currently having some problems with the event unit graves made by Dopans and I need some help with the plugin itself.
So I have applied this plugin to my SRPG just to test it out. It seemed like it was working for enemies as once their health reaches 0, the enemy falls to the correct event. However, whenever the second enemy is killed, I get this error message:
I don’t have your project to test against, but I had a look at the plugin. That crash is the lookup coming back empty rather than a grave being broken. $gameTemp.enemyGrave() returns 0 when nothing on the map matches, and $gameMap.event(0) is undefined, so the next line asking for _erased is what you’re hitting. Line 669 is the enemy branch and 661 is the same thing on the actor side, which fits allies doing it too.
The match is on the unit ID rather than the enemy ID. That comes from <unit:x> on the enemy unit event, and the code reads meta.unit in lowercase. One spot in the plugin’s own help writes it as <Unit:x> with a capital U, and that spelling won’t get picked up. Each enemy event also needs its own unique number there, since clones share an enemy ID.
Could you post the notes from your enemy unit events? I’m wondering if the second one is missing that tag or has it capitalized, which would leave it with nothing to match while the first one works fine.
On the grave map, <actorgrave:x> uses the actor ID and <enemygrave:x> uses the enemy ID, so every ID that can go down needs its own grave event over there. Your screenshot shows <actorgrave:3>, so worth checking whether the ally that dropped is actor 3 or a different one.
That’s the problem, though, I did designate the actor grave and enemy grave as numbers. The enemies work just fine, but the actor grave somehow does not work.
Reviving with this plugin goes through its own script call rather than through targeting the dead unit. In an event Script command:
this.unitRaise(eventID);
That revives the battler and erases the matching grave. Its help says to use this instead of the core’s this.unitRevive(eventID), since the plain one leaves the grave sitting on the map.
You don’t have to hardcode the event ID either. For an actor:
this.unitRaise($gameSystem.ActorToEvent(3));
and for an enemy, off its <unit:x> number:
this.unitRaise($gameSystem.EnemyUnit(1));
A unit’s event gets erased while it’s dead, so I don’t think an item scoped to a dead ally has anything on the map to select, which could explain why you couldn’t target him. If you want an item to do the reviving, what I’d probably do is have the item call a Common Event and run the script call from there.
Yeah, that’s the shape I had in mind. Each branch checks the actor’s Death state and the script call turns the actor ID into their event, so I think it should work as is.
One thing to be aware of is that as written it revives everyone who’s down in one go, so a single use brings back all four at once. If that’s what you want then you’re set. If you’d rather revive one at a time, I’d split it into one Common Event per character (or add a Show Choices in front of the branches) and hook each to its own item.
If an item is calling this, I’d set the item’s scope to None so it’s usable without having to pick a target, since the dead ally won’t be on the map to select.