Results 1 to 6 of 6

Thread: addaction for player groups (MP).

  1. #1
    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 &#91;&#34;Take prisoner&#34;, &#34;hostage.sqs&#34;&#93;
    [/QUOTE]
    The condition is:
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    &#34;_x distance prisioner &#60; 5&#34; count &#40;units mygroup&#41; &#62; 0
    [/QUOTE]

    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 .

  2. #2
    Gunnery Sergeant
    Join Date
    Mar 28 2004
    Location
    BAS (Retired)
    Posts
    406
    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 &#91;&#34;Take prisoner&#34;, &#34;hostage.sqs&#34;&#93;;[/QUOTE]

    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&#33;

    - Fer <TZW>

  3. #3
    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">
    &#40;_this select 0&#41; removeaction &#40;_this select 2&#41;;
    [/QUOTE]
    to remove the action and the [hostage] join group comand .

    Any more help would be very welcome .

  4. #4
    Gunnery Sergeant
    Join Date
    Mar 28 2004
    Location
    BAS (Retired)
    Posts
    406
    Can you pm me a copy of the mission folder plz? I&#39;ll have a look at it for you.

  5. #5
    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 &#91;&#34;Take prisoner&#34;, &#34;hostage.sqs&#34;&#93;[/QUOTE]




  6. #6

    Thumbs up

    Quote Originally Posted by (Mr.Peanut @ Sep. 08 2006,17:01)
    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 &#91;&#34;Take prisoner&#34;, &#34;hostage.sqs&#34;&#93;
    [/QUOTE]
    Thanks, Fer helped out .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •