Search the Community
Showing results for tags 'walk around'.
Found 1 result
-
Hello all, So I have been working on a mission that utilizes essentially a town full of people. From the start of the mission they'll just walk around (I gave them waypoints), but once the fighting begins, I needed them to run around (using a doMove ... command). It works fine, however, there are some problems. I am now slowly starting to optimize my mission, and having over 40 civilian units each with defined variables takes a toll on fps and performance when executing scripts. Not to mention the hassle of dealing with so many unit icons on the editor map.. Is there a way to just spawn civilians randomly in a zone and have them just walk around until an event occurs causing them to just frantically run? I tried to create a script for this (spawning them, that is), but due to my lack of time and little scripting knowledge I'm smacking into some dead ends. Here is what I have created thus far, in case any of you guys would like to look at it: _civilianGroup = ["C_man_1","C_man_1_1_F","C_man_1_2_F","C_man_1_3_F","C_man_polo_1_F","C_man_polo_2_F","C_man_polo_3_F","C_man_polo_4_F","C_man_polo_5_F","C_man_polo_6_F","C_man_p_fugitive_F"]; _civilianSpawn = ["civspawn1"]; //civspawn1 is a marker on my map _radius = 200; _amount = 0; _grp = createGroup civ; while {_amount < 10} do { sleep 3; _civUnit = _civilianGroup call BIS_fnc_selectRandom; hint format ["the civilian will be: %1",_civUnit]; //hints were just used for testing each line of code.. sleep 2; _markerPos = _civilianSpawn call BIS_fnc_selectRandom; hint format ["the marker will be: %1",_markerPos]; _civie = _civUnit createUnit [getMarkerPos _markerPos,_grp]; _distance = [1,_radius] BIS_fnc_randomInt; // I believe this part and below are the areas that are causing problems _direction = [0,359] BIS_fnc_randomInt; _randomPos = [_civie,_distance,_direction] call BIS_fnc_relPos; }; Once again thanks in advance for any help you guys can bring. Bonus Question: If there are any general methods to optimize a single player mission, I'd love to know! -Jake