Jump to content
Sign in to follow this  
lockjaw-65-

create vehicle with name

Recommended Posts

Thanks guys for the info, not sure what to do here. I really wanted to put some kind of static defences in my mission but if they are that dumb or I cant find a scritp to improve them, then I think I will have to remove them :-(

Share this post


Link to post
Share on other sites

What I usually do is place an empty gun and then have a group of 2 or three units with a getin waypoint over the gun.

The two remaining act as spotter and if the MGunner gets killed one of the other units takes his place.

Share this post


Link to post
Share on other sites

thanks, that will work for units placed on the map. The problem I have is that they are all spawned mid mission with the scripts that we have been talking about in this thread. The static guns are spawned then the crew. I suppose what im asking is wether the script that spawns the crew could be modified to make them more aware?

Share this post


Link to post
Share on other sites

Ok its official I dont know what im doing LOL. I cant work out how to include this into the script you provided without messing it up....

Share this post


Link to post
Share on other sites

ok Im trying to set skill level of spawned crew, this is what i think it should be:

_spawn_zone = _this select 0;
_veh_type = _this select 1;
_name = _this select 2;
_dir = _this select 3;// new

_group = createGroup east;
_veh = createVehicle [_veh_type, _spawn_zone, [], 0, "NONE"];
_driver = _veh emptyPositions "driver";
_gunner = _veh emptyPositions "gunner";
_commander = _veh emptyPositions "commander";
_cargo = (_veh emptyPositions "cargo") - 1;
if (_driver > 0) then {"MVD_Soldier" createUnit [_spawn_zone, _group, "this moveinDriver _veh;this assignAsDriver _veh;this setskill ["general",1]"];};
if (_gunner > 0) then {"MVD_Soldier" createUnit [_spawn_zone, _group, "this moveinGunner _veh;this assignAsGunner _veh;this setskill ["spotDistance",1]"];};
if (_commander > 0) then {"MVD_Soldier" createUnit [_spawn_zone, _group, "this moveinCommander _veh;this assignAsCommander _veh;"];};
for "_i" from 0 to _cargo do
{
"MVD_Soldier" createUnit [_spawn_zone, _group, "this moveinCargo _veh;this assignAsCargo _veh;this setskill ["spotDistance",1]"];
};
_veh setdir _dir;// new
_veh SetVehicleVarName _name;
call compile format["%1 = _veh", _name];

but no crew is spawned at all..

Edited by LockJaw-65-
posted wrong code snippet

Share this post


Link to post
Share on other sites

Error in the code:

if (_driver > 0) then {"MVD_Soldier" createUnit [_spawn_zone, _group, "this moveinDriver _veh;this assignAsDriver _veh;this setskill [""general"",1];"];};

Modify all the same lines ;)

Share this post


Link to post
Share on other sites

No I got no error messages and that link does not seem to work..

---------- Post added at 07:28 PM ---------- Previous post was at 07:25 PM ----------

Ok works now, thanks I will use it :)

Share this post


Link to post
Share on other sites
No I got no error messages and that link does not seem to work..

Sorry it does now.

Share this post


Link to post
Share on other sites

Just installed the new patch 1.60. Now all the Ai etc that are spawned do nothing again even the tungstas dont fire at aircraft? Also noticed that Ai driving on roads is really bad now and even the DACs seems dumb at spotting enemy and engageing...

Just reinstalled entire game and it seems ok now, will do a bit more testing tonight..

Edited by LockJaw-65-
may be resolved

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  

×