Preface, I'm very much a novice and if something seems out of place it's probably because it is and I didn't know better.
For my game, I wanted to make finding loot more interesting, so I came up with a system that generates loot randomly from a predetermined loot-table. Here's what it looks like.
The way it works is that the chest turns on a switch that then activates this common event.
The way this works is for each of the eight "slots" in the chest there is a variable that is randomly set from 1 to 12, and then there is a lot of if-else statements after that, checking to see what number each variable is and then based on that running a script that chooses an image from a pool of images and displays that at the specified co-ordinates.
This goes on for awhile.
->Sidenote the variable for each slot is set from 1 to 12, but there is no if statement for if the variable is 12, meaning no image is displayed, and there is (roughly) a 1 in 12 chance for each slot to be empty.
I'm using Yanfly's PictureCommonEvents to make it so each picture links to a common event that either acts as a loot table, randomly giving the player an item from that table, or as a trap.
For example here is the loot table for Daggers, and then the one for the poison trap.
Ignore the MimicGreed variable for now, the important thing is that the loot tables randomly choose a number and then if the number is chosen, gives the player the corresponding item. The traps meanwhile play a sound, flash the screen a color, and then give some party members the status effects/deal them damage.
->Sidenote: For my game you can have up to 5 active party members. The intention with the traps is that they are supposed to randomly affect up to three of these active party members, but the way I have it evented right now isn't right. If anyone can tell me how to get that working as intended, or if it is impossible/requires a plugin, I would much appreciate it.
When the player has gotten all the loot from the chest, they can hit ESC or the cancel button to activate an event that erases all the pictures onscreen, turns off the switch that started the original common event, and re-enables player input (the script at the start of TreasureChestLootMinigame disables player input so that you aren't able to move your character around while looting the chest).
Finally the last aspect of this randomly generated loot idea is the idea of what I'm tentatively calling "MimicRerolls".
As you saw at the end of the video, one of the traps the player can activate is the Mimic Trap, which immediately puts you in a fight against a Mimic (right now I'm using the default art as placeholder, I plan to create something scarier in the future).
Here is the battle processing for the Mimic, and this is also where the MimicGreedVariable comes in.
If you escape from the Mimic, you lose any chance to get the treasure, the same as if you had left by hitting ESC. If you die to the Mimic, it's game over. But if you win, then all the pictures are erased and then redrawn by turning the original event switch off and then on again, meaning that by killing the Mimic, you just earned yourself another treasure chest!
And since this is the same event, this chest also has the chance to have a Mimic inside it. Mimic-Ception, if you will, meaning you can kill that Mimic to earn even more loot, and potentially roll a third Mimic, and a fourth, fifth, etc., etc.
To balance this, once you leave a chest by hitting ESC, you won't be able to reopen it, meaning you would need to keep fighting Mimics without taking a rest break or healing your party members if you wanted to reroll your loot. And this is where MimicGreed comes in.
Every time you loot a worthwhile item from a chest, it increases the MimicGreed by 1, and every time you trigger a trap, it decreases by 1. My plan is that the MimicTrap event will check what the MimicGreed variable is, and the higher it is, the more dangerous the Mimic you face will be. This way it becomes a risk/reward type system.
Do you purposely activate the Mimic for the upside of more loot? If you do, will you activate it again? How much are you willing to bet you can win? Or will you be swallowed by your own greed?
Anyhow, that's how far I've come with this idea so far. I felt like sharing it because it took a while to figure out how to make it and have it look kind of nice. I'm open to any feedback or questions/concerns about why I did things the way I did. If there's a simpler way to do any part of this, and I've wasted time by overcomplicating anything I especially want to know. Thanks to anyone who reads this, have a nice day.
For my game, I wanted to make finding loot more interesting, so I came up with a system that generates loot randomly from a predetermined loot-table. Here's what it looks like.
The way it works is that the chest turns on a switch that then activates this common event.
The way this works is for each of the eight "slots" in the chest there is a variable that is randomly set from 1 to 12, and then there is a lot of if-else statements after that, checking to see what number each variable is and then based on that running a script that chooses an image from a pool of images and displays that at the specified co-ordinates.
This goes on for awhile.
->Sidenote the variable for each slot is set from 1 to 12, but there is no if statement for if the variable is 12, meaning no image is displayed, and there is (roughly) a 1 in 12 chance for each slot to be empty.
I'm using Yanfly's PictureCommonEvents to make it so each picture links to a common event that either acts as a loot table, randomly giving the player an item from that table, or as a trap.
For example here is the loot table for Daggers, and then the one for the poison trap.
Ignore the MimicGreed variable for now, the important thing is that the loot tables randomly choose a number and then if the number is chosen, gives the player the corresponding item. The traps meanwhile play a sound, flash the screen a color, and then give some party members the status effects/deal them damage.
->Sidenote: For my game you can have up to 5 active party members. The intention with the traps is that they are supposed to randomly affect up to three of these active party members, but the way I have it evented right now isn't right. If anyone can tell me how to get that working as intended, or if it is impossible/requires a plugin, I would much appreciate it.
When the player has gotten all the loot from the chest, they can hit ESC or the cancel button to activate an event that erases all the pictures onscreen, turns off the switch that started the original common event, and re-enables player input (the script at the start of TreasureChestLootMinigame disables player input so that you aren't able to move your character around while looting the chest).
Finally the last aspect of this randomly generated loot idea is the idea of what I'm tentatively calling "MimicRerolls".
As you saw at the end of the video, one of the traps the player can activate is the Mimic Trap, which immediately puts you in a fight against a Mimic (right now I'm using the default art as placeholder, I plan to create something scarier in the future).
Here is the battle processing for the Mimic, and this is also where the MimicGreedVariable comes in.
If you escape from the Mimic, you lose any chance to get the treasure, the same as if you had left by hitting ESC. If you die to the Mimic, it's game over. But if you win, then all the pictures are erased and then redrawn by turning the original event switch off and then on again, meaning that by killing the Mimic, you just earned yourself another treasure chest!
And since this is the same event, this chest also has the chance to have a Mimic inside it. Mimic-Ception, if you will, meaning you can kill that Mimic to earn even more loot, and potentially roll a third Mimic, and a fourth, fifth, etc., etc.
To balance this, once you leave a chest by hitting ESC, you won't be able to reopen it, meaning you would need to keep fighting Mimics without taking a rest break or healing your party members if you wanted to reroll your loot. And this is where MimicGreed comes in.
Every time you loot a worthwhile item from a chest, it increases the MimicGreed by 1, and every time you trigger a trap, it decreases by 1. My plan is that the MimicTrap event will check what the MimicGreed variable is, and the higher it is, the more dangerous the Mimic you face will be. This way it becomes a risk/reward type system.
Do you purposely activate the Mimic for the upside of more loot? If you do, will you activate it again? How much are you willing to bet you can win? Or will you be swallowed by your own greed?
Anyhow, that's how far I've come with this idea so far. I felt like sharing it because it took a while to figure out how to make it and have it look kind of nice. I'm open to any feedback or questions/concerns about why I did things the way I did. If there's a simpler way to do any part of this, and I've wasted time by overcomplicating anything I especially want to know. Thanks to anyone who reads this, have a nice day.