Need help with switches

Okay so This is my first post and I would like to say hello! I am Sushislyaer and after over 20 years of RPG gaming, I have decided to start my own game. Right now everything is in rough development like the dialogue mainly because I just want the quests to work then I will take the time to perfect everything else. I am needing some help from all you experts out there. I have taken the time to watch every single tutorial out there and the main toe stub is switches, so this is what I have but I don't know what I am doing wrong.....

The quest is simple (or so I thought), go to the basement, kill 10 rats, return for reward then go to next quest.

Pic 1 of event page 1 starts the quest. The control switch is on to kill rats. the control switch is set to single 0002 Kill rat 1, operation on

1.png


Pic 2 of event page 2 closes the control switch 0002 kill rat 1 so you cannot constantly accept quest over and over again. then opens the actual control variable quest of killing the rats. this switch is set to Single, 0001 kill rats, add constant of 1.

2.png



Pic 3 of event page 3 closes the control variable switch of 0001 kill rats. after you reach 10 or more. After that, you receive your reward of 15g and 50 xp. I turn self switch a on so you cannot constantly sit there and collect the reward. After that, the next quest begins......... ........ ..... I don't know how this works because I cannot get past event page 2.

3.png


4.png


So here is my problem, you start the quest, blah blah blah accept the quest cool. If you talk to her again she says "well off to it then" I go downstairs, kill 10 rats, come back up and she still says "well off to it then"..... It doesn't matter if I kill 10, 20 or 30 rats. It doesn't progress forward.

oh almost forgot the troops..... This is what I have for the troops. There are 3 rat troops, one with 1 rat that adds 1 to the control variable, a 2 rat troop that adds 2 to the control variable, and a 3 rat troop that adds 3 to the control variable. All instances occur at battle end and when the rat's health reaches 0%


rat troop 1.png

rat troop 2.png

rat troop 3.png


Please help! I am constantly moving switches around and changing but to no avail... nothing is working and I know it's a user error....
This has nothing to do with switches, your Problem is that the troop event that counts up ratkills will never run...

If the last enemy is killed, the engine will directly proceed to battleresults WITHOUT running a troop event after that, so the troop event conditioned to the last enemy HP will never run.

There are several ways around that described in tutorials, the easiest would probably be to have each rat drop a rat's tail or something like that and have the inventory checked on the questgiver...
This has nothing to do with switches, your Problem is that the troop event that counts up ratkills will never run...

If the last enemy is killed, the engine will directly proceed to battleresults WITHOUT running a troop event after that, so the troop event conditioned to the last enemy HP will never run.

There are several ways around that described in tutorials, the easiest would probably be to have each rat drop a rat's tail or something like that and have the inventory checked on the questgiver...

Ohhhhhh okay cool! well, it's nice to know my switches are okay. I was flipping out because I swore my switches were correct. I will check out the tutorial because I really don't want this to be an item collection quest.
Andar answered the question, but I also want to note that you have written in an unintended bug. If you were to go to Sophia while she says "well off to it then" and talk to her ten times, you'll be able to trigger the quest as finished, because she increments the variable every time you talk to her. You really don't need that step of incrementing the variable in her page; it's already listed as "kill rats" in the database.
Then you'll need an immortal state to force the engine to process the troop event and remove that state in the troop event to finalize the kill, or a Plugin with additional event triggers.
Andar answered the question, but I also want to note that you have written in an unintended bug. If you were to go to Sophia while she says "well off to it then" and talk to her ten times, you'll be able to trigger the quest as finished, because she increments the variable every time you talk to her. You really don't need that step of incrementing the variable in her page; it's already listed as "kill rats" in the database.

HAHAHAHA, that is so awesome! I tried it, not because I don't believe you but to help me understand why it was doing that. It makes sense. Variable deleted! Thank you so much for your help. the process works great for that part. Now I am still trying to figure out this kill count... sweet tutorials.
Then you'll need an immortal state to force the engine to process the troop event and remove that state in the troop event to finalize the kill, or a Plugin with additional event triggers.
hmmm, I understand what you are saying. I'll try to dig into that a little bit deeper. Thanks for the direction. is there any specific plugin you know of off the top of your head?
There is a slightly hacky way you can do it by creating a state with the trait "State Resist -> Knockout" and applying it to the whole troop on turn 0. Then have a page for each enemy triggered by its HP being <= 0% that removes that state, increments the variable by 1 and applies the knockout state to the enemy. This works perfectly with one exception: if you do it this way the "X is slain!" message won't appear.
There is a slightly hacky way you can do it by creating a state with the trait "State Resist -> Knockout" and applying it to the whole troop on turn 0. Then have a page for each enemy triggered by its HP being <= 0% that removes that state, increments the variable by 1 and applies the knockout state to the enemy. This works perfectly with one exception: if you do it this way the "X is slain!" message won't appear.

hmmmm..... that might be a weird work around
Okay peeps, the newby has figure this out!!!!!!

originally this was my troop, notice how the conditions are set to the enemy hp reaching 0% and this is obviously the problem as stated by Andar.

rat troop 1.png


The fix is actually surprisingly simple. I searched high and low for a plugin and I have learned that if yanfly doesn't have a plug in for it then the program can already do it.

soo...... you're going to love this.....

I changed the condition to my switch... problem solved.

rat fix 1.png

rat kill 2.png


Thank you all for your collaboration! I never would have figured all of this out without you peeps
Your solution has another problem: if the player escapes, that will still count as a kill even if none of the rats where killed before the escape.

The solution with the resist knockout is the one I called "immortal state" for what it does, AS that one was called this before in oder RM's
Your solution has another problem: if the player escapes, that will still count as a kill even if none of the rats where killed before the escape.

The solution with the resist knockout is the one I called "immortal state" for what it does, AS that one was called this before in oder RM's

Okay, Im loving the challenge.
There is a slightly hacky way you can do it by creating a state with the trait "State Resist -> Knockout" and applying it to the whole troop on turn 0. Then have a page for each enemy triggered by its HP being <= 0% that removes that state, increments the variable by 1 and applies the knockout state to the enemy. This works perfectly with one exception: if you do it this way the "X is slain!" message won't appear.
CAn I get an example? I created the immortal state no problem but I am having difficulty applying it to the whole troop at turn 0. I know I can make the rat immortal in the enemies section.
Make a troop event with the trigger set to "turn" and 0 in both boxes. In the event list, do "Change State", select "Entire troop" and add the state you created.
rat immortal.png
Make a troop event with the trigger set to "turn" and 0 in both boxes. In the event list, do "Change State", select "Entire troop" and add the state you created.

Am I missing a plugin or something?
Sorry, I should have said "Change Enemy State"; it's on page 3.
Sorry, I should have said "Change Enemy State"; it's on page 3.

Oh im a dumbass. I didnt even think about the other pages..... Thank you
OOOOoooooOoOoooooo....
Finally, after 2 and a half days the quest is complete. Id buy you all a round of drinks if you were local.
I graciously accept my virtual drink. Don't hesitate to post if you have any further questions!

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-switches.85933/