Closed Drofseh closed 5 years ago
@Drofseh This is good stuff man. How much testing with it have you done? From what I can see if we do some basic testing and have a formal review I think this is good to merge!
I've done a reasonable amount of local testing and have been using fnc_addItemRandomPercent
for a while (albiet in a slightly different form that required the case chances to add to 100, thus why Percent is in the name).
I'm rolling these changes out to my unit this week for use in our missions, so I think it's good to go, but if you find anything strange in your tests I'm happy to fix bugs.
Please convert spaces to tabs so it follows convention of the rest of the framework.
Will merge after it gets some testing.
@BlackHawkPL I will do some testing with the mods listed below this week and submit my findings within the week. Mods for testing:
Please convert spaces to tabs so it follows convention of the rest of the framework.
@BlackHawkPL I thought the framework was being converted from tabs to spaces in a previous update. I remember a PR that did a bunch of it. Was I wrong about that?
hmm, looks like it is all tabs right now. I swear I remember a PR where there were apologies for making it unreadable because of the conversion to spaces though.
We have been using this for several weeks now without problem.
@Drofseh Thanks for the info, @BlackHawkPL good to merge after a quick review.
update fnc_addItem and fnc_addItemRandom to use Params command this is a little faster than using
private
for each variable and removes the need to useselect
add fnc_addItemRandomPercent This function adds items by randomly choosing with the
selectRandomWeighted
command The formatting is similar to fnc_addItemRandom with the addition of a weighted value for each case. The weighting is relative, all of these examples will produce the same odds: