I'm trying to have it that a character must talk to a certain number of NPCs and/or collect a certain number of Key items to complete a quest. But lately it's throwing me for a loop. No matter what I do, I can't seem to make an event automatically activate once the requirements have been met. I was hoping to get a little help in the matter?
Having an event play after certain actions.
RPG Maker MV SupportThe simplest way I can think of, is to add a "Common Event..." command at the end of each event that could meet part of the requirements, then have the common event check if all requirements are met.
For instance, if you need to talk to NPC 1, NPC 2, and NPC 3, you could call the common event at the end of each of the NPC events, and check if the player's already talked to all 3 of them.
For instance, if you need to talk to NPC 1, NPC 2, and NPC 3, you could call the common event at the end of each of the NPC events, and check if the player's already talked to all 3 of them.
Just so if i didn't misunderstand, what you need is some way to trigger an event when actor finished talking to the required NPCs or collected enough key items, so the event will automatcally notify the actor quest is done, and maybe give reward to the actor too.
If my understanding is correct, check below.
For you request, there are three situations need to be consider:
Quest complete by meet NPCs.
Quest Complete by key items given by events.
Quest Complete by key items given through battle.
First, let me go through the variables and swiches you will need for all the conditions.
You will need a 'Quest Check' switch for all the conditions.
For 'Quest complete by meet NPCs', you will need 1 Variable:
NPC Count.
For 'Quest Complete by key items given by events' and 'Quest Complete by key items given through battle', they both need 1 switch:
Item Check.
And just for 'Quest Complete by key items given through battle', it will need an extra switch:
Battle Check.
Finally, you will need X number of switches for each of the quest you have.
for example, if you have 50 quests, you will need 50 different switches. One for each of the quest.
For this example, I will set up 3 quests, one for each of the conditions, so I will create 3 switches:
NPC quest, Key item quest, Battle item quest.
Now, lets set up for 'Quest complete by meet NPCs':
For this example I assume this quest needs to meet three NPCs.
So, we add the following to each NPC's Event Page:
For each NPC Actor meets, the variable NPC count will plus 1. Just make sure players will not activate the above content twice when they repeatly talk to the same quest NPC.
And when NPC count equals 3, this means actor have meet all three NPCs. So we turn on switch Quest Check and switch NPC quest.
Next, we create an autorun common event went switch Quest Check is on.
Create a conditional branch in the common event's content page when switch NPC quest is on, add what you need under the conditional branch, and turn off switch NPC quest at the end of this conditional branch.
Remember to turn off switch Quest check at the end of this event, so it will not loop itself.
Above is what you will need for 'Quest complete by meet NPCs', if you need help on 'Quest Complete by key items given by events', continue reading.
For 'Quest Complete by key items given by events', turn on switch Item Check at the end of each event that gives actor the key item. Remeber to make sure players will not trigger above content twice.
Then set up a parallel common event that runs when switch Item Check is on.
Add an conditional branch and put the script:
$gameParty._items[Y]>=3
Y being the item ID for your key item. 3 is the number of the key items actor needs to complete this quest.
With in the conditional branch, turn on switch Quest Check and Key Item quest.
Remember to also turn off switch Item Check at the end.
When switch Quest Check is on, it will trigger the autorun event we just set up ealier.
Inside the common event, add the a conditional branch when switch Key Item quest is on.
Add whatever you need under this conditional branch, and remove those three key items from the actor's party, and turn off switch Key Item quest at the end of this conditional branch.
Now you are done for 'Quest Complete by key items given by events', if you also need to set up the this function for 'Quest Complete by key items given through battle', continue reading.
For 'Quest Complete by key items given through battle', add turn on switch Battle Check at the end of the events, which gives actor the quest.
And then, go into database --> Troops, and under the troops which will drop battle key items, set up their battle event pages as follow:
Remember to set the conditions to switch Battle Check, and Span: battle.
Now add a conditional branch in the parrallel common event we set up earlier using the following script:
$gameParty._items[Z]>=3
Z being the item ID for the battle key item. 3 is the number of battle key item need to complete this quest.
Under the conditional branch, turn on switch Quest Check and Battle Item quest.
In the autorun common event, add a conditional branch which triggers when switch Battle Item quest is on.
Do the same thing as what we did earlier for the key item quest.
Add what you need under the conditional branch, remove battle key item, turn off the switch.
Done!
Phew, hell a lot of writing!
Since what you are asking is a quite broad funciton, there maybe more situations thats not covered in my method, so you may need to adjust here and there to better suit you needs, but I think I did cover the majority part of it.
Hope this helps!😂
If my understanding is correct, check below.
For you request, there are three situations need to be consider:
Quest complete by meet NPCs.
Quest Complete by key items given by events.
Quest Complete by key items given through battle.
First, let me go through the variables and swiches you will need for all the conditions.
You will need a 'Quest Check' switch for all the conditions.
For 'Quest complete by meet NPCs', you will need 1 Variable:
NPC Count.
For 'Quest Complete by key items given by events' and 'Quest Complete by key items given through battle', they both need 1 switch:
Item Check.
And just for 'Quest Complete by key items given through battle', it will need an extra switch:
Battle Check.
Finally, you will need X number of switches for each of the quest you have.
for example, if you have 50 quests, you will need 50 different switches. One for each of the quest.
For this example, I will set up 3 quests, one for each of the conditions, so I will create 3 switches:
NPC quest, Key item quest, Battle item quest.
Now, lets set up for 'Quest complete by meet NPCs':
For this example I assume this quest needs to meet three NPCs.
So, we add the following to each NPC's Event Page:
For each NPC Actor meets, the variable NPC count will plus 1. Just make sure players will not activate the above content twice when they repeatly talk to the same quest NPC.
And when NPC count equals 3, this means actor have meet all three NPCs. So we turn on switch Quest Check and switch NPC quest.
Next, we create an autorun common event went switch Quest Check is on.
Create a conditional branch in the common event's content page when switch NPC quest is on, add what you need under the conditional branch, and turn off switch NPC quest at the end of this conditional branch.
Remember to turn off switch Quest check at the end of this event, so it will not loop itself.
Above is what you will need for 'Quest complete by meet NPCs', if you need help on 'Quest Complete by key items given by events', continue reading.
For 'Quest Complete by key items given by events', turn on switch Item Check at the end of each event that gives actor the key item. Remeber to make sure players will not trigger above content twice.
Then set up a parallel common event that runs when switch Item Check is on.
Add an conditional branch and put the script:
$gameParty._items[Y]>=3
Y being the item ID for your key item. 3 is the number of the key items actor needs to complete this quest.
With in the conditional branch, turn on switch Quest Check and Key Item quest.
Remember to also turn off switch Item Check at the end.
When switch Quest Check is on, it will trigger the autorun event we just set up ealier.
Inside the common event, add the a conditional branch when switch Key Item quest is on.
Add whatever you need under this conditional branch, and remove those three key items from the actor's party, and turn off switch Key Item quest at the end of this conditional branch.
Now you are done for 'Quest Complete by key items given by events', if you also need to set up the this function for 'Quest Complete by key items given through battle', continue reading.
For 'Quest Complete by key items given through battle', add turn on switch Battle Check at the end of the events, which gives actor the quest.
And then, go into database --> Troops, and under the troops which will drop battle key items, set up their battle event pages as follow:
Remember to set the conditions to switch Battle Check, and Span: battle.
Now add a conditional branch in the parrallel common event we set up earlier using the following script:
$gameParty._items[Z]>=3
Z being the item ID for the battle key item. 3 is the number of battle key item need to complete this quest.
Under the conditional branch, turn on switch Quest Check and Battle Item quest.
In the autorun common event, add a conditional branch which triggers when switch Battle Item quest is on.
Do the same thing as what we did earlier for the key item quest.
Add what you need under the conditional branch, remove battle key item, turn off the switch.
Done!
Phew, hell a lot of writing!
Since what you are asking is a quite broad funciton, there maybe more situations thats not covered in my method, so you may need to adjust here and there to better suit you needs, but I think I did cover the majority part of it.
Hope this helps!😂
Original thread: https://forums.rpgmakerweb.com/threads/having-an-event-play-after-certain-actions.95902/
