GotheriK 0 Posted April 21, 2007 Could anyone explain how I can implement a system similar to the one the Demo had where you could walk into a certain area and "Hire Soldiers" (Just plain-old AI) to your squad? Share this post Link to post Share on other sites
kuwahara<ANZAC> 0 Posted April 21, 2007 put this on the init line of an object like a table> <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> [this] exec "set_able_atank.sqs"; then you need to make 2 .sqs set_able_atank.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _sniper = _this select 0 _sniper addAction ["Recruit AT Gunner", "set_join_atank.sqs"] set_join_atank.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _player = player _sniper = _this select 0 ?!(alive _sniper):exit ?!(alive _player):exit "SoldierWAT" createUnit [position player, group player] that should work. Share this post Link to post Share on other sites
GotheriK 0 Posted April 23, 2007 Thank you, it worked. One thing though: is it possible to limit the amount of soldiers you can recruit? I.E. So a player couldn't recruit like, 40 guys? Share this post Link to post Share on other sites
fasad 1 Posted April 23, 2007 try adding something like this to the join script: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if ((count units group player) >= 10) then {hint "You already command the maximum number of men";exit} Share this post Link to post Share on other sites