Hello!
Thank you very much for that reply Walter
I've been testing your script for a while, and it works pretty well.
You were right about that trigger size. the smaller is doing the job quite well. Hint text is showing how meny friendlies are near, selecting a helper for each wounded, if not, then crying for help and everything...
This is truly going foward now, and its fantasticooo!!!!!
There are still few problems remaining and i cant solve them:
1. The "escape" for the player does not work. error...
So if the player is inside the trigger area, it will allways select the player as the helper. I think that would become a very irritating thing for players at some point...
? ( _query = player): goto "loop"
I don't mean that that shouldn't never happen for the player, but
allways is too much.
2. When the player is not under the trigger, and if there are friendlies around the wounded, the trigger seems to select the helper from the outer border of the trigger, and not from the center, near the wounded.
That's why it would be much better if that trigger or script could choose the nearest available healthy soldier. I was wondering if the general barrons
http://www.ofpec.com/ed_depot/index.php?action=details&id=106&page=0findunits.sqf function would help? I donno how to use that
I also found a couple of codes, but i couldn't/donno how to use them:
_distance = 9999
_target = objnull
_i = (count eastlist) - 1
#loop
_unit = eastlist select _i
? not alive _unit : goto "next"
? player distance _unit < _distance : _distance = player distance _unit; _target = _unit
#next
_i = _i - 1
? _i >= 0 : goto "loop"
and
_men = _this select 0
_unarmedman = _this select 1
_deadmen = []
_num = 0
#check
_man = _men select _num
?not alive _man && ((count weapons _man)>0):_deadmen = _deadmen + [_man]
_num = _num + 1
?_num!=(count _men):goto "check"
###########################
#find nearest deadbody
_nearesdis = 10000
_num = 0
#check2
?((_deadmen select _num) distance _unarmedman)<_nearesdis:_nearesdis = ((_deadmen select _num) distance _unarmedman); _nearestman = _num
_num = _num + 1
?_num!=(count _deadmen):goto "check2"
_nearestman = _deadmen select _nearestman
_unarmedman domove getpos _nearestman
@(_unarmedman distance _nearestman)<1
_unarmedman action ["take weapon",_nearestman,0,0,(primaryweapon _nearestman)]
3. If the selected helper is wounded in the middle of the helper script, the helper will receive a new helper for himself, but the "original" first wounded guy will be lying without helper, crying for help. So the trigger/script is not getting him a new helper. Donno why?
I was thinking if the code -setcaptive true- could help in this thing. I mean, if the selected helper and the wounded are set as "captives", would that help to sort them out from the triggers selection process to find new suitable helpers? Donno how to do that...
Please assist