Jump to content
Sign in to follow this  
Arvic92

How to use doWatch on a vehicle turret?

Recommended Posts

Currently I want something along the lines of

gunner _unit doWatch _target;

on a hunter/ifrit/slammer but this doesn't seem to effect the vehicle in any way.

CLARIFICATION: I want the turret to point a specific spot for the purpose of engaging targets

Edited by Arvic92

Share this post


Link to post
Share on other sites

Simply using the vehicle's name usually does the job for me, so no need to use the "gunner" argument. Try that. :)

Share this post


Link to post
Share on other sites

I stripped my code down to clearly demonstrate my dilemma.

I have tried your way of phrasing the doWatch command and it does nothing either

BluCar1 = 50. cal static

BluCar2 = Marshal

BluCar3 = Hunter HMG

Red1 = CSAT rifleman ~300 meters away

Init.SQF

call {[bluCar1,Red1] execVM "TestScript.SQF"};
call {[bluCar2,Red1] execVM "TestScript.SQF"};
call {[bluCar3,Red1] execVM "TestScript.SQF"};

TestScript.SQF

private ["_unit","target"];

_unit = _this select 0;
_target = this select 1;

while {true} do
{
       //Alert action ["useweapon",_unit,gunner _unit,1];
_unit doWatch _target;
hint "Watching";
sleep .5
};

Share this post


Link to post
Share on other sites

I don't see the need for wrapping the execvm in a call {}

 null=[bluCar1,Red1] execVM "TestScript.SQF"; 

or

{null=[_x] execvm "testscript.sqf"} foreach [bluCar1,BluCar2,BluCar3] 

should work.

also error in _target = this select 1; your missing underscore _target = _this select 1;

and again in private ["_unit","target"];

Share this post


Link to post
Share on other sites

derp

I think I know how those errors got there. This is based off of a larger older script that I've use in a past mission. I must of screwed up when adding in target as a parameter.

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  

×