Results 1 to 6 of 6

Thread: Playable/Marker issue

  1. #1

    Playable/Marker issue

    Hey guys, I have been able to scrap together a script that will re-attach a marker to any teammate that is alive in a squad. The script is as follows:

    Code:
    [] spawn {
      while {alive P1} do { "Attack" setmarkerpos getpos P1; sleep 0.5; };
      while {!alive P1 && alive P2} do { "Attack" setmarkerpos getpos P2; sleep 0.5; };
      while {!alive P2 && alive P3} do { "Attack" setmarkerpos getpos P3; sleep 0.5; };
      while {!alive P3 && alive P4} do { "Attack" setmarkerpos getpos P4; sleep 0.5; };
      while {!alive P4 && alive P5} do { "Attack" setmarkerpos getpos P5; sleep 0.5; };
      while {!alive P5 && alive P6} do { "Attack" setmarkerpos getpos P6; sleep 0.5; };
    };

    This works well, IF all the playable slots are filled. For example, if you turn off the P1 playable slot the marker will fail to attach itself to anyone. Turning off the AI for any slots will break this sadly. And I know why...but I need some kind of work around and I can't seem to get any resonable method to work.

    Thank you for your time,
    Dominic

  2. #2
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    you are tracking leader of group??

    try this instead:
    PHP Code:
    _null P1 spawn {
        
    _grp group _this;
        while {({
    alive _xcount units _grp) != 0} do {
            
    _leader leader _grp;
            
    "Attack" setmarkerpos getpos _leader;
            
    sleep 0.5;
        };
    }; 
    My scripts:
    Spoiler:

    what to do when posting any kind of code dammit!!

    Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.

  3. #3
    Staff Sergeant Genesis92x's Avatar
    Join Date
    Feb 18 2010
    Location
    Wyoming
    Posts
    207
    Author of the Thread
    Thank you!

    I tried something like this I believe but I'm getting the same result. The marker won't attach at all. I could executing it wrong? But I don't think so.

    Code:
    nul = this execVM "Test.sqf";
    put directly in the init of the leader (P1)

    To further clarifty (Because at 2:00 AM I can't talk well)

    I want a marker to just attach to the group leader. When the leader dies, the marker should go to the next available player. The script I posted worked very well but the only issue came when the P1 slot was disabled before the game started. So technically there never was a P1 slot when the mission starts so the marker never attaches to P1 so it then can not attach to any P2-6

    Thank you for the help,
    Dominic
    Last edited by Genesis92x; May 10 2011 at 17:29.

  4. #4
    Staff Sergeant Genesis92x's Avatar
    Join Date
    Feb 18 2010
    Location
    Wyoming
    Posts
    207
    Author of the Thread
    Sorry to necro a thread guys :|

    I'm still having trouble with this working correctly.

    I want a marker to just attach to the group leader. When the leader dies, the marker should go to the next available player. The script I posted worked very well but the only issue came when the P1 slot was disabled before the game started. So technically there never was a P1 slot when the mission starts so the marker never attaches to P1 so it then can not attach to any P2-6

  5. #5
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    do you mean something like this?
    place in init of all group members:
    groupname = group this;

    place this in a trigger in on act:
    PHP Code:
    _null groupname spawn {
        
    _grp _this;
        while {({
    alive _xcount units _grp) != 0} do {
            
    _leader leader _grp;
            
    "Attack" setmarkerpos (getpos _leader);
            
    sleep 0.5;
        };
    }; 
    If you dont want marker to always be on current alive leader, you can use isPlayer unit to check for if its a AI or player and then track that one.

  6. #6
    Staff Sergeant Genesis92x's Avatar
    Join Date
    Feb 18 2010
    Location
    Wyoming
    Posts
    207
    Author of the Thread
    Ah thank you Demonized. I just forgot to group everyone! Doh!

Posting Permissions

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