RommelFuchs 10 Posted June 17, 2013 This is a simple script I've put together using an array containing markes. This script creates a suitcase randomly on one of the markers, but I doesn't work for now: _locs= ["infoloc1","infoloc2","infoloc3","infoloc4","infoloc5"]; // Random location script _suitcase= "Land_Suitcase_F" createVehicle getMarkerPos select floor(random count _locs); The error stated by -showScriptError is a missing ; between select and floor. Can someone help me on this one? Share this post Link to post Share on other sites
1para{god-father} 105 Posted June 17, 2013 why not just go with something like this ? _locs= ["infoloc1","infoloc2","infoloc3","infoloc4","infoloc5"] call BIS_fnc_selectRandom; _suitcase= "Land_Suitcase_F" createVehicle (getMarkerPos _locs); Share this post Link to post Share on other sites
RommelFuchs 10 Posted June 17, 2013 I'll try this one then. Didn't think about using functions, I always forget to make my life easier. why not just go with something like this ? _locs= ["infoloc1","infoloc2","infoloc3","infoloc4","infoloc5"] call BIS_fnc_selectRandom; _suitcase= "Land_Suitcase_F" createVehicle (getMarkerPos _locs); Share this post Link to post Share on other sites
Larrow 2821 Posted June 17, 2013 _suitcase= "Land_Suitcase_F" createVehicle (getMarkerPos ([color="#FF0000"]_locs[/color] select (floor(random (count _locs))))); You are missing the _locs array before the select command. Share this post Link to post Share on other sites
riouken 15 Posted June 18, 2013 (edited) why not just go with something like this ? _locs= ["infoloc1","infoloc2","infoloc3","infoloc4","infoloc5"] call BIS_fnc_selectRandom; _suitcase= "Land_Suitcase_F" createVehicle (getMarkerPos _locs); Normaly I would say you are correct but I would adviase against using BIS_fnc_selectRandom right now(Unless they have fixed it and I missed that). https://dev-heaven.net/issues/69439 Edit: Nevermind I just checked in the function viewer and they did stealth fix this for Arma 3. scriptName "Functions\arrays\fn_selectRandom.sqf"; /************************************************************ Random Select By Andrew Barron / Rewritten by Warka Parameters: array This returns a randomly selected element from the passed array. Example: [1,2,3] call BIS_fnc_selectRandom Returns: 1, 2, or 3 ************************************************************/ private ["_ret","_i"]; if(count _this > 0) then { _i = floor random (count _this); //random index _ret = _this select _i; //get the element, return it }; _ret Thanks Warka:) Edited June 18, 2013 by Riouken Share this post Link to post Share on other sites
dr_strangepete 6 Posted June 18, 2013 to clarify what your original error was, _suitcase= "Land_Suitcase_F" createVehicle getMarkerPos select floor(random count _locs); should have been _suitcase= "Land_Suitcase_F" createVehicle (getMarkerPos select (floor(random count _locs))); if im not mistaken. often then engine throws a 'expected ;' when a few commands are strung together. Share this post Link to post Share on other sites
LoonyWarrior 10 Posted June 18, 2013 to clarify what your original error was it was already done.... and u re also... selecting from nowhere....... _suitcase= "Land_Suitcase_F" createVehicle (getMarkerPos ([color="#FF0000"]_locs[/color] select (floor(random (count _locs))))); You are missing the _locs array before the select command. Share this post Link to post Share on other sites