juandayz Posted December 25, 2016 Report Share Posted December 25, 2016 hello have a lil question about how to set an unit ai as gunner of static weapon. im using this code.. the ai set as gunner as well but after 10 seconds, the ai die alone server side script _spawnstaticsguns = true; if (_spawnstaticsguns) then { _statictype = ["KORD_high_TK_EP1","DSHKM_Ins","M2StaticMG"] call BIS_fnc_selectRandom; _objectsm2 = createVehicle [_statictype, [(_position select 0) - 5, (_position select 1) - 4,0],[], 0, "CAN_COLLIDE"]; _objectsm2 setDir 0; _objectsm2 setVectorUp surfaceNormal position _objectsm2; _objectsm2 setVehicleLock "LOCKED"; _objectsm2 setVehicleAmmo 1; //_objectsm2 setVehicleVarName "gun"; sleep 1; _group_gunner = createGroup _center_1; _enemygunner = objNull; _enemygunner = _group_gunner createUnit [_enemytype,_mainpos,[],0,"CAN_COLLIDE"]; _enemygunner moveingunner _objectsm2; //_enemygunner setVehicleInit "this MoveInGunner gun;"; }; Link to comment Share on other sites More sharing options...
0 Liquid84 Posted December 25, 2016 Report Share Posted December 25, 2016 I use WAI and have static weapons at different locations. Works awesome. Place your custom static weapon spawns below */ [ [ // Position(s) (can be multiple) [22215.723, 19780.213, 13.0001], [22338.311, 19738.691, 23.540525], [22884.711, 19856.395, 11.0001], [22446.395, 20098.475, 6.8244929], [22893.8,20123.3,0.00158596], [22328.6,20185.3,0.00143862], [22499.5,18999.8,0.00143862], [23054.1,19151.2,0.00143862], [22536.129, 19998.018, 6.6184354], [23064.297, 19371.266, 10.033691] ], "M2StaticMG", // Classname of turret "extreme", // Skill level of unit (easy, medium, hard, extreme, Random) "Random", // Skin classname, use "Random" or classname here "Bandit", // AI Type, "Hero" or "Bandit". "Random", // Primary gun set number. "Random" for random weapon set 9, // Number of magazines "Random", // Backpack classname, use "Random" or classname here "random" // Gearset classname, use "Random" or classname here ] call spawn_static; juandayz 1 Link to comment Share on other sites More sharing options...
0 juandayz Posted December 25, 2016 Author Report Share Posted December 25, 2016 mmm maybe i can take some in spawn_static function. do you have it for 1.6? Link to comment Share on other sites More sharing options...
0 salival Posted December 25, 2016 Report Share Posted December 25, 2016 @juandayzIs the AI getting killed for being a hacker? You will need to do: dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_objectsm2]; juandayz 1 Link to comment Share on other sites More sharing options...
0 juandayz Posted December 26, 2016 Author Report Share Posted December 26, 2016 3 hours ago, salival said: @juandayzIs the AI getting killed for being a hacker? You will need to do: dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_objectsm2]; Yes i do it at first by any way the ai still die. //spawn gunner if staticsguns is true if (_spawnstaticsguns) then { _statictype = ["KORD_high_TK_EP1","DSHKM_Ins","M2StaticMG"] call BIS_fnc_selectRandom; //_objectsm2 = createVehicle [_statictype, [(_position select 0) - 5, (_position select 1) - 4,0],[], 0, "CAN_COLLIDE"]; _objectsm2 = createVehicle [_statictype, [(_position select 0),(_position select 1),0], [], 0, "CAN_COLLIDE"]; _objectsm2 setDir round(random 360); //_objectsm2 setDir 0; _objectsm2 setVectorUp surfaceNormal position _objectsm2; _objectsm2 setVehicleLock "LOCKED"; dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_objectsm2]; //_objectsm2 setVehicleAmmo 1; dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_objectsm2]; sleep 1; _group_gunner = createGroup _center_1; _enemygunner = objNull; _enemygunner = _group_gunner createUnit [_enemytype,_mainpos,[],0,"CAN_COLLIDE"]; _enemygunner moveingunner _objectsm2; }; Seems like when ai in mounted wepon spottt a player and try To aim he die inmediatly. I also think is being killed for use the weapon. Link to comment Share on other sites More sharing options...
0 juandayz Posted December 26, 2016 Author Report Share Posted December 26, 2016 fix it. i change the weapon class //_statictype = ["BAF_L2A1_Tripod_W","DSHKM_Ins","M2StaticMG"] call BIS_fnc_selectRandom; _statictype = "BAF_L2A1_Tripod_W"; seems like opfor is not be allowed to use the others weapons Link to comment Share on other sites More sharing options...
Question
juandayz
hello have a lil question about how to set an unit ai as gunner of static weapon.
im using this code.. the ai set as gunner as well but after 10 seconds, the ai die alone
server side script
_spawnstaticsguns = true; if (_spawnstaticsguns) then { _statictype = ["KORD_high_TK_EP1","DSHKM_Ins","M2StaticMG"] call BIS_fnc_selectRandom; _objectsm2 = createVehicle [_statictype, [(_position select 0) - 5, (_position select 1) - 4,0],[], 0, "CAN_COLLIDE"]; _objectsm2 setDir 0; _objectsm2 setVectorUp surfaceNormal position _objectsm2; _objectsm2 setVehicleLock "LOCKED"; _objectsm2 setVehicleAmmo 1; //_objectsm2 setVehicleVarName "gun"; sleep 1; _group_gunner = createGroup _center_1; _enemygunner = objNull; _enemygunner = _group_gunner createUnit [_enemytype,_mainpos,[],0,"CAN_COLLIDE"]; _enemygunner moveingunner _objectsm2; //_enemygunner setVehicleInit "this MoveInGunner gun;"; };
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now