[RMVX] RPG MAKER VX CONDITIONAL DROP
Posts
Pages:
1
I was wondering if anyone knows where I can find a conditional drop script that would enable me to have a quest item drop on a monster if a certain switch is on, I swear I remember seeing one for rpg maker vx however I cant seem to find it
I slapped something quick together, demo project here. It'll basically run whatever ruby you shove into it to see if an item should be dropped. I did take the lazy way out and left the item distribution code untouched though so it'll see what your drops are then distribute them instead of one at a time. This means if one item drop relies on what's in the inventory (like the number of said item in the inventory) it'll only look at what's in the inventory before drops are distributed.
Anyways to set said conditionals you need to cram something like this in the notebox:
The <drop1_condition>...</drop1_condition> denote what item condition you're setting. drop1 means drop item 1, drop2 would mean drop item 2. It's possible to extend it to work with a script that gives more than two drop slots per enemy if needed.
The middle bit is just raw ruby that runs, so above would just execute
And if it's true then the item is a valid drop (the % to drop still runs). In this case if the player has less then 10 of whatever Item#1 is (Potions in this case) whatever is in slot #1 (A Potion) is a possible drop.
Note that because of what I said above the game will check if the player has less than 10 potions before drops are distributed. If the player has 9 potions and kills two slimes both potions drop even though the second should violate the condition. If this is a problem let me know, I'm just being lazy and adverse to script incompatibilities that fixing this may cause.
For your example I used:
Which checks to see if a game switch is on / true to see if an item drops. In the demo project you can talk to the girl on the right and she'll toggle the drop clubs switch.
Anyways to set said conditionals you need to cram something like this in the notebox:
<drop1_condition>$game_party.item_number($data_items[1]) < 10</drop1_condition>
The <drop1_condition>...</drop1_condition> denote what item condition you're setting. drop1 means drop item 1, drop2 would mean drop item 2. It's possible to extend it to work with a script that gives more than two drop slots per enemy if needed.
The middle bit is just raw ruby that runs, so above would just execute
$game_party.item_number($data_items[1]) < 10
And if it's true then the item is a valid drop (the % to drop still runs). In this case if the player has less then 10 of whatever Item#1 is (Potions in this case) whatever is in slot #1 (A Potion) is a possible drop.
Note that because of what I said above the game will check if the player has less than 10 potions before drops are distributed. If the player has 9 potions and kills two slimes both potions drop even though the second should violate the condition. If this is a problem let me know, I'm just being lazy and adverse to script incompatibilities that fixing this may cause.
For your example I used:
<drop2_condition>$game_switches[1] == true </drop2_condition>
Which checks to see if a game switch is on / true to see if an item drops. In the demo project you can talk to the girl on the right and she'll toggle the drop clubs switch.
Pages:
1














