Heatseeker 0 Posted September 3, 2006 I have searched here and ofpec for everything about addaction, i still have doubts.. 1. Can i "put" an addaction on a a.i. unit? I only got it to work with players and objects.. 2. I did get it to work with a trigger that checks the distance betwean the player(s) and the a.i. unit, if any player gets <5 from the target he gets the addaction: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> capture = player addAction ["Take prisoner", "hostage.sqs"] The condition is: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> "_x distance prisioner < 5" count (units mygroup) > 0 2.a Will "player" refer to any player (in the group) that triggers this in MP? 2.b How do i remove the action if the guy ignores it and walks away? It still shows on the action menu... i tried to reverse the distance (> 5) and to remove the action but it didnt work.. Help . Share this post Link to post Share on other sites
fer 21 Posted September 3, 2006 You should be able to add the action to the AI unit. In its init field write: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addAction ["Take prisoner", "hostage.sqs"]; This is a simpler approach, since the action will always be available to any player who gets within approximately 5m of the AI unit (eliminating the requirement for your triggers). BTW, in the "hostage.sqs" script you can use the removeAction command to take the action away from the AI unit. Hope that helps! - Fer <TZW> Share this post Link to post Share on other sites
Heatseeker 0 Posted September 3, 2006 Thanks for reply . I tried to add the addaction to the a.i. unit but it never worked when i got close to it. I then tried on an object (radio) and it did work there, the trigger is not how i wanted to do it . I havent really done the hostage.sqs yet, just: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> (_this select 0) removeaction (_this select 2); to remove the action and the [hostage] join group comand . Any more help would be very welcome . Share this post Link to post Share on other sites
fer 21 Posted September 4, 2006 Can you pm me a copy of the mission folder plz? I'll have a look at it for you. Share this post Link to post Share on other sites
mr.peanut 1 Posted September 8, 2006 Move the addAction line to your init.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hostage1 addAction ["Take prisoner", "hostage.sqs"] Share this post Link to post Share on other sites
Heatseeker 0 Posted September 8, 2006 Move the addAction line to your init.sqs<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hostage1 addAction ["Take prisoner", "hostage.sqs"] Thanks, Fer helped out . Share this post Link to post Share on other sites