Is there any way to make an actor unable to be targeted in battle while still being able to attack? Thanks.
How to make an actor unable to be hit in battle?
RPG Maker MZ SupportMZ - Make an actor untargetable with a state?
Hello! As the title says, I'm wondering if it's possible with VisuStella plugins to make an ally completely untargetable. I put "with a state" in the title as I assume there'd be a way to do it with JS notetags, but I'm not sure. If anyone's wondering what I need it for: I have a fun boss...
forums.rpgmakerweb.com
Thank you!
This plugin sometimes gives the error in battle: TypeError Cannot read properties of null (reading 'states')
I tested it out with a new project, too.
It happens on the enemy's turn if you are holding z to speed up the game I think.
edit: I just had it without speeding the game up, I'm not sure what causes it but it happens often.
When you get an error, you always need to press F8, go to the Console tab, and provide a screenshot of the full error trace.
It sounds like it's saying you have a battler that's returning null for its states() method, but that should also not be possible as the associated property is initialized to an array.
Many people have used that thread and not reported a problem, so I suggest you post the error and test with other plugins disabled. Also, make sure you're always starting a new game when installing a new plugin, not trying to load a save.
I don't see how that could possibly affect it.
It sounds like it's saying you have a battler that's returning null for its states() method, but that should also not be possible as the associated property is initialized to an array.
Many people have used that thread and not reported a problem, so I suggest you post the error and test with other plugins disabled. Also, make sure you're always starting a new game when installing a new plugin, not trying to load a save.
Its a new project with no other plugins.
I don't know what to say - I put it into my MZ test project and it works perfectly. I can't duplicate your bug.
That error trace makes me think you deleted an actor from the database without removing it from the party first, so it's trying to check the states of a null actor.
You can try opening the plugin in a text editor and changing line 58 to read
Code:
targets=targets.filter(target => !target?.states().some(state => $dataStates[state.id].meta["notarget"]));
but it really appears that something else is wrong.
Here's how I get the error: File > new project > add the plugin > create a 31st state called notarget with no removal conditions and add the note tag > create an event that gives reid, michelle and kasey the notarget state (the only actor who should be targeted is then Eliot) and then starts a battle with Goblin*2 > change goblin hp to 9999 for testing > run the game and start the battle.
I then hold Z and let the battle play out, and after a few turns I get the error. Can you replicate this?
I have a state (in VX Ace though) that drops the target rate. Maybe you could apply a similar state and have it be 0? I am sure it is possible in MV as well (I can try later on if you want as I have MV as well).
I'd like them not to be targetable as an actor too, though.
Oh I see, this would probably need a plug in then, someone posted one already, maybe this will help you out.
You don't say whether this is still happening with the change I gave you.
That won't stop them from getting hit by skills with the scope of all targets.
Yeah I didn't realize this was a requirement I should have read more carefully...
I was able to reproduce the bug. Here's a corrected version of the plugin, which I'll also put in the other thread.
Thank you!
Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-an-actor-unable-to-be-hit-in-battle.181432/