Jump to content
Sign in to follow this  
Heatseeker

addaction for player groups (MP).

Recommended Posts

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 confused_o.gif .

Share this post


Link to post
Share on other sites

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> smile_o.gif

Share this post


Link to post
Share on other sites

Thanks for reply smile_o.gif .

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 confused_o.gif .

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 smile_o.gif .

Any more help would be very welcome smile_o.gif .

Share this post


Link to post
Share on other sites

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

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
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 smile_o.gif .

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  

×