MV Make a variable just affect one enemy/event

Ive just created a variable "Enemy HP" which i want it to be just one, so i don't have to make one for every enemy. I was wondering if theres a way to make that variable adjust in every event page and don't affect the HP of the other enemies when attacking it.
I'm not sure what you're asking for here. What's the variable for?
Health points, i'm making my own ABS
I'm not sure what you're asking for here. What's the variable foHalth
So you want to use a variable to track the HP of the current enemy but only use one variable for all of them?

That's...not possible. If you want to track multiple values at once, you need multiple variables. If you overwrite its value, its old value is lost. The only way to use a single variable would be to make it an array, but honestly the best approach would be to make enemies objects and give them their own HP property, assuming you can code plugins. If not, it'll likely be best to use a separate variable for each enemy.
So you want to use a variable to track the HP of the current enemy but only use one variable for all of them?

That's...not possible. If you want to track multiple values at once, you need multiple variables. If you overwrite its value, its old value is lost. The only way to use a single variable would be to make it an array, but honestly the best approach would be to make enemies objects and give them their own HP property, assuming you can code plugins. If not, it'll likely be best to use a separate variable for each enemy.
I'll keep trying things i really don't think that make like 1000 variables would be the best
Ahh, I'm sorry to tell this to you, but I'm with Trihan on this one.
There really is no way to track the information you want with a single variable. Every single time that variable's data changes...the previous data is lost (as Trihan already stated).

It would certainly be a hassle to use multiple variables, yes. But I don't think it's tooooo much of a hassle if that makes sense. Not unless you have like an INSANELY large amount of enemies...it will take some work, but you can work through it!

In fact, you might find some it's easier to manage multiple variables when you organize them. Have you already done something along the lines of:

001 === Enemies HP Tab===
002 Enemy 1 HP
003 Enemy 2 HP

... etc



Exactly how many enemies are you trying to work with...?
Ahh, I'm sorry to tell this to you, but I'm with Trihan on this one.
There really is no way to track the information you want with a single variable. Every single time that variable's data changes...the previous data is lost (as Trihan already stated).

It would certainly be a hassle to use multiple variables, yes. But I don't think it's tooooo much of a hassle if that makes sense. Not unless you have like an INSANELY large amount of enemies...it will take some work, but you can work through it!

In fact, you might find some it's easier to manage multiple variables when you organize them. Have you already done something along the lines of:

001 === Enemies HP Tab===
002 Enemy 1 HP
003 Enemy 2 HP

... etc



Exactly how many enemies are you trying to work with.
A lot, and i'm tracking it's max HP value, current value and other stats i don't think that way worth
it might be possible if you use YEP_SelfSwVar plugin.

each var (same) can hold it's own variable digit for that event.
A lot, and i'm tracking it's max HP value, current value and other stats i don't think that way worth
I don't understand this entire question. RPG Maker, by default, has all of this stuff built into each enemy. When you make the Enemy in your Database, you define its HP and other parameters.

Then you put the enemies into Troops. Then, in the game, you get into combat with these troops, and the game automatically tracks each individual enemy's HP and other stats. You don't do any of that manually.

So if you want help for your situation, you need to describe how your combat system is so entirely different that you can't use all of this built-in functionality that the engine is designed to do for you.

Have you done a tutorial for MV, so that you understand all of that stuff?
I don't understand this entire question. RPG Maker, by default, has all of this stuff built into each enemy. When you make the Enemy in your Database, you define its HP and other parameters.

Then you put the enemies into Troops. Then, in the game, you get into combat with these troops, and the game automatically tracks each individual enemy's HP and other stats. You don't do any of that manually.

So if you want help for your situation, you need to describe how your combat system is so entirely different that you can't use all of this built-in functionality that the engine is designed to do for you.

Have you done a tutorial for MV, so that you understand all of that stuff?
He did say he's making his own ABS, though that doesn't stop him using database objects if he's using actual JS code for it.
that doesn't stop him using database objects if he's using actual JS code for it.
Right. If I were making an ABS, I would find it less effort to tie it into the existing structures than to recreate all of that entire functionality through variables - that's my point.

And if he's not coding it himself, I should think any of the pre-existing plugins for this include ways to manage the enemies. Disclaimer, haven't ever tried any of them.
so i don't have to make one for every enemy. I was wondering if theres a way to make that variable adjust in every event page and don't affect the HP of the other enemies when attacking it.
There are technical limits in programming, so you'll have to look for a compromise.

some ideas like self-variables were already mentioned.
another idea would be to limit the enemies per map instead of having every enemy in the entire game with its own data. If you limit yourself to for example 40 enemies per map and reset the HP of every living enemy on each map, then you would be able to work with 40 variables and reuse them each map.
Thanks everybody! I'll try selfvariables

Original thread: https://forums.rpgmakerweb.com/threads/make-a-variable-just-affect-one-enemy-event.140141/