Jump to content

Search the Community

Showing results for tags 'rankID'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • BOHEMIA INTERACTIVE
    • BOHEMIA INTERACTIVE - NEWS
    • BOHEMIA INTERACTIVE - JOBS
    • BOHEMIA INTERACTIVE - GENERAL
  • FEATURED GAMES
    • Vigor
    • DAYZ
    • ARMA 3
    • ARMA 2
    • YLANDS
  • MOBILE GAMES
    • ARMA MOBILE OPS
    • MINIDAYZ
    • ARMA TACTICS
    • ARMA 2 FIRING RANGE
  • BI MILITARY GAMES FORUMS
  • BOHEMIA INCUBATOR
    • PROJECT LUCIE
  • OTHER BOHEMIA GAMES
    • ARGO
    • TAKE ON MARS
    • TAKE ON HELICOPTERS
    • CARRIER COMMAND: GAEA MISSION
    • ARMA: ARMED ASSAULT / COMBAT OPERATIONS
    • ARMA: COLD WAR ASSAULT / OPERATION FLASHPOINT
    • IRON FRONT: LIBERATION 1944
    • BACK CATALOGUE
  • OFFTOPIC
    • OFFTOPIC
  • Die Hard OFP Lovers' Club's Topics
  • ArmA Toolmakers's Releases
  • ArmA Toolmakers's General
  • Japan in Arma's Topics
  • Arma 3 Photography Club's Discussions
  • The Order Of the Wolfs- Unit's Topics
  • 4th Infantry Brigade's Recruitment
  • 11th Marine Expeditionary Unit OFFICIAL | 11th MEU(SOC)'s 11th MEU(SOC) Recruitment Status - OPEN
  • Legion latina semper fi's New Server Legion latina next wick
  • Legion latina semper fi's https://www.facebook.com/groups/legionlatinasemperfidelis/
  • Legion latina semper fi's Server VPN LEGION LATINA SEMPER FI
  • Team Nederland's Welkom bij ons club
  • Team Nederland's Facebook
  • [H.S.O.] Hellenic Special Operations's Infos
  • BI Forum Ravage Club's Forum Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Yahoo


Jabber (xmpp)


Skype


Biography


Twitter


Google+


Youtube


Vimeo


Xfire


Steam url id


Raptr


MySpace


Linkedin


Tumblr


Flickr


XBOX Live


PlayStation PSN


Origin


PlayFire


SoundCloud


Pinterest


Reddit


Twitch.Tv


Ustream.Tv


Duxter


Instagram


Location


Interests


Interests


Occupation

Found 1 result

  1. Hey guys, I ve to fight a bug in Sarogahtyps Spawn Script Creator - SSSC and thats the problem: I ve a main array which is called globalLeaderArray. There in I store group leaders. My problem is that when one of that group leaders die then it auto leaves the group and I cant get the group later to handle it in my caching parts of the script. Now I thought about to add a killed EH to store the new group leader (after the old has been killed) in globalLeaderArray. The following code has 2 functions fnc_mark_leaders initially pushs a leader in the global array and fnc_add_killed_EH adds an EH to that leader which changes the leader object in the global array if the leader dies. Because I use fnc_add_killed_EH inside of the EH itself there is some kind of recursive structure in it and I d like to know if that could work. Also I think its a bit complex for only change one object in an array so I wonder if someone knows a neater way to do that. fnc_mark_leaders = { params [["_unit", objNull, [objNull]]]; if (isNull _unit) exitWith {true}; private _leader = leader _unit; if (isNil "globalLeaderArray") then { globalLeaderArray =[]; }; if (!(_leader in globalLeaderArray)) then { _lead_index = globalLeaderArray pushBack _leader; _leader setVariable["lead_info", [_lead_index, (group _leader)]]; _leader call fnc_add_killed_EH; }; }; fnc_add_killed_EH = { params ["_leader"]; _leader addEventHandler ["killed", { params ["_old_leader"]; _lead_info = _old_leader getVariable "lead_info"; _lead_index = _lead_info select 0; _group = _lead_info select 1; _new_leader = _group call fnc_get_highest; _group selectLeader _new_leader; globalLeaderArray set [_lead_index, _new_leader]; _new_leader setVariable["lead_info", [_lead_index, _group]]; _new_leader call fnc_add_killed_EH; }]; }; EDIT: function to get the highest ranked and highest rated unit in group. with that I dont need to wait until engine changed the leader itsself. fnc_get_highest = { params ["_group"]; private _highest_rank = 0; private _highest_rating = -99999; private ["_highest_rank_array"]; //select the highest ranked units found (last element is ranked highest) _highest_rank_array = ((units _group) select {alive _x}) select { _rank = rankID _x; _highest_rank = _highest_rank max _rank; (_highest_rank == _rank) }; // reverse array to have highest ranked units at array start reverse _highest_rank_array; // cut the array after last unit with the highest rank { if(rankID _x < _highest_rank) exitWith {_highest_rank_array resize _forEachIndex}; } forEach _highest_rank_array; //exit if only one unit has the highest rank if(count _highest_rank_array == 1) exitWith { (_highest_rank_array select 0) }; //select the highest ranked unit whith the highest rating (last element is rated highest) _highest_rank_array = _highest_rank_array select { _rating = rating _x; _highest_rating = _highest_rating max _rating; (_highest_rating == _rating) }; //return the last element because its the highest ranked an the highest rated unit in group (_highest_rank_array select ((count _highest_rank_array) - 1)) };
×