Search the Community
Showing results for tags 'seed'.
Found 1 result
-
Helo. I have a seeding problem with the random function that I just can't figure out. while { surfaceIsWater _suitable || count _list > 0} do { while {_spot distance officer_jeff < 1000 || surfaceIsWater _spot} do { _prevStep = _center getPos[ (random 2000), (random 350)]; for "_i" from 0 to 2 do { _step = _prevStep getPos[ (random 2001), (random 351)]; _prevStep = _step; }; _spot = [_step select 0,_step select 1,0]; }; _suitable = [_spot, 0, 300, 20, 0, 0.7, 0] call BIS_fnc_findSafePos; _list = nearestTerrainObjects [_suitable,["TREE","BUILDING","RUIN","ROCK","HOUSE"], _howBig,false]; }; If the script can't find a position that is not a water surface, it restarts BUT the RANDOM functions just keeps giving me the same position every time the cycle ends. I don't understand, is it not supposed to be random? I also tried this with seed using the alternate syntax of random: while { surfaceIsWater _suitable || count _list > 0} do { while {_spot distance officer_jeff < 1000 || surfaceIsWater _spot} do { _prevStep = _center getPos[ (time random 2000), (time random 350)]; for "_i" from 0 to 2 do { _step = _prevStep getPos[ (time random 2001), (time random 351)]; _prevStep = _step; }; _spot = [_step select 0,_step select 1,0]; }; _suitable = [_spot, 0, 300, 20, 0, 0.7, 0] call BIS_fnc_findSafePos; _list = nearestTerrainObjects [_suitable,["TREE","BUILDING","RUIN","ROCK","HOUSE"], _howBig,false]; }; Here is an example output: 15:12:48 "[823.795,10712.5] as _suitable, 56 as count _list, [816.133,10551.5,0] as _spot " 15:12:49 "[820.423,10745.8] as _suitable, 46 as count _list, [816.133,10551.5,0] as _spot " 15:12:50 "[828.004,10684.4] as _suitable, 76 as count _list, [816.133,10551.5,0] as _spot " Any help would be much appreciated.