Jump to content
Sign in to follow this  
PELHAM

Random script array showing favouritism?

Recommended Posts

I have written this script for a helicopter training mission that I hope to release soon. It's all about challenging landing and flying.

To control the accuracy of the LZ there are triggers and markers that change colour to show aircraft position. I am working on tight formation flying using a similar principle. I got the idea from Kylania of course;).

The problem:

This part of the code is supposed to generate a random LZ from a list of markers in an array. It tends to pick markers at the beginning of the array more frequently. I am so bored of "L2a" showing up more often, I have moved it several times during mission testing!

Any ideas about this? Can it be improved somehow?

//Random pos based on array and invisible H - pickup1

_markerlist2 = ["L2a","L2b","L2c","L2d","L2e","L2f","L2g"];

pickup1 setpos (getMarkerPos (_markerlist2 select (floor(random(count _markerlist2)))));

Full script:

// nul = [] execVM "scripts\LZ2AlignAll.sqf";

private ["_markerlist2"];

//Random pos based on array and invisible H - pickup1

_markerlist2 = ["L2a","L2b","L2c","L2d","L2e","L2f","L2g"];

pickup1 setpos (getMarkerPos (_markerlist2 select (floor(random(count _markerlist2)))));

sleep 1;

//Marker - shows LZ boundary on GPS

"p1" setMarkerPos (getPos pickup1);

//Triggers that are moved into position on the LZ

cargoout1 setPos (getPos pickup1);

trgLZ_1 setPos (getPos pickup1);

trgLZ_2 setPos (getPos pickup1);

trgLZ_3 setPos (getPos pickup1);

Task2_Complt setPos (getPos pickup1);

trgSmoke setPos (getPos pickup1);

//Tasks

player setCurrentTask tskDO1;

tskDO1 setTaskState "Assigned";

taskhint ["New Task\nInsert Delta at\nLanding Zone 2", [1, 1, 1, 1], "taskNew"];

tskDO1 setSimpleTaskDestination (getPos pickup1);

player addRating 100;

hint "LZ2Alignment";

Share this post


Link to post
Share on other sites

(floor(random 5))

should provide a random number between 0.0000 and 5.0000

so if its

0.00 - 0.99 its 0

1.00 - 1.99 its 1

2.00 - 2.99 its 2

3.00 - 3.99 its 3

4.00 - 4.99 its 4

So it should be an equal chance for all in an array to be selected.

That said, i have also noticed that first in array is favored, but its very random so cant really say for sure.

easy test would be to print to .rpt 1000 random selections out of an array containing 1000 different numbers. and look at the list, im sure it will be very random, but again, i sometimes have a feeling it favors the first ones, but when i am determined to catch it selecting the same array entry it surprises me and selects another.

One idea could be to shuffle the array itself before selecting.

just select random and add to an empty array until 1st array is empty and then final select floor random.... from the new array.

Pretty useless as the 1st array supposedly does that by random picking.

Edited by Demonized

Share this post


Link to post
Share on other sites

I understand that before we had computers they used to draw numbers out of a hat - never failed. LOL

I might do that instead of them being arranged in sequence.

Share this post


Link to post
Share on other sites

Yeah, the PRNG (pseudo-random number generator) of Arma 2 is pretty terrible sometimes. There's certainly no way to predict what is coming next, and given enough trials you might notice a pretty even distribution, but it likes to keep picking numbers around the same value when it gets into certain moods . . . if you google random number generators you're sure to find pictures which show this kind of distribution, where certain ordered patterns appear as artifacts of whatever algorithm they use to come up with the numbers.

Share this post


Link to post
Share on other sites

Place a unit and put this in its init:

one=0;two=0;three=0;four=0;five=0;0=[] spawn {while {true} do {sleep 0.001;switch (ceil random 5) do {case 1:{one=one+1};case 2:{two=two+1};case 3:{three=three+1};case 4:{four=four+1};case 5:{five=five+1}};hintSilent format ["%1\n%2\n%3\n%4\n%5",one,two,three,four,five]}}

I could not detect any favoritism toward any number, although there are some peculiar patterns. Set sleep to 0.0001 for lulz.

Edited by Celery

Share this post


Link to post
Share on other sites

Test of random picks:

script used:

_addNr = 0;
_mainCheckArr = [];
_addArr = [];
_checks = 3;
while {_checks != 0} do {
_number = 1;
_checkArr = [];
while {_number != 10} do {
	_checkArr = _checkArr + [_number];
	_number = _number + 1;
};
_number = 0;
diag_log format["this is the 10 random test"];
_addArr = ["this is the 10 random test"];
diag_log format["10______________________10"];
diag_log format["10______________________10"];
diag_log format["10______________________10"];
while {_number != 10} do {
	_addNr = _checkArr select (floor (random (count _checkArr)));
	diag_log format["%1",_addNr];
	_addArr = _addArr + [_addNr];
	_number = _number + 1;
};
_checks = _checks - 1;
_mainCheckArr = _mainCheckArr + [_addArr];
};

_checks = 3;
while {_checks != 0} do {
_number = 1;
_checkArr = [];
while {_number != 100} do {
	_checkArr = _checkArr + [_number];
	_number = _number + 1;
};
_number = 0;
diag_log format["this is the 100 random test"];
_addArr = ["this is the 100 random test"];
diag_log format["100______________________100"];
diag_log format["100______________________100"];
diag_log format["100______________________100"];
while {_number != 100} do {
	_addNr = _checkArr select (floor (random (count _checkArr)));
	diag_log format["%1",_addNr];
	_addArr = _addArr + [_addNr];
	_number = _number + 1;
};
_checks = _checks - 1;
_mainCheckArr = _mainCheckArr + [_addArr];
};

_checks = 3;
while {_checks != 0} do {
_number = 1;
_checkArr = [];
while {_number != 1000} do {
	_checkArr = _checkArr + [_number];
	_number = _number + 1;
};
_number = 0;
diag_log format["this is the 1000 random test"];
_addArr = ["this is the 1000 random test"];
diag_log format["1000______________________1000"];
diag_log format["1000______________________1000"];
diag_log format["1000______________________1000"];
while {_number != 1000} do {
	_addNr = _checkArr select (floor (random (count _checkArr)));
	diag_log format["%1",_addNr];
	_addArr = _addArr + [_addNr];
	_number = _number + 1;
};
_checks = _checks - 1;
_mainCheckArr = _mainCheckArr + [_addArr];
};
{diag_log format["%1",_x]} foreach _mainCheckArr;

hint "end script";

results in rpt, note array overview bottom of text:

"this is the 10 random test"
"10______________________10"
"10______________________10"
"10______________________10"
"8"
"2"
"6"
"9"
"7"
"1"
"4"
"4"
"5"
"7"
"this is the 10 random test"
"10______________________10"
"10______________________10"
"10______________________10"
"7"
"7"
"1"
"6"
"9"
"4"
"1"
"5"
"1"
"3"
"this is the 10 random test"
"10______________________10"
"10______________________10"
"10______________________10"
"6"
"5"
"9"
"5"
"8"
"8"
"7"
"7"
"4"
"7"
"this is the 100 random test"
"100______________________100"
"100______________________100"
"100______________________100"
"58"
"27"
"15"
"35"
"53"
"78"
"84"
"73"
"74"
"7"
"40"
"6"
"7"
"84"
"81"
"35"
"37"
"65"
"66"
"20"
"59"
"51"
"68"
"22"
"86"
"2"
"64"
"35"
"39"
"65"
"8"
"70"
"65"
"97"
"93"
"38"
"56"
"46"
"80"
"69"
"11"
"63"
"71"
"25"
"17"
"32"
"21"
"44"
"91"
"66"
"73"
"69"
"70"
"61"
"91"
"12"
"69"
"62"
"82"
"77"
"5"
"36"
"91"
"35"
"16"
"95"
"59"
"33"
"65"
"74"
"7"
"56"
"51"
"99"
"64"
"26"
"23"
"53"
"93"
"26"
"28"
"80"
"14"
"73"
"76"
"32"
"4"
"10"
"54"
"88"
"66"
"24"
"84"
"72"
"43"
"92"
"46"
"78"
"55"
"50"
"this is the 100 random test"
"100______________________100"
"100______________________100"
"100______________________100"
"52"
"37"
"69"
"63"
"25"
"50"
"56"
"33"
"33"
"83"
"33"
"90"
"50"
"90"
"87"
"24"
"90"
"37"
"40"
"83"
"89"
"89"
"57"
"9"
"79"
"61"
"74"
"42"
"24"
"53"
"39"
"44"
"75"
"8"
"36"
"94"
"97"
"95"
"90"
"90"
"39"
"57"
"31"
"22"
"92"
"26"
"4"
"35"
"15"
"46"
"97"
"70"
"56"
"19"
"5"
"88"
"71"
"83"
"59"
"50"
"54"
"74"
"74"
"87"
"77"
"54"
"29"
"22"
"68"
"64"
"21"
"68"
"16"
"5"
"42"
"74"
"26"
"64"
"81"
"41"
"33"
"27"
"29"
"81"
"72"
"77"
"66"
"42"
"29"
"20"
"29"
"59"
"74"
"43"
"34"
"77"
"85"
"42"
"34"
"93"
"this is the 100 random test"
"100______________________100"
"100______________________100"
"100______________________100"
"73"
"32"
"12"
"54"
"24"
"54"
"75"
"73"
"57"
"31"
"50"
"1"
"14"
"44"
"49"
"98"
"88"
"15"
"12"
"69"
"5"
"45"
"75"
"80"
"57"
"6"
"2"
"32"
"9"
"35"
"93"
"26"
"79"
"18"
"36"
"59"
"8"
"30"
"3"
"19"
"24"
"94"
"46"
"92"
"10"
"59"
"31"
"75"
"90"
"25"
"17"
"92"
"36"
"33"
"48"
"98"
"9"
"56"
"69"
"91"
"44"
"92"
"12"
"10"
"88"
"93"
"76"
"18"
"96"
"52"
"55"
"80"
"2"
"74"
"18"
"17"
"60"
"29"
"8"
"38"
"98"
"49"
"70"
"56"
"43"
"51"
"58"
"69"
"70"
"37"
"39"
"19"
"70"
"69"
"51"
"6"
"40"
"71"
"24"
"84"
"this is the 1000 random test"
"1000______________________1000"
"1000______________________1000"
"1000______________________1000"
"42"
"408"
"217"
"995"
"973"
"339"
"205"
"984"
"858"
"87"
"710"
"831"
"670"
"779"
"678"
"260"
"310"
"689"
"749"
"218"
"173"
"357"
"228"
"969"
"530"
"211"
"325"
"489"
"42"
"156"
"790"
"360"
"275"
"95"
"517"
"912"
"543"
"858"
"210"
"812"
"932"
"505"
"723"
"811"
"845"
"462"
"152"
"899"
"909"
"481"
"267"
"555"
"597"
"868"
"403"
"322"
"394"
"966"
"375"
"435"
"871"
"348"
"533"
"711"
"490"
"705"
"535"
"412"
"494"
"879"
"941"
"320"
"731"
"28"
"224"
"730"
"742"
"367"
"275"
"577"
"968"
"495"
"18"
"423"
"417"
"725"
"217"
"520"
"628"
"432"
"65"
"673"
"292"
"851"
"660"
"107"
"351"
"327"
"949"
"71"
"941"
"456"
"248"
"396"
"6"
"109"
"915"
"722"
"935"
"787"
"292"
"609"
"72"
"301"
"477"
"258"
"418"
"215"
"63"
"62"
"404"
"48"
"395"
"694"
"51"
"693"
"464"
"971"
"367"
"16"
"34"
"185"
"342"
"109"
"69"
"145"
"350"
"174"
"94"
"638"
"345"
"488"
"542"
"531"
"651"
"441"
"714"
"218"
"730"
"91"
"429"
"660"
"738"
"222"
"955"
"710"
"238"
"373"
"331"
"950"
"890"
"797"
"652"
"771"
"497"
"827"
"438"
"889"
"203"
"613"
"647"
"48"
"231"
"700"
"457"
"96"
"979"
"425"
"393"
"177"
"827"
"579"
"896"
"250"
"492"
"330"
"934"
"649"
"288"
"855"
"739"
"906"
"117"
"665"
"267"
"562"
"552"
"72"
"484"
"174"
"845"
"789"
"60"
"241"
"202"
"126"
"564"
"276"
"176"
"730"
"768"
"727"
"526"
"372"
"138"
"981"
"368"
"718"
"112"
"160"
"978"
"578"
"262"
"920"
"86"
"582"
"928"
"13"
"997"
"767"
"427"
"759"
"404"
"32"
"407"
"223"
"206"
"933"
"482"
"262"
"201"
"804"
"691"
"183"
"987"
"632"
"923"
"228"
"914"
"701"
"860"
"608"
"432"
"444"
"566"
"295"
"681"
"480"
"287"
"293"
"664"
"312"
"582"
"625"
"848"
"638"
"362"
"722"
"538"
"762"
"924"
"465"
"861"
"64"
"606"
"573"
"716"
"990"
"114"
"577"
"522"
"561"
"149"
"82"
"115"
"825"
"412"
"547"
"630"
"258"
"580"
"294"
"729"
"570"
"360"
"971"
"991"
"876"
"187"
"184"
"835"
"719"
"699"
"513"
"804"
"890"
"551"
"649"
"560"
"545"
"666"
"837"
"427"
"550"
"538"
"384"
"834"
"564"
"653"
"416"
"504"
"786"
"646"
"624"
"713"
"875"
"261"
"216"
"489"
"983"
"740"
"770"
"79"
"380"
"708"
"255"
"525"
"641"
"157"
"878"
"712"
"864"
"628"
"37"
"706"
"889"
"182"
"38"
"745"
"970"
"240"
"857"
"717"
"900"
"911"
"613"
"480"
"32"
"883"
"993"
"844"
"164"
"475"
"365"
"593"
"789"
"944"
"754"
"359"
"635"
"649"
"449"
"708"
"986"
"146"
"420"
"285"
"766"
"831"
"286"
"343"
"823"
"212"
"49"
"529"
"409"
"398"
"305"
"237"
"308"
"916"
"162"
"400"
"590"
"436"
"569"
"48"
"462"
"498"
"298"
"486"
"164"
"847"
"267"
"427"
"415"
"453"
"453"
"926"
"340"
"826"
"89"
"470"
"372"
"705"
"383"
"42"
"87"
"722"
"467"
"536"
"446"
"145"
"792"
"344"
"406"
"263"
"702"
"455"
"378"
"551"
"388"
"931"
"488"
"164"
"956"
"93"
"127"
"883"
"817"
"244"
"737"
"106"
"125"
"309"
"331"
"948"
"473"
"200"
"676"
"95"
"582"
"273"
"653"
"445"
"180"
"709"
"721"
"189"
"804"
"171"
"988"
"379"
"749"
"563"
"834"
"605"
"861"
"273"
"562"
"860"
"417"
"689"
"54"
"198"
"793"
"388"
"886"
"266"
"152"
"794"
"891"
"318"
"854"
"686"
"608"
"789"
"834"
"372"
"616"
"41"
"631"
"894"
"215"
"353"
"321"
"93"
"401"
"771"
"44"
"877"
"635"
"901"
"373"
"561"
"353"
"227"
"212"
"580"
"693"
"74"
"469"
"459"
"414"
"789"
"205"
"358"
"456"
"244"
"487"
"51"
"140"
"240"
"661"
"671"
"445"
"934"
"263"
"74"
"353"
"858"
"285"
"161"
"725"
"620"
"23"
"1"
"667"
"910"
"215"
"101"
"872"
"882"
"693"
"670"
"892"
"500"
"274"
"216"
"813"
"965"
"87"
"309"
"310"
"798"
"89"
"886"
"535"
"683"
"954"
"908"
"825"
"652"
"84"
"722"
"682"
"720"
"925"
"991"
"1"
"560"
"357"
"507"
"18"
"296"
"314"
"750"
"946"
"35"
"420"
"529"
"762"
"208"
"800"
"553"
"111"
"327"
"826"
"274"
"811"
"249"
"993"
"837"
"921"
"534"
"659"
"504"
"824"
"4"
"859"
"364"
"321"
"81"
"911"
"705"
"188"
"14"
"38"
"862"
"165"
"572"
"722"
"912"
"856"
"318"
"16"
"36"
"498"
"27"
"508"
"906"
"70"
"377"
"195"
"947"
"712"
"481"
"949"
"791"
"937"
"363"
"820"
"791"
"569"
"970"
"870"
"940"
"911"
"824"
"789"
"17"
"102"
"883"
"976"
"323"
"116"
"735"
"337"
"848"
"396"
"693"
"484"
"204"
"571"
"906"
"594"
"171"
"240"
"62"
"610"
"214"
"279"
"784"
"21"
"788"
"652"
"323"
"944"
"803"
"188"
"616"
"713"
"65"
"284"
"336"
"699"
"64"
"32"
"993"
"589"
"931"
"696"
"715"
"826"
"927"
"51"
"768"
"446"
"280"
"513"
"438"
"15"
"745"
"572"
"350"
"896"
"716"
"448"
"823"
"563"
"228"
"482"
"368"
"173"
"702"
"206"
"888"
"123"
"778"
"563"
"721"
"813"
"68"
"261"
"77"
"322"
"186"
"707"
"989"
"222"
"893"
"511"
"368"
"258"
"702"
"10"
"233"
"98"
"778"
"800"
"753"
"874"
"493"
"730"
"152"
"749"
"469"
"328"
"95"
"201"
"456"
"136"
"639"
"272"
"880"
"918"
"355"
"478"
"426"
"212"
"690"
"612"
"473"
"179"
"200"
"152"
"746"
"255"
"702"
"497"
"22"
"525"
"984"
"745"
"220"
"337"
"136"
"244"
"749"
"84"
"102"
"606"
"430"
"647"
"563"
"446"
"840"
"468"
"719"
"523"
"443"
"701"
"85"
"528"
"324"
"434"
"879"
"228"
"882"
"436"
"120"
"182"
"339"
"405"
"985"
"762"
"375"
"175"
"579"
"675"
"770"
"872"
"651"
"727"
"377"
"462"
"401"
"33"
"261"
"677"
"934"
"400"
"375"
"784"
"478"
"98"
"595"
"161"
"944"
"734"
"458"
"155"
"941"
"463"
"464"
"190"
"817"
"229"
"266"
"584"
"836"
"282"
"603"
"63"
"77"
"674"
"317"
"414"
"157"
"951"
"298"
"282"
"360"
"773"
"702"
"536"
"273"
"668"
"279"
"212"
"526"
"641"
"166"
"479"
"717"
"865"
"976"
"602"
"136"
"168"
"548"
"377"
"355"
"521"
"162"
"992"
"308"
"275"
"613"
"806"
"926"
"338"
"954"
"986"
"946"
"27"
"250"
"501"
"964"
"806"
"214"
"410"
"350"
"634"
"41"
"944"
"91"
"137"
"299"
"331"
"190"
"323"
"216"
"830"
"678"
"68"
"205"
"967"
"866"
"76"
"975"
"409"
"899"
"547"
"73"
"465"
"240"
"261"
"187"
"693"
"141"
"297"
"79"
"545"
"734"
"122"
"464"
"557"
"797"
"241"
"698"
"33"
"820"
"153"
"612"
"694"
"441"
"815"
"335"
"265"
"867"
"342"
"453"
"462"
"361"
"154"
"342"
"360"
"379"
"295"
"26"
"594"
"484"
"143"
"399"
"377"
"592"
"227"
"158"
"791"
"669"
"360"
"283"
"336"
"464"
"837"
"420"
"184"
"372"
"878"
"998"
"127"
"23"
"59"
"442"
"675"
"687"
"949"
"293"
"283"
"98"
"668"
"621"
"156"
"771"
"568"
"541"
"634"
"432"
"792"
"190"
"590"
"631"
"898"
"9"
"835"
"152"
"277"
"667"
"984"
"294"
"587"
"485"
"766"
"633"
"927"
"682"
"226"
"351"
"946"
"this is the 1000 random test"
"1000______________________1000"
"1000______________________1000"
"1000______________________1000"
"40"
"146"
"643"
"650"
"368"
"145"
"554"
"225"
"478"
"265"
"39"
"609"
"767"
"49"
"371"
"945"
"203"
"145"
"12"
"398"
"122"
"739"
"632"
"809"
"475"
"646"
"810"
"616"
"749"
"11"
"189"
"231"
"851"
"273"
"40"
"348"
"258"
"744"
"344"
"382"
"291"
"722"
"962"
"774"
"839"
"649"
"6"
"359"
"395"
"264"
"982"
"544"
"724"
"223"
"847"
"487"
"42"
"148"
"497"
"20"
"5"
"495"
"37"
"921"
"352"
"681"
"838"
"386"
"388"
"920"
"451"
"261"
"642"
"493"
"666"
"251"
"224"
"650"
"482"
"159"
"520"
"393"
"351"
"665"
"117"
"879"
"41"
"172"
"314"
"194"
"457"
"179"
"338"
"693"
"269"
"150"
"837"
"645"
"678"
"353"
"766"
"379"
"181"
"634"
"238"
"677"
"662"
"596"
"442"
"607"
"671"
"904"
"317"
"723"
"730"
"856"
"339"
"354"
"512"
"78"
"949"
"748"
"990"
"803"
"714"
"586"
"351"
"552"
"889"
"868"
"932"
"263"
"713"
"768"
"545"
"369"
"814"
"881"
"715"
"141"
"215"
"992"
"62"
"138"
"890"
"932"
"535"
"124"
"364"
"638"
"729"
"291"
"293"
"991"
"990"
"119"
"530"
"544"
"542"
"729"
"611"
"712"
"659"
"589"
"215"
"459"
"405"
"415"
"825"
"964"
"916"
"546"
"545"
"40"
"85"
"339"
"582"
"119"
"66"
"638"
"868"
"331"
"433"
"879"
"722"
"359"
"542"
"681"
"76"
"941"
"220"
"131"
"143"
"5"
"365"
"499"
"851"
"877"
"554"
"584"
"898"
"578"
"245"
"420"
"751"
"623"
"679"
"557"
"466"
"334"
"63"
"642"
"2"
"379"
"927"
"745"
"371"
"541"
"158"
"695"
"434"
"967"
"572"
"765"
"187"
"167"
"166"
"812"
"36"
"546"
"566"
"458"
"800"
"160"
"913"
"602"
"856"
"420"
"113"
"450"
"271"
"746"
"62"
"775"
"274"
"619"
"950"
"627"
"909"
"3"
"217"
"218"
"198"
"615"
"267"
"190"
"177"
"477"
"707"
"588"
"915"
"447"
"978"
"18"
"549"
"455"
"215"
"471"
"722"
"423"
"532"
"240"
"360"
"910"
"990"
"393"
"447"
"496"
"405"
"608"
"354"
"602"
"122"
"409"
"982"
"799"
"361"
"431"
"250"
"361"
"460"
"549"
"886"
"677"
"719"
"215"
"15"
"602"
"74"
"845"
"465"
"348"
"312"
"611"
"328"
"998"
"60"
"508"
"597"
"696"
"245"
"646"
"114"
"748"
"805"
"415"
"996"
"729"
"268"
"629"
"236"
"459"
"255"
"196"
"657"
"948"
"24"
"383"
"693"
"14"
"843"
"79"
"754"
"99"
"193"
"810"
"99"
"199"
"805"
"221"
"738"
"982"
"799"
"849"
"342"
"690"
"595"
"561"
"600"
"924"
"851"
"462"
"37"
"908"
"131"
"313"
"518"
"651"
"803"
"249"
"911"
"855"
"538"
"514"
"687"
"23"
"917"
"233"
"170"
"433"
"657"
"834"
"760"
"998"
"916"
"99"
"864"
"749"
"25"
"101"
"922"
"572"
"590"
"928"
"165"
"312"
"722"
"125"
"272"
"296"
"32"
"220"
"43"
"494"
"243"
"327"
"662"
"37"
"766"
"265"
"663"
"312"
"68"
"175"
"177"
"558"
"731"
"295"
"579"
"991"
"720"
"436"
"424"
"164"
"690"
"495"
"157"
"740"
"967"
"903"
"465"
"410"
"847"
"865"
"183"
"668"
"494"
"566"
"865"
"751"
"703"
"464"
"741"
"112"
"784"
"94"
"590"
"202"
"435"
"961"
"781"
"63"
"809"
"363"
"435"
"333"
"509"
"477"
"174"
"760"
"714"
"569"
"433"
"173"
"656"
"804"
"485"
"259"
"481"
"376"
"886"
"832"
"118"
"537"
"721"
"279"
"53"
"707"
"68"
"592"
"367"
"181"
"884"
"553"
"567"
"347"
"51"
"826"
"803"
"348"
"451"
"926"
"418"
"506"
"100"
"985"
"146"
"584"
"230"
"907"
"531"
"680"
"153"
"778"
"529"
"349"
"593"
"846"
"760"
"39"
"438"
"668"
"641"
"100"
"837"
"510"
"106"
"118"
"82"
"837"
"805"
"779"
"218"
"732"
"95"
"536"
"525"
"539"
"426"
"348"
"466"
"892"
"90"
"129"
"838"
"897"
"991"
"430"
"4"
"4"
"665"
"846"
"682"
"884"
"678"
"207"
"764"
"111"
"203"
"91"
"669"
"65"
"625"
"389"
"596"
"577"
"280"
"132"
"522"
"245"
"293"
"283"
"909"
"988"
"798"
"576"
"252"
"326"
"459"
"247"
"979"
"356"
"34"
"672"
"582"
"394"
"414"
"935"
"935"
"728"
"708"
"30"
"972"
"20"
"809"
"609"
"882"
"880"
"785"
"738"
"957"
"504"
"277"
"780"
"518"
"763"
"321"
"198"
"530"
"261"
"39"
"658"
"79"
"987"
"541"
"929"
"781"
"808"
"269"
"563"
"963"
"283"
"807"
"775"
"311"
"225"
"910"
"783"
"238"
"69"
"519"
"296"
"901"
"939"
"587"
"528"
"762"
"78"
"315"
"479"
"97"
"630"
"8"
"402"
"390"
"524"
"884"
"457"
"160"
"289"
"528"
"751"
"819"
"480"
"381"
"276"
"698"
"965"
"576"
"728"
"167"
"917"
"46"
"763"
"95"
"359"
"870"
"292"
"543"
"462"
"810"
"35"
"811"
"456"
"401"
"900"
"726"
"70"
"251"
"914"
"180"
"184"
"31"
"556"
"383"
"667"
"157"
"766"
"129"
"936"
"351"
"796"
"181"
"810"
"288"
"874"
"469"
"127"
"236"
"562"
"753"
"155"
"181"
"34"
"955"
"287"
"736"
"62"
"30"
"590"
"304"
"617"
"56"
"127"
"169"
"293"
"376"
"266"
"133"
"817"
"852"
"34"
"45"
"812"
"186"
"626"
"768"
"333"
"154"
"522"
"685"
"415"
"595"
"980"
"464"
"666"
"905"
"915"
"198"
"235"
"169"
"748"
"808"
"803"
"462"
"252"
"547"
"647"
"156"
"593"
"343"
"831"
"906"
"759"
"439"
"679"
"54"
"174"
"797"
"341"
"722"
"149"
"246"
"756"
"301"
"150"
"982"
"243"
"682"
"393"
"673"
"60"
"300"
"957"
"664"
"253"
"460"
"895"
"969"
"975"
"779"
"615"
"968"
"327"
"888"
"542"
"21"
"155"
"102"
"763"
"140"
"887"
"334"
"858"
"562"
"221"
"371"
"67"
"274"
"432"
"176"
"119"
"527"
"680"
"747"
"433"
"868"
"260"
"625"
"578"
"714"
"976"
"69"
"599"
"92"
"179"
"696"
"638"
"685"
"347"
"207"
"443"
"325"
"769"
"369"
"840"
"288"
"533"
"832"
"733"
"39"
"961"
"389"
"552"
"980"
"651"
"886"
"438"
"311"
"394"
"431"
"888"
"272"
"71"
"524"
"978"
"591"
"645"
"89"
"804"
"182"
"256"
"967"
"784"
"310"
"723"
"769"
"714"
"871"
"893"
"250"
"423"
"649"
"906"
"668"
"422"
"180"
"944"
"54"
"481"
"526"
"165"
"247"
"255"
"236"
"214"
"863"
"827"
"168"
"369"
"649"
"269"
"685"
"741"
"692"
"14"
"465"
"221"
"225"
"145"
"770"
"548"
"911"
"366"
"334"
"82"
"236"
"567"
"868"
"748"
"304"
"460"
"113"
"521"
"15"
"149"
"611"
"671"
"27"
"684"
"518"
"489"
"857"
"408"
"209"
"56"
"88"
"46"
"23"
"552"
"451"
"564"
"482"
"268"
"223"
"173"
"683"
"14"
"285"
"906"
"368"
"536"
"120"
"920"
"94"
"977"
"15"
"967"
"528"
"416"
"294"
"662"
"60"
"890"
"577"
"636"
"395"
"143"
"211"
"880"
"515"
"241"
"470"
"832"
"829"
"668"
"278"
"740"
"369"
"426"
"56"
"210"
"571"
"747"
"513"
"915"
"107"
"807"
"978"
"103"
"98"
"259"
"656"
"658"
"555"
"802"
"852"
"835"
"595"
"931"
"123"
"714"
"948"
"440"
"722"
"690"
"289"
"792"
"496"
"860"
"259"
"505"
"817"
"65"
"984"
"179"
"61"
"649"
"263"
"483"
"694"
"440"
"474"
"804"
"970"
"247"
"507"
"961"
"474"
"517"
"811"
"885"
"727"
"82"
"582"
"338"
"742"
"963"
"706"
"652"
"this is the 1000 random test"
"1000______________________1000"
"1000______________________1000"
"1000______________________1000"
"532"
"807"
"506"
"220"
"635"
"335"
"197"
"96"
"295"
"447"
"283"
"301"
"154"
"743"
"102"
"443"
"383"
"969"
"955"
"243"
"833"
"788"
"161"
"776"
"620"
"437"
"764"
"968"
"625"
"340"
"777"
"501"
"886"
"248"
"142"
"369"
"820"
"61"
"282"
"277"
"38"
"151"
"799"
"164"
"717"
"784"
"20"
"179"
"10"
"745"
"621"
"961"
"440"
"734"
"54"
"570"
"776"
"655"
"972"
"897"
"337"
"377"
"409"
"924"
"194"
"62"
"884"
"199"
"26"
"714"
"631"
"110"
"806"
"723"
"591"
"614"
"541"
"972"
"801"
"61"
"664"
"915"
"270"
"800"
"972"
"258"
"453"
"612"
"330"
"617"
"190"
"599"
"977"
"845"
"950"
"792"
"249"
"968"
"998"
"173"
"73"
"218"
"561"
"334"
"86"
"128"
"595"
"498"
"704"
"153"
"250"
"113"
"993"
"794"
"612"
"738"
"698"
"678"
"121"
"524"
"215"
"583"
"793"
"955"
"606"
"91"
"257"
"994"
"634"
"938"
"850"
"169"
"29"
"237"
"507"
"315"
"736"
"556"
"121"
"704"
"221"
"901"
"907"
"640"
"212"
"160"
"520"
"901"
"348"
"118"
"96"
"855"
"695"
"635"
"985"
"597"
"610"
"86"
"370"
"954"
"911"
"635"
"474"
"698"
"829"
"470"
"623"
"807"
"56"
"329"
"149"
"684"
"322"
"223"
"209"
"937"
"243"
"698"
"484"
"58"
"481"
"898"
"929"
"902"
"183"
"261"
"187"
"738"
"794"
"865"
"781"
"704"
"852"
"1"
"654"
"672"
"845"
"191"
"876"
"490"
"734"
"392"
"874"
"59"
"231"
"571"
"34"
"221"
"423"
"399"
"999"
"936"
"849"
"265"
"540"
"695"
"603"
"297"
"167"
"649"
"928"
"134"
"721"
"404"
"69"
"184"
"855"
"394"
"554"
"613"
"982"
"266"
"859"
"708"
"442"
"125"
"317"
"834"
"888"
"454"
"104"
"888"
"427"
"562"
"765"
"153"
"970"
"670"
"517"
"377"
"773"
"217"
"17"
"457"
"629"
"481"
"841"
"536"
"681"
"123"
"387"
"870"
"340"
"726"
"401"
"326"
"963"
"441"
"560"
"908"
"568"
"176"
"353"
"802"
"625"
"789"
"937"
"696"
"157"
"304"
"604"
"408"
"787"
"615"
"526"
"639"
"47"
"26"
"919"
"603"
"862"
"854"
"804"
"978"
"608"
"294"
"802"
"910"
"45"
"977"
"59"
"268"
"5"
"242"
"893"
"893"
"157"
"536"
"276"
"50"
"704"
"958"
"698"
"780"
"958"
"463"
"97"
"637"
"803"
"831"
"33"
"47"
"447"
"102"
"982"
"651"
"114"
"24"
"2"
"599"
"938"
"755"
"946"
"90"
"308"
"119"
"381"
"283"
"368"
"816"
"152"
"640"
"193"
"878"
"296"
"664"
"18"
"565"
"128"
"9"
"137"
"431"
"841"
"437"
"556"
"788"
"486"
"587"
"994"
"424"
"571"
"661"
"362"
"469"
"786"
"468"
"823"
"527"
"133"
"226"
"619"
"461"
"71"
"459"
"742"
"575"
"308"
"730"
"912"
"747"
"434"
"577"
"549"
"560"
"357"
"241"
"386"
"790"
"938"
"972"
"170"
"590"
"493"
"467"
"225"
"966"
"132"
"892"
"232"
"46"
"54"
"750"
"52"
"85"
"370"
"285"
"949"
"703"
"566"
"647"
"62"
"148"
"433"
"662"
"155"
"560"
"726"
"773"
"182"
"117"
"514"
"72"
"376"
"657"
"771"
"606"
"195"
"814"
"375"
"392"
"424"
"492"
"539"
"213"
"746"
"283"
"611"
"865"
"934"
"387"
"359"
"1"
"169"
"690"
"373"
"383"
"285"
"97"
"79"
"652"
"147"
"989"
"292"
"184"
"888"
"147"
"812"
"143"
"227"
"566"
"291"
"897"
"904"
"125"
"840"
"594"
"573"
"786"
"327"
"745"
"368"
"592"
"88"
"863"
"14"
"387"
"227"
"242"
"23"
"839"
"321"
"101"
"198"
"882"
"760"
"210"
"687"
"567"
"738"
"837"
"800"
"354"
"919"
"871"
"601"
"820"
"868"
"46"
"523"
"11"
"105"
"218"
"567"
"143"
"109"
"181"
"831"
"333"
"325"
"524"
"874"
"440"
"557"
"312"
"504"
"270"
"835"
"416"
"571"
"913"
"185"
"786"
"495"
"229"
"333"
"937"
"413"
"198"
"696"
"531"
"564"
"90"
"885"
"353"
"605"
"369"
"441"
"473"
"544"
"852"
"306"
"889"
"751"
"261"
"1"
"631"
"981"
"963"
"872"
"162"
"402"
"505"
"144"
"434"
"89"
"274"
"629"
"942"
"663"
"330"
"69"
"413"
"687"
"808"
"731"
"173"
"986"
"214"
"110"
"320"
"975"
"876"
"235"
"738"
"330"
"515"
"877"
"759"
"47"
"447"
"69"
"303"
"86"
"267"
"979"
"622"
"337"
"926"
"332"
"136"
"58"
"223"
"687"
"664"
"594"
"692"
"86"
"625"
"634"
"194"
"270"
"39"
"944"
"786"
"199"
"446"
"227"
"353"
"857"
"332"
"14"
"180"
"580"
"567"
"719"
"309"
"245"
"947"
"788"
"521"
"505"
"59"
"317"
"76"
"258"
"374"
"148"
"71"
"264"
"54"
"577"
"964"
"722"
"555"
"37"
"740"
"596"
"774"
"113"
"955"
"2"
"760"
"433"
"957"
"996"
"253"
"189"
"866"
"605"
"410"
"978"
"929"
"180"
"675"
"651"
"173"
"874"
"420"
"310"
"641"
"945"
"196"
"4"
"784"
"384"
"612"
"378"
"618"
"916"
"927"
"664"
"369"
"844"
"527"
"214"
"980"
"238"
"612"
"508"
"5"
"345"
"584"
"905"
"502"
"55"
"494"
"369"
"17"
"293"
"663"
"626"
"360"
"363"
"584"
"306"
"252"
"664"
"239"
"985"
"215"
"7"
"926"
"389"
"130"
"284"
"650"
"694"
"513"
"485"
"951"
"792"
"666"
"39"
"764"
"499"
"675"
"598"
"46"
"287"
"187"
"942"
"500"
"686"
"757"
"602"
"935"
"64"
"158"
"842"
"586"
"595"
"358"
"693"
"339"
"35"
"491"
"893"
"726"
"891"
"83"
"844"
"911"
"401"
"453"
"418"
"510"
"273"
"818"
"172"
"354"
"402"
"305"
"656"
"513"
"582"
"847"
"660"
"70"
"664"
"747"
"333"
"691"
"506"
"53"
"765"
"814"
"317"
"724"
"532"
"152"
"181"
"240"
"833"
"541"
"966"
"708"
"994"
"623"
"106"
"592"
"229"
"965"
"233"
"66"
"826"
"944"
"844"
"988"
"583"
"347"
"824"
"132"
"151"
"526"
"517"
"377"
"89"
"288"
"533"
"592"
"641"
"763"
"581"
"710"
"965"
"342"
"173"
"723"
"145"
"781"
"505"
"988"
"882"
"728"
"607"
"376"
"402"
"676"
"420"
"687"
"732"
"547"
"405"
"465"
"969"
"101"
"131"
"90"
"300"
"421"
"916"
"923"
"491"
"448"
"147"
"115"
"597"
"817"
"652"
"611"
"796"
"320"
"225"
"612"
"295"
"762"
"26"
"160"
"439"
"306"
"454"
"31"
"418"
"896"
"411"
"721"
"262"
"591"
"959"
"655"
"484"
"536"
"313"
"936"
"56"
"68"
"315"
"814"
"552"
"996"
"398"
"972"
"229"
"646"
"949"
"528"
"719"
"961"
"237"
"42"
"413"
"135"
"158"
"610"
"933"
"167"
"338"
"683"
"366"
"539"
"220"
"786"
"764"
"941"
"345"
"327"
"224"
"740"
"642"
"603"
"893"
"784"
"701"
"637"
"429"
"736"
"397"
"152"
"358"
"396"
"203"
"477"
"190"
"212"
"130"
"740"
"598"
"805"
"719"
"288"
"69"
"923"
"686"
"641"
"927"
"161"
"231"
"188"
"4"
"558"
"796"
"638"
"469"
"461"
"571"
"776"
"344"
"648"
"610"
"23"
"717"
"41"
"920"
"546"
"360"
"455"
"948"
"882"
"996"
"502"
"945"
"77"
"465"
"873"
"997"
"790"
"529"
"192"
"704"
"527"
"172"
"47"
"838"
"509"
"86"
"785"
"751"
"812"
"462"
"879"
"179"
"490"
"984"
"863"
"845"
"403"
"688"
"418"
"236"
"384"
"612"
"644"
"250"
"422"
"303"
"441"
"146"
"289"
"840"
"385"
"831"
"638"
"226"
"113"
"770"
"736"
"355"
"50"
"973"
"836"
"["this is the 10 random test",8,2,6,9,7,1,4,4,5,7]"
"["this is the 10 random test",7,7,1,6,9,4,1,5,1,3]"
"["this is the 10 random test",6,5,9,5,8,8,7,7,4,7]"
"["this is the 100 random test",58,27,15,35,53,78,84,73,74,7,40,6,7,84,81,35,37,65,66,20,59,51,68,22,86,2,64,35,39,65,8,70,65,97,93,38,56,46,80,69,11,63,71,25,17,32,21,44,91,66,73,69,70,61,91,12,69,62,82,77,5,36,91,35,16,95,59,33,65,74,7,56,51,99,64,26,23,53,93,26,28,80,14,73,76,32,4,10,54,88,66,24,84,72,43,92,46,78,55,50]"
"["this is the 100 random test",52,37,69,63,25,50,56,33,33,83,33,90,50,90,87,24,90,37,40,83,89,89,57,9,79,61,74,42,24,53,39,44,75,8,36,94,97,95,90,90,39,57,31,22,92,26,4,35,15,46,97,70,56,19,5,88,71,83,59,50,54,74,74,87,77,54,29,22,68,64,21,68,16,5,42,74,26,64,81,41,33,27,29,81,72,77,66,42,29,20,29,59,74,43,34,77,85,42,34,93]"
"["this is the 100 random test",73,32,12,54,24,54,75,73,57,31,50,1,14,44,49,98,88,15,12,69,5,45,75,80,57,6,2,32,9,35,93,26,79,18,36,59,8,30,3,19,24,94,46,92,10,59,31,75,90,25,17,92,36,33,48,98,9,56,69,91,44,92,12,10,88,93,76,18,96,52,55,80,2,74,18,17,60,29,8,38,98,49,70,56,43,51,58,69,70,37,39,19,70,69,51,6,40,71,24,84]"
"["this is the 1000 random test",42,408,217,995,973,339,205,984,858,87,710,831,670,779,678,260,310,689,749,218,173,357,228,969,530,211,325,489,42,156,790,360,275,95,517,912,543,858,210,812,932,505,723,811,845,462,152,899,909,481,267,555,597,868,403,322,394,966,375,435,871,348,533,711,490,705,535,412,494,879,941,320,731,28,224,730,742,367,275,577,968,495,18,423,417,725,217,520,628,432,65,673,292,851,660,107,351,327,949,71,941,456,248,396,6,109,915,722,935,787,292,609,72,301,477,258,418,215,63,62,404,48,395,694,51,693,464,971,367,16,34,185,342,109,69,145,350,174,94,638,345,488,542,531,651,441,714,218,730,91,429,660,738,222,955,710,238,373,331,950,890,797,652,771,497,827,438,889,203,613,647,48,231,700,457,96,979,425,393,177,827,579,896,250,492,330,934,649,288,855,739,906,117,665,267,562,552,72,484,174,845,789,60,241,202,126,564,276,176,730,768,727,526,372,138,981,368,718,112,160,978,578,262,920,86,582,928,13,997,767,427,759,404,32,407,223,206,933,482,262,201,804,691,183,987,632,923,228,914,701,860,608,432,444,5
"["this is the 1000 random test",40,146,643,650,368,145,554,225,478,265,39,609,767,49,371,945,203,145,12,398,122,739,632,809,475,646,810,616,749,11,189,231,851,273,40,348,258,744,344,382,291,722,962,774,839,649,6,359,395,264,982,544,724,223,847,487,42,148,497,20,5,495,37,921,352,681,838,386,388,920,451,261,642,493,666,251,224,650,482,159,520,393,351,665,117,879,41,172,314,194,457,179,338,693,269,150,837,645,678,353,766,379,181,634,238,677,662,596,442,607,671,904,317,723,730,856,339,354,512,78,949,748,990,803,714,586,351,552,889,868,932,263,713,768,545,369,814,881,715,141,215,992,62,138,890,932,535,124,364,638,729,291,293,991,990,119,530,544,542,729,611,712,659,589,215,459,405,415,825,964,916,546,545,40,85,339,582,119,66,638,868,331,433,879,722,359,542,681,76,941,220,131,143,5,365,499,851,877,554,584,898,578,245,420,751,623,679,557,466,334,63,642,2,379,927,745,371,541,158,695,434,967,572,765,187,167,166,812,36,546,566,458,800,160,913,602,856,420,113,450,271,746,62,775,274,619,950,627,909,3,217,218,198,615,267
"["this is the 1000 random test",532,807,506,220,635,335,197,96,295,447,283,301,154,743,102,443,383,969,955,243,833,788,161,776,620,437,764,968,625,340,777,501,886,248,142,369,820,61,282,277,38,151,799,164,717,784,20,179,10,745,621,961,440,734,54,570,776,655,972,897,337,377,409,924,194,62,884,199,26,714,631,110,806,723,591,614,541,972,801,61,664,915,270,800,972,258,453,612,330,617,190,599,977,845,950,792,249,968,998,173,73,218,561,334,86,128,595,498,704,153,250,113,993,794,612,738,698,678,121,524,215,583,793,955,606,91,257,994,634,938,850,169,29,237,507,315,736,556,121,704,221,901,907,640,212,160,520,901,348,118,96,855,695,635,985,597,610,86,370,954,911,635,474,698,829,470,623,807,56,329,149,684,322,223,209,937,243,698,484,58,481,898,929,902,183,261,187,738,794,865,781,704,852,1,654,672,845,191,876,490,734,392,874,59,231,571,34,221,423,399,999,936,849,265,540,695,603,297,167,649,928,134,721,404,69,184,855,394,554,613,982,266,859,708,442,125,317,834,888,454,104,888,427,562,765,153,970,670,517,377,773,217,17,4

Conclusion, random is random, there are some patterns but they disappear within one of the 3 attempts on each of the 10, 100 or 1000 checks.

So they are ruled as coincidence imo. :)

Share this post


Link to post
Share on other sites

If you think the first one comes up too often, do a bigger random and modulo the result. For checks, do a number of tests and count how often they show up. There is no way that 0, 5, 10, 15, 20, and 25 (mod 5 all equals 0) would be equally represented, right? For kicks, also add in player direction (or a random players direction if server), and time, to add to the parameter.

I tried it and it gives no special results compared to the simple version. My only wish regarding random numbers would be the possibility to feed it a seed number, so I could have consistent random numbers useful for bug hunting.

The point about random numbers is that they never give you the result you were hoping for. For me as a Jinx'ed person, not even heads or tails ever works in my favor :p

My test snippet:

waitUntil {player == player}; //0 = [] spawn {execVM "random.sqf"}
sleep (random 2);
_i = 0;
_c0 = 0;
_c1 = 0;
_c2 = 0;
_c3 = 0;
_c4 = 0;
_first = 0;
while {_i < 100} do {
//	_random = floor(random(250 * ((direction player) + (time * 17)))); //Just for added crazyness
_random = floor(random 5); //But this seems to yield the same result, so no flavor noticed
_modulus = _random % 5;
if (_i == 0) then {_first = _modulus};
_i = _i + 1;
switch (_modulus) do {
	case 0 : {_c0 = _c0 + 1};
	case 1 : {_c1 = _c1 + 1};
	case 2 : {_c2 = _c2 + 1};
	case 3 : {_c3 = _c3 + 1};
	case 4 : {_c4 = _c4 + 1};
};
hintSilent format ["
	Random integer: %1\n
	With modulus: %2\n
	Runs: %3\n
	First: %4\n
	0: %5\n
	1: %6\n
	2: %7\n
	3: %8\n
	4: %9",
	_random, _modulus, _i, _first, _c0, _c1, _c2, _c3, _c4
];
sleep 0.0345;
};

Share this post


Link to post
Share on other sites

Well I jumbled the array and took out all unnecessary spaces, odds n ends. The major thing that seemed to get it working right was to remove the sleep 1; and any other sleeps?

I did this to all 4 scripts and all are working like a charm now? Not sure why it makes a difference, in theory it shouldn't?

Thanks for your help guys and the interesting scripts, I'm almost competent now LOL.

Share this post


Link to post
Share on other sites

Could try it replacing floor with round.

Floor rounds to the lowest integer e.g. 1.9 is being returned as 1.

Share this post


Link to post
Share on other sites
Could try it replacing floor with round.

Floor rounds to the lowest integer e.g. 1.9 is being returned as 1.

I will try that. Sounds like a good idea!

Share this post


Link to post
Share on other sites
Could try it replacing floor with round.

Floor rounds to the lowest integer e.g. 1.9 is being returned as 1.

when using round you will not get an equal random pick because:

0 - 0.49 = 0

0.5 - 1.49 = 1

1.5 - 2.49 = 2

2.5 - 3.49 = 3

3.5 - 4.49 = 4

4.5 - 5 = 5

So you see 1st and last will only get half the chance the rest has of being selected.

Share this post


Link to post
Share on other sites

Yeah its a real pain, if you use floor you hardly ever get 5 (4.01 to 4.99) will be 4.

Share this post


Link to post
Share on other sites
Yeah its a real pain, if you use floor you hardly ever get 5 (4.01 to 4.99) will be 4.

You're supposed to use floor random 6 if you want to include 5 (and 0, otherwise use ceil). random will never give you a natural number so getting 5 with random 5 is impossible. In arrays floor is a natural choice because the number of elements is always one more than the last element's index number.

Edited by Celery

Share this post


Link to post
Share on other sites
Yeah its a real pain, if you use floor you hardly ever get 5 (4.01 to 4.99) will be 4.

Thats the whole point of floor.

if you have 5 objects in an array and "count" array it will return 5.

when you select floor random count array you get a shot at numbers 0, 1, 2, 3, 4 not 5.

Wich is correct way when acessing arrays since 1st object in array is select 0 and not select 1.

if you select 5 in an array with only 5 objects in it it will return nothing, out of bounds. (error), because the 5th object is select 4. not select 5.

As Celery explained, but dumbed down abit for easier understanding.

Edited by Demonized

Share this post


Link to post
Share on other sites

Random: Random real (floating point) value from 0 (inclusive) to x (not inclusive).

Means that ceil should not be used, only floor. With ceil you have the very small chance of 0 actually being possible, while with floor it is impossible to get 5 (from random 5).

The \n is newline character supported by the hint command. If that was what was meant with "odds n ends" :p

_pos3D = [7,9,4];

_xval = _pos3D select 0;

_yval = _pos3D select 1;

_zval = _pos3D select 2;

_oval = _pos3D select 3; <-- this would result an error.

Share this post


Link to post
Share on other sites
Random: Random real (floating point) value from 0 (inclusive) to x (not inclusive).

Means that ceil should not be used, only floor. With ceil you have the very small chance of 0 actually being possible, while with floor it is impossible to get 5 (from random 5).

You sure about that? I had a script run a few million tries and stop when a random number returned a natural number, but no natural number ever came.

Share this post


Link to post
Share on other sites

I'm sure you've already checked these but I'll throw them out there:

createUnit array

createVehicle array

I used them yesterday on a simple script and it's definitely random. Suppose it depends on what your creating at your LZ's.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×