Harkonin 0 Posted January 5, 2004 Basically I have  a script that takes a triggerlist and executes a script on them accordingly. I need to eliminate the trigger altogether and have the script find the unit t Execut by simply using "man" and nearestobject. Heres the script I need converted- <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _firepos = _this select 0 _burn_time = _this select 1 _burning=[] _units=[] _rad = 0 _gl = "Logic" camCreate _firepos _tar = list allist {if (!(_x in _units) && ("Man" countType [_x]>0)) then {_units=_units+[_x];} } forEach _tar _ti = 0 _cunits = count _units #loop _unit = _units select _ti ?( _unit in _burning ): goto "nofx" ? (_rad < 5) : _rad = _rad + 6 ?( _unit distance _gl) <= _rad && (alive _unit): _burning = _burning + [_unit]; [_unit] exec "FX\Fire\Burn.sqs" ?( _unit distance _gl) == _rad && (alive _unit): _unit setdammage 0.5 #nofx ~.01 _ti = _ti + 1 ? (_ti < _cunits): goto "loop" _ti = 0 ~1 ? (_time < _burn_time) : goto "loop" deleteVehicle _gl exit _tar is the list I get from the trigger. Any help appreciated. Share this post Link to post Share on other sites
Sgt_Wilson 0 Posted January 5, 2004 Make _Tar into a global array and add the units you want to check at mission startup. You could put something like this in each of the group commanders init fields and check for the groups in your script: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Tar=Tar+[Group This] Or: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Tar=Tar+(Units (Group This)) To check against each man. And get rid of the following line from the script: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_tar = list allist If its for multi player I think you will have to get a list from each player and add it to Tar. Make sure initalise Tar in your missions Init.sqs before adding the units you want detected. I forgot, you may have to add some code to check if they are still alive. Triggers automaticaly filter out dead guys. Share this post Link to post Share on other sites
toadlife 3 Posted January 5, 2004 nearestobject only works with specific classes, not general classes. So "man" will not work with nearestobject. You would have to put a specific type of man, like "soldierwb". Share this post Link to post Share on other sites
Sgt_Wilson 0 Posted January 6, 2004 The script is using counttype not nearestobject, which works on parent types. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"Man" countType [_x] The nearestobject bit Harkonin mentioned is really handled by: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?( _unit distance _gl) <= _rad && (alive _unit): _burning = _burning + [_unit]; [_unit] exec "FX\Fire\Burn.sqs" ?( _unit distance _gl) == _rad && (alive _unit): _unit setdammage 0.5 Share this post Link to post Share on other sites
Harkonin 0 Posted January 6, 2004 Yep thats why i need to convert it to a compatible format. On the road to a solution using a function to call the "type". Example - Getguy.sqf <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> private ["_i", "_Man", "_Men", "_refPt", "_wert"]; _pos = _this select 0; _i = 0; _Men = []; _wert = 360/(_this select 1); while "_i < 360" do { _refPt = [(_pos select 0) + 7 * (sin _i), (_pos select 1) + 7 * (cos _i), 0]; _Man = nearestObject _refPt; if ("MAN" countType [1, _Man] == 1 && _Man != player && ! (_Man in _Men)) then { _Men = _Men + [_Man] }; _i = _i + _wert; }; _Men now trying to switchup _tar = units triggerlist to something that utilizes _Guy = loadFile format ["%Getguy.sqf", _path] _Guys = [getPos _object, 15] call _Guy Share this post Link to post Share on other sites