Jump to content
Sign in to follow this  
natanbrody

Recruiting Unit Script!!! Help!!

Recommended Posts

Hi I have recently been trying to Edit the amazing Patrol Operations 2 Mission for my clan. (http://www.armaholic.com/page.php?id=15526) The problem that I am having is that I am trying to change the type of soldiers that you can recruit from the normal US Army ones to Addon units. I have found a function that I need to change somehow as you see in the code below (mps_recruit_unittypes) I just have no Idea where I can find this function file! I have looked everywhere!

Filename = mps_func_recruit_create_unit.sqf

//Written by BON_IF

// Adpated by EightySix

if(isDedicated) exitWith{};

if((count (units group player) + count mps_recruit_queue) >= mps_group_maxsize) exitWith {hint "You've reached the max. allowed group size."};

disableSerialization;

_update_queue = {

_display = findDisplay 86030;

_queuelist = _display displayCtrl 86034;

_queuelist ctrlSetText format["Units queued: %1",count mps_recruit_queue];

};

_display = findDisplay 86030;

_listbox = _display displayCtrl 86033;

_sel = lbCurSel _listbox; if(_sel < 0) exitWith{};

_unittype = mps_recruit_unittypes select _sel;

_typename = lbtext [86033,_sel];

_queuepos = 0;

_queuecount = count mps_recruit_queue;

if(_queuecount > 0) then {

_queuepos = (mps_recruit_queue select (_queuecount - 1)) + 1;

hint parseText format["<t size='1.0' font='Zeppelin33' color='#ef2525'>%1</t> added to queue.",_typename];

};

mps_recruit_queue = mps_recruit_queue + [_queuepos];

[] call _update_queue;

WaitUntil{_queuepos == mps_recruit_queue select 0};

sleep (1.5 * (_queuepos min 1));

hint parseText format["Processing your <t size='1.0' font='Zeppelin33' color='#ffd800'>%1</t>.",_typename];

if(!mps_debug) then { sleep (6 + random 3); };

_spawnpos = [getPos bon_recruit_barracks,random 360,2] call mps_new_position;

_unit = group player createUnit [_unittype, _spawnpos, [], 0, "FORM"];

_unit setRank "PRIVATE";

[_unit] execVM (mps_path+"func\mps_func_recruit_unit_init.sqf");

hint parseText format["Your <t size='1.0' font='Zeppelin33' color='#008aff'>%1</t> %2 has arrived.",_typename,name _unit];

mps_recruit_queue = mps_recruit_queue - [_queuepos];

[] call _update_queue;

Share this post


Link to post
Share on other sites

Since you are still going to change it, why just not redefine it with your own unit array?

Share this post


Link to post
Share on other sites

How would I do that? Without having the actual file to copy from I dont think I know how!

Edited by NatanBrody

Share this post


Link to post
Share on other sites

mps_recruit_unittypes = ["model1","model2"];

Etc.

Share this post


Link to post
Share on other sites

Ahh ok sounds good and the Model1 and model2 I replace with the classnames of the soldiers. Could you give an example of where to put it in the script above?

Share this post


Link to post
Share on other sites

By adding this to my mission it has not changed a bit so it must mean that the array is in another file and is overriding mine

Share this post


Link to post
Share on other sites

Make a completely new array and change it to that array in the file in question.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×