- Joined
- Mar 7, 2012
- Messages
- 2
Hi, first time using this site and looked like a great place to find help for a very frustrating problem.
The goal of the trigger is to Randomly spawn an item with odds based upon the amount of that item you already have (stored in a variable) in comparison to the level of the unit killed that drops the item. With a maximum of 50% drop chance. For example, if you have 20 food, and you kill a level 18 unit that drops food, there would be a 1 in 3 chance that it would drop.
All of this works fine, but in setting up the rate like this i found if you just leave the items on the ground, your chances for the drop will remain high, thus you can kill a respawn location to your hearts content. My remedy was to Set each item to a Variable as it spawned, wait 5 seconds, then despawn it. So i set up the following Trigger.
I have looked over it several times and see nothing wrong with my logic, spawning just 1 item at a time works ok, but if you happen to get 2 drops withing 5 seconds, it skips all but the last one that dropped in that time period and only despawns the very last one. The two Quest events were put in place to track this. If killing 2 in five seconds, it will read, Setting last item to 1... Setting last item to 2... Removing item 2. It seems to change the varable in a trigger that is still in progress even though the variable changed is (Interger A).
Thanks for the help, I believe to have a solution but would require 30-40 minutes of tedious if/then/else tricks that the loop 1 through 20 should cover.
The goal of the trigger is to Randomly spawn an item with odds based upon the amount of that item you already have (stored in a variable) in comparison to the level of the unit killed that drops the item. With a maximum of 50% drop chance. For example, if you have 20 food, and you kill a level 18 unit that drops food, there would be a 1 in 3 chance that it would drop.
All of this works fine, but in setting up the rate like this i found if you just leave the items on the ground, your chances for the drop will remain high, thus you can kill a respawn location to your hearts content. My remedy was to Set each item to a Variable as it spawned, wait 5 seconds, then despawn it. So i set up the following Trigger.
I have looked over it several times and see nothing wrong with my logic, spawning just 1 item at a time works ok, but if you happen to get 2 drops withing 5 seconds, it skips all but the last one that dropped in that time period and only despawns the very last one. The two Quest events were put in place to track this. If killing 2 in five seconds, it will read, Setting last item to 1... Setting last item to 2... Removing item 2. It seems to change the varable in a trigger that is still in progress even though the variable changed is (Interger A).
Thanks for the help, I believe to have a solution but would require 30-40 minutes of tedious if/then/else tricks that the loop 1 through 20 should cover.