Jump to content
Sign in to follow this  
R34P3R

Leader will not MoveInDriver ??!!

Recommended Posts

Hi there... why my Leader whant get in as Driver ??? He STand outside the Truck and will not getin.

_gruppe = Creategroup EAST;

_truck = "KamazOpen" createVehicle _pos;
_truck setDir _direction;

_Leader = "RU_Soldier_TL" createUnit [_pos, _gruppe, "", 1, "Captain"];
_Leader moveInDriver _truck;

Share this post


Link to post
Share on other sites
Hi there... why my Leader whant get in as Driver ??? He STand outside the Truck and will not getin.

_gruppe = Creategroup EAST;

_truck = "KamazOpen" createVehicle _pos;
_truck setDir _direction;

_Leader = "RU_Soldier_TL" createUnit [_pos, _gruppe, "", 1, "Captain"];
_Leader moveInDriver _truck;

try this

_gruppe = Creategroup EAST;

_truck = "KamazOpen" createVehicle _pos;
_truck setDir _direction;

_Leader = "RU_Soldier_TL" createUnit [_pos, _gruppe, "", 1, "Captain"];
_gruppe addvehicle _truck;

The leader will always getin as driver.

Share this post


Link to post
Share on other sites
Thanks.. but also not Working...

for addvehicle to work the group needs a waypoint to move to..

Share this post


Link to post
Share on other sites

Here is my Complete Script:

// TRUCK GENERATOR:  [MARKER, WAIPOINTFILE (Without .sqf) , DIRECTION]

if (!isServer) exitWith {};

_marker = _this select 0;
_waypoint = _this select 1;
_direction = _this select 2;

_pos = getMarkerPos _marker;
_gruppe = Creategroup EAST;

_truck = "KamazOpen" createVehicle _pos;
_truck setDir _direction;

_Leader = "RU_Soldier_TL" createUnit [_pos, _gruppe, "this action {"getindriver",_truck}", 1, "Captain"];
_Leader moveInDriver _truck;

_Count = (random 7);
_UnitCounter = 0;
While {_UnitCounter < _Count} do {
_Unit = "RU_Soldier" createUnit [_pos, _gruppe, "this action {"getincargo",_truck}", 1, "Corporal"];
_UnitCounter = _UnitCounter + 1;
_Unit moveInCargo _truck;
};
_gruppe addvehicle _truck;

if(schwirigkeit == 1) then { {_x setSkill (Random 0.3)} forEach units _gruppe; };
if(schwirigkeit == 2) then { {_x setSkill (Random 0.6)} forEach units _gruppe; };
if(schwirigkeit == 3) then { {_x setSkill (Random 0.9)} forEach units _gruppe; };

if(!isNil ("_waypoint")) then {
[_gruppe] execVM "server\waypoints\" + _waypoint + ".sqf";
};

The waypointfile:

_grp = _this select 0;

_grp addWaypoint [[12141.71,12228.514],0];
[_grp, 1] setWaypointType "MOVE";
[_grp, 1] setWaypointCombatMode "BLUE";
[_grp, 1] setWaypointFormation "FILE";
[_grp, 1] setWaypointSpeed "FULL";

_grp addWaypoint [[12122.717,12232.664],0];

_grp addWaypoint [[12084.156,12228.406],0];

_grp addWaypoint [[12034.546,12221.043],0];

_grp addWaypoint [[12013.942,12215.521],0];

_grp addWaypoint [[11975.956,12201.367],0];

_grp addWaypoint [[11940.274,12194.694],0];

_grp addWaypoint [[11915.296,12196.42],0];

_grp addWaypoint [[11898.169,12202.438],0];

_grp addWaypoint [[11864.48,12214.222],0];

_grp addWaypoint [[11842.037,12217.131],0];

_grp addWaypoint [[11810.962,12214.455],0];

_grp addWaypoint [[11738.292,12204.192],0];

_grp addWaypoint [[11707.359,12205.623],0];

_grp addWaypoint [[11683.265,12215.931],0];

_grp addWaypoint [[11639.535,12231.366],0];

_grp addWaypoint [[11589.874,12233.017],0];

_grp addWaypoint [[11489.067,12227.245],0];

_grp addWaypoint [[11456.33,12223.446],0];

_grp addWaypoint [[11436.213,12270.41],0];

_grp addWaypoint [[11427.841,12301.959],0];

_grp addWaypoint [[11436.461,12337.418],0];
[_grp, 22] setWaypointCombatMode "RED";
[_grp, 22] setWaypointSpeed "NORMAL";

_grp addWaypoint [[11457.306,12368.411],0];

_grp addWaypoint [[11479.344,12390.774],0];

_grp addWaypoint [[11513,12405.842],0];

_grp addWaypoint [[11541.534,12412.131],0];

_grp addWaypoint [[11554.06,12422.689],0];

_grp addWaypoint [[11602.235,12538.146],0];

_grp addWaypoint [[11610.324,12561.085],0];

_grp addWaypoint [[11619.304,12593.879],0];

_grp addWaypoint [[11629.916,12617.176],0];
[_grp, 31] setWaypointType "UNLOAD";
[_grp, 31] setWaypointCombatMode "RED";
[_grp, 31] setWaypointFormation "FILE";
[_grp, 31] setWaypointSpeed "NORMAL";

_grp setCurrentWaypoint [_grp, 1];

The Script will be Started with:

["TRUCKMARKER","TRUCKWAYPOINTS",240] execVM "server\truckgenerator.sqf";

TRUCKMARKER = Marker

TRUCKWAYPOINTS = FILE: "server\waypoints\TRUCKWAYPOINTS.sqf"

240 = Direction

Share this post


Link to post
Share on other sites

R34P3R

You did the common mistake of using the OFP createUnit command.

type createUnit [ position, group, init, skill, rank]

In Arma and Arma 2 the createUnit command which returns an object which you can alter is

Object = group createUnit [type, position, markers, placement, special]

So your script will work if you do:

_Leader = _gruppe createUnit ["RU_Soldier_TL",_pos,[],1,""];
_Leader moveInDriver _truck;

Then you need to set the skill and rank with

http://community.bistudio.com/wiki/setSkill

http://community.bistudio.com/wiki/setRank

Edited by Taurus

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  

×