How to make this idea happen?

I have tried that. A few different way thinking I did that wrong as well. I have used 0001, 001, 01, and 1, none work. Along with using 0101 and 101.
Hit F9 and see the value of the variable directly. Also try a new variable, like 101, as you might have a script that uses variable 1 in the game.
I have it set to 101 as of now. It still isn't working. I changed up a few things and sort of got it to work. I ran into another problem however. I put the code inside the NPC event and the variable started to work. As so:
2017-10-17_14h46_52.png


With the Battle Code inside the NPC instead of a separate event on the map, the variable increments and the NPC tells me the correct count. However the NPC becomes the slime every time I trigger him. So I essentially turned HIM into the event. Not sure why the same code isn't working outside of the NPC event.

Does this help or shed anymore light on things? Any other thoughts?

Edit:

It occurs to me to make sure we are both working on the same problem. I have setup slimes to roam in a particular region (region 1). I want my character to roam around and get into a random encounter in region 1, thus incrementing the variable by one until 5 is reached. Then the npc will trigger the switch unlocking a door.
The new image didn't show I'm afraid. If the NPC becomes a slime though you might have something off in your pages, as RPGMaker always runs the highest page number which is valid.

Why not try to make the quest kill a slime for now, and once you get that working, work on adding in the rest? That's what I did while I was just learning.
Not sure if you saw my edit on the previous post. Essentially even if I were to create a quest to kill 1 slime, I am still in the exact same predicament. My variable isn't correctly responding to my killing of a slime. Thus the quest can't be completed.

I know I've taken up a lot of your time today, and I appreciate it all, I really really do. It just seems like it should be a simple thing to do, and I'm not sure what is going wrong here.
Let's try this again. Post a new picture of the slime event as it is now, and a picture of the NPC event, as it is now. Disregard the old posts for it, we need to confirm what it is at the moment. And did you ever hit F9 to check the value of the variable?
Ok, so at the moment, this is what I have. It correctly adds 1 to the variable each time the NPC turns into a slime. That however isn't correct. As I want a regional roaming slime to be killed.

2017-10-17_14h46_52.png


As for the f9, it takes me to the Troop screen. I don't see anything that would have a value for the variable. So I'm not sure what I should be looking for.
Ok, two things:

F9 has to be hit while playing the game under test play. It's the key to bring up the debug menu, which shows the values of all variables and switches at the moment.

Two: If you want to do this for a roaming slime, it is going to be *really* hard to do, as there is no way to do it easily. The best solution is the following:

In the troop event for the slime:
-First page: Set to occur on turn 0 * 0.
-Add state immortal to the slime.

-Second page: Set it to occur if slime's HP <= 0%
-Remove state immortal from the slime
-add one to the variable.
-Add state KO to the slime.

And I hope you still have the state immortal in your database, or this gets much harder.

And if you are not sure what pages are, it is time to work through those tutorials, so you can learn the common terms used.
I want to cry, and then hug you really tight. But I'll man up and just shake your hand instead ;-)

What exactly does that code mean, and what is it doing that made it work?
It's making it immune to being killed first on page 1. This is required due to a quirk in RPGMaker.

The second page is removing the state making it immune to being killed, adding 1 to your variable, then killing it for you (since it has no HP). It's a common trick used for if you say want to end a battle once a boss is defeated, you just change that last line to KO the entire troop instead.
This is definitely something I will remember. Thank you for ALL your help today and helping me solve something I've spent the last 3 days trying to figure out!!
Does this trick have to be done in MV as well, or is this an Ace engine thing only? This is on the same topic, but sort of different so wasn't sure if I needed to post this in the other forum.

Dang it, I did it again. I wasn't even paying attention that I was the last one who posted. Please forgive me and give me one more shot. I'll attempt to pay more attention while posting in these forums.
Np. All we ask is you try not to do it. Everyone makes an error. And I *think* you have to do it in MV, but not sure.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-this-idea-happen.85829/