Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
ducksonshrooms

TvT HVT mission help, both sides can capture/recapture from eachother

Recommended Posts

Hey there, new to the game and the forum, only really started playing ARMA because of watching all my sons twitch streams and playing Altis Life with him, only recently decided to sit down and explore the other aspects of the game and I've been really pleased to find the editor. I messed around with it the first few hours, looking up youtube videos on how to do basic things, and next thing I know I was lost in making my own mission. I really love this thing, been on the editor for 2 days straight almost now and it remidns me of making campaigns/dungeons for D&D back in the day.

 

Anyways enough exposition, the post topic pretty much explains it all, I've ran into a mission making snag, I've searched on google and the forums but have been unsuccessful in finding specifically what I needed. Pretty much I need to know how to make a HVT capture mission where BOTH sides can capture/recapture the HVT from eachother and be able to load the HVT in a vehicle or make the HVT join their group so they can command the HVT to enter the vehicle. I've found PLENTY of scripts for HVT/hostage capture but none that are TvT specific that allow both teams to fight over control of the HVT.

 

I had originally wanted to make a mission where Blufor has to protect a fuel jerry can that opfor had to steal to refuel their escape helo but couldn't figure out how to do that or turn the Jerry can into an object that can enter your inventory, or how to create a refueling mission so I settled for an HVT being the mission mcguffin, but if anyone can help with that instead and thinks that would be easier I'd love to know that instead

 

Any help is appreciated and thanks beforehand

Share this post


Link to post
Share on other sites

Are you using ACE 3?

I am not ... I wanted the mission to be as accessible as possible so I can throw it up on steam workshop , thus I'm using only vanilla content. (Except for MCC as a 3D editor)

Share this post


Link to post
Share on other sites

Many ways to do something along these lines. Here an example for an HVT who starts as a civiallian...

//initPlayerLocal.sqf

fnc_HVT_addAction = {
    params[ "_HVT" ];
    
    //Add action to HVT
    _HVT addAction[ "Follow Me", {
            params[    "_HVT", "_caller" ];

            //Get HVT current group        
            _oldGroup = group _HVT;
            
            //Make him join the group of the actions user
            [ _HVT ] joinSilent group _caller;
            
            //Clean up old group
            deleteGroup _oldGroup;
            
            //spawn a thread to monitor HVT
            _nul = [ _HVT ] spawn {
                params[ "_HVT" ];
                
                //Get a list of units in the rescue group
                _rescueGroup = units group _HVT - [ _HVT ];
                
                //if there are no group members within 10m or HVT is dead
                waitUntil { !alive _HVT || { { _x distance _HVT < 10 }count _rescueGroup isEqualTo 0 } };
                
                if ( alive _HVT ) then {
                    //Make him revert to his own civilian group
                    [ _HVT ] joinSilent ( createGroup civilian );
                };
            };
        },
        [],
        1,
        true,
        true,
        "",
        //Action available while HVT is alive and is in a civilian group
        "alive _target && { side group _target isEqualTo civilian }"
    ];
    
};
//initServer.sqf

//Call function for each player and JIP
[ HVT ] remoteExec [ "fnc_HVT_addAction", 0, "HVT_JIP" ];

Hopefully comments explain the process. Just place your HVT as a civilian and name him HVT in the editor.

  • Like 1

Share this post


Link to post
Share on other sites

Many ways to do something along these lines. Here an example for an HVT who starts as a civiallian...

//initPlayerLocal.sqf

fnc_HVT_addAction = {
    params[ "_HVT" ];
    
    //Add action to HVT
    _HVT addAction[ "Follow Me", {
            params[    "_HVT", "_caller" ];

            //Get HVT current group        
            _oldGroup = group _HVT;
            
            //Make him join the group of the actions user
            [ _HVT ] joinSilent group _caller;
            
            //Clean up old group
            deleteGroup _oldGroup;
            
            //spawn a thread to monitor HVT
            _nul = [ _HVT ] spawn {
                params[ "_HVT" ];
                
                //Get a list of units in the rescue group
                _rescueGroup = units group _HVT - [ _HVT ];
                
                //if there are no group members within 10m or HVT is dead
                waitUntil { !alive _HVT || { { _x distance _HVT < 10 }count _rescueGroup isEqualTo 0 } };
                
                if ( alive _HVT ) then {
                    //Make him revert to his own civilian group
                    [ _HVT ] joinSilent ( createGroup civilian );
                };
            };
        },
        [],
        1,
        true,
        true,
        "",
        //Action available while HVT is alive and is in a civilian group
        "alive _target && { side group _target isEqualTo civilian }"
    ];
    
};
//initServer.sqf

//Call function for each player and JIP
[ HVT ] remoteExec [ "fnc_HVT_addAction", 0, "HVT_JIP" ];

Hopefully comments explain the process. Just place your HVT as a civilian and name him HVT in the editor.

Thanks a lot Larrow this works like a charm!

Share this post


Link to post
Share on other sites

×