From aaf1f8a00de3de19fbf1ffdfc995e3f45211a883 Mon Sep 17 00:00:00 2001 From: PoetryandLilies Date: Tue, 29 Oct 2024 23:08:15 +0000 Subject: [PATCH] Create array-weight.md Section for describing weighted arrays. --- doc_posts/_commands-array/array-weight.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc_posts/_commands-array/array-weight.md diff --git a/doc_posts/_commands-array/array-weight.md b/doc_posts/_commands-array/array-weight.md new file mode 100644 index 00000000..5da8db50 --- /dev/null +++ b/doc_posts/_commands-array/array-weight.md @@ -0,0 +1,16 @@ +--- +title: "Array Weights" +--- +Allows you to weight the chances of the Array Random command.\ +Useful for making certain array positions more or less common when returning a random value. + +To add weights to an array you must create a second array with the same name +_weight added to its name. + +Array positions in the weight array must match the original array to assign the correct weight to those positions. + +Setting the weight value to the same number for multiple positions will give those positions an equal chance to be picked value% of the time.\ +Setting the weight to 0 will make the chance 0 and it will not be picked in the Array Random command.\ +Numbers above 100 are possible but they will heavily weight the randomization towards that value.\ +Negative numbers are not possible but decimal numbers are. + +{% include example_public.html src="/docs/assets/images/commands-array/arrRand_Ex.png" size="100" title="Getting random array value based on different chances" pastebin="nR5kphiF" %}