Jump to content
Sign in to follow this  
PeterBitt

fn_vbs_doMoveEx for ArmA II ?

Recommended Posts

i was wondering if there is something like this http://community.bistudio.com/wiki/fn_vbs_doMoveEx_%28VBS2%29 aviable for arma 2 too?

currently i use http://community.bistudio.com/wiki/commandMove wich lets the units return to formation everytime they reached the destination:(

my goal is to script move commands from the leader to get some nice flanking manouvers with radio chatter.

i have the first harvest red mission in mind, where miles stays on overwatch while the team speads up to flank the position.

Edited by PeterBitt

Share this post


Link to post
Share on other sites

Hi,

You could do a function your self that does +/- the same, if I understood correctly.

TAG_fnc_doMove =
{
private ["_unit", "_pos"];
_unit = _this select 0;
_pos = _this select 1;

_unit doMove _pos;
waitUntil { unitReady _unit };
doStop _unit;
};

_neo_

Share this post


Link to post
Share on other sites

I use that this way:

Init.sqf:

CLINE=0;

Script.sqf:

_unit = _this select 0;
_pos = _this select 1;
_cline = _this select 2;
_mod = _this select 3;

_unit commandmove _pos;
sleep 2;
while {(_unit distance _pos > 1.0) && alive _unit} do {sleep 0.1;};
commandStop _unit;
_unit disableAI "MOVE";
_unit setunitpos _mod;
sleep 1; 
if (_cline == CLINE) then {sleep 1;};
if (_cline == CLINE) then {sleep 1;};
if (_cline == CLINE) then {sleep 1;};
if (_cline == CLINE) then {sleep 1;};
_unit enableAI "MOVE";
while {_cline == CLINE} do {sleep 4;};
_unit setunitpos "AUTO";
_unit commandfollow (leader group _unit);

_nul = [groupmember name, position to move,some number, unitpos at pos] execVM "script.sqf";

Note:

-"unitpos at pos" can be "DOWN","MIDDLE","UP" or "AUTO"

-to return unit to group change CLINE to have different value than the number you inserted via parameters to script.

-only works for groupmembers not for leader

Edited by SaOk

Share this post


Link to post
Share on other sites

thx for the replies, unfortunatelly iam a complete noob when it comes to scripting... @neokika can you tell me how to use that function pls? i have to make a .sqf file with the code but i dont know how to call it :o

it frustrates me that after ~6 years of mission editing i still can not understand the most simple scripts, copy and paste is all i can do ... poor

edit: i thought that i could get SaOks scripts done, but i dont know what i have to put in the red space:

_nul = [groupmember name, position to move,some number, unitpos at pos] execVM "script.sqf";

Edited by PeterBitt

Share this post


Link to post
Share on other sites

Init.sqf

TAG_fnc_doMove =
{
private ["_unit", "_pos"];
_unit = _this select 0;
_pos = _this select 1;

_unit doMove _pos;
waitUntil { unitReady _unit };
doStop _unit;
};  

Call it with:

_nic = [_unit, _pos] spawn TAG_fnc_doMove;

_neo_

Share this post


Link to post
Share on other sites

Example:

_nul = [unitname1, position pad1, 0, "MIDDLE"] execVM "script.sqf"; 

-unitname1 needs to be name of one of AI groupmembers

-name invisible helipad as pad1

-If you have now CLINE=0 in init.SQF then when inserting 0 as third parameter the unit (unitname1) waits at his waypoint until you set CLINE=1 (or something else, not 0).

-When unit reach reach his waypoint he goes on knee ("MIDDLE") until when he return to his group (CLINE is no longer 0)

Share this post


Link to post
Share on other sites

:yay: i cant thank you two enough! success!

the advantage of SaOks script is the radio communications, its exactly like i wanted it to be.

but thanks to neokika too because this looks very useful for my mission editing future - this function thing might be of use in many situations.

thx! thx! thx!

---------- Post added at 04:16 PM ---------- Previous post was at 03:54 PM ----------

@SaOk: i tried to get two teammates to move to the waypoint as a sub-squad with the following code:

_nul = [[p2,p3], position marker1, 0, "MIDDLE"] execVM "command.sqf";

is this the right way to do so? unfortunately the will return back to formation when done... when i use the script on a single unit it just works perfect!

Share this post


Link to post
Share on other sites

You have to run the script separately for each member:

_nul = [p2, position marker1, 0, "MIDDLE"] execVM "command.sqf";
_nul = [p3, position marker2, 0, "MIDDLE"] execVM "command.sqf";

Also to make things work right in battle, you have to add this to groupleader init box:

group this enableattack false;

or from anywhere:

groupname enableattack false;

Edited by SaOk

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  

×