Trash mechanic with a reward?

Hello everyone!

I have trash mechanic in my game "Dark Resistance". I finished the whole game, but wanted to give this system more attention and more rewards.
For now it is like that:


trashmechanic.png

There are these shiny dots everywhere in town and you can collect them to throw them away in any trash can you can find.

trashmechanic2.png


If you throw away the trash the main character and ONLY the main character will get 1 EXP. Yes, only one EXP. It was supposed to be some sort of meme, but I thought I should reward the player IF they indeed collected EVERY SINGLE piece of trash on EVERY MAP and throw it away.

Something like with the second best weapon of the game or something. But here comes the question: How? Do I need to make control switches for every single trash piece? Or is there an easier way to do it?

It's not something really neccessairy, but I think it would give this mechanic a nice surprise for the player. ^^

Thank you for your help! 🙂
Use control variables to increase a variable by 1 every time a piece of trash is thrown, to keep track of the total thrown. Then, use a conditional branch and check if the variable is greater than or equal to the total number of trash in the game.
Use Variables. Make it go up for each trash, and then when it reaches a set number, give the reward.
I have no idea how did you made game without variables... O_O
if he can carry it in his inventory, then he uses variables?!
carry and throw away = no variable required, but a better reward is
variable related, 1 variable per MapID for the trash or 1 variable array
to keep track of each mapId you have.

if variable reaches the max
than give whatever you want, small sample is like:

control variables 4 = +1
if: script: $gameVariables.value(4) == 20
give weapon ID 3
else
exp +1
end

there are multiple ways to pull this off, if you have 5 maps, use array:
initilize a variable first

$gameVariables.setValue(4) = [0,0,0,0,0]

and use the mapId correctly.
you can check a condition with

$gameVariables.value(4)[0] for first index and [4] for the last on in this example.
Thank you so much for all the great ideas. I think I have some plans.
If the amount of 38 (yeah that's the number of all of them 😀) is reached an event will accur with a nice jingle, a NPC comes down from the heavens and rewards the player with the weapon.
This whole event must be on all maps where you can throw away trash right?
Okay, I will do it differently. Since the trash is respawning every time the map is reloaded this system can be abused. I just give the player the reward if they indeed throw away 100 times the trash. I think that's a way better way to do this. ^^
Okay, I will do it differently. Since the trash is respawning every time the map is reloaded this system can be abused. I just give the player the reward if they indeed throw away 100 times the trash. I think that's a way better way to do this. ^^

From a game design perspective, I think I'd prefer a system where I'm rewarded for seeking out every unique shiny in a game, rather than going back and forth through a single map multiple times to get the same shiny over and over until I get a number up to 100. You can stop the trash from respawning by setting a self switch for each piece that is collected, so next time the map loads the event doesn't.
This whole event must be on all maps where you can throw away trash right?
No, it can be a common event.
Every time you throw away a piece of trash, run a common event. Have the common event check if the value is reached. Obviously, the condition is not met if the value is less than 38, so nothing will happen. But if it is or exceeds 38 then it can run the event where the NPC falls from the sky or whatever.

In order to make sure that NPC always appears correctly, you can use an event spawner plugin. Then in the conditional on the common event, spawn the event, and have it move towards the player.


Since the trash is respawning every time the map is reloaded this system can be abused.

That is because you are likely using an erase event command which just removes the event on the current instance of the map. Every time you reload the map, you are loading a new instance of the map. Use switches/self switches and variables to carry data across each instance of the map load.
When you "pick up" the trash, turn on a self-switch on the trash event. Create a new, blank, event page on your trash event, and set the condition to self-switch A (or whatever letter self-switch you enabled on the first page of the event)

Original thread: https://forums.rpgmakerweb.com/threads/trash-mechanic-with-a-reward.164970/