simicsko 4 Posted October 11, 2022 Hi all! How can I create a vehicle with a custom crew? If I use the lines below, the APC vehicle will be spawned with the automatically assigned AI units: _drivers = createGroup EAST; RedAPC1 = [(getMarkerPos "marker01"), 180, "O_APC_Wheeled_02_rcws_v2_F", _drivers] call BIS_fnc_spawnVehicle; I downloaded a Skynet MOD for my son, and I want to put its robot units (Max_terminator_skeleton) in, for example, an APC. How can I set custom units with a script? Thank you in advance for the help. Share this post Link to post Share on other sites
gc8 977 Posted October 11, 2022 something like this would work for the driver: _pos = getMarkerPos "marker01"; _drivers = createGroup EAST; _veh = "O_APC_Wheeled_02_rcws_v2_F" createVehicle _pos; // Create veh like this so it doesn't have crew _unit = _drivers createUnit ["Max_terminator_skeleton", _pos , [], 0, "FORM"]; _unit moveInDriver _veh; then just create gunner too if needed (moveInGunner) Share this post Link to post Share on other sites
simicsko 4 Posted October 11, 2022 21 minutes ago, gc8 said: something like this would work for the driver: _pos = getMarkerPos "marker01"; _drivers = createGroup EAST; _veh = "O_APC_Wheeled_02_rcws_v2_F" createVehicle _pos; // Create veh like this so it doesn't have crew _unit = _drivers createUnit ["Max_terminator_skeleton", _pos , [], 0, "FORM"]; _unit moveInDriver _veh; then just create gunner too if needed (moveInGunner) Ohh tanks, its working. 😉 However, when I hit the APC with even a handgun, the crew gets out of the armored vehicle to fight. Can this be prevented somehow? Share this post Link to post Share on other sites
gc8 977 Posted October 11, 2022 10 minutes ago, simicsko said: Ohh tanks, its working. 😉 However, when I hit the APC with even a handgun, the crew gets out of the armored vehicle to fight. Can this be prevented somehow? i guess it needs _unit assignAsGunner _veh; for the unit to stay in.. can't think of anything else right now Edit: there's also the allowCrewInImmobile command if needed Share this post Link to post Share on other sites
simicsko 4 Posted October 11, 2022 1 hour ago, gc8 said: i guess it needs _unit assignAsGunner _veh; for the unit to stay in.. can't think of anything else right now Edit: there's also the allowCrewInImmobile command if needed I already tried the assignAsGunner command, they gets out the same way. The allowCrewInImmobile command alone didn't help, but I found this function on the same website: KK_fnc_allowCrewInImmobile = { _this allowCrewInImmobile true; { _x disableAI "FSM"; _x setBehaviour "CARELESS"; } forEach crew _this; }; This works great. They stay in the vehicle and fight and play tactics in it. Thank you very much for the lightning fast help. 🙂 Share this post Link to post Share on other sites
gc8 977 Posted October 11, 2022 Hmm , strange that you have to go all that way just to make them stay in. But glad you got it working! 1 Share this post Link to post Share on other sites
simicsko 4 Posted October 11, 2022 Just now, gc8 said: Hmm , strange that you have to go all that way just to make them stay in. But glad you got it working! Maybe it's because it's a MOD and T800 units don't behave in the usual way. I'm so glad it works out. 🙂 1 Share this post Link to post Share on other sites
pierremgi 4904 Posted October 11, 2022 7 minutes ago, simicsko said: I already tried the assignAsGunner command, they gets out the same way. The allowCrewInImmobile command alone didn't help, but I found this function on the same website: KK_fnc_allowCrewInImmobile = { _this allowCrewInImmobile true; { _x disableAI "FSM"; _x setBehaviour "CARELESS"; } forEach crew _this; }; This works great. They stay in the vehicle and fight and play tactics in it. The KK's function is outdated (2015). Since v 2.10 (last update) the command as an alternative syntax, making it more powerful: vehicle allowCrewInImmobile [brokenWheels, upsideDown] It's also a good habit to addVehicle to your group : _drivers addVehicle _veh; 1 Share this post Link to post Share on other sites
simicsko 4 Posted October 11, 2022 50 minutes ago, pierremgi said: The KK's function is outdated (2015). Since v 2.10 (last update) the command as an alternative syntax, making it more powerful: vehicle allowCrewInImmobile [brokenWheels, upsideDown] It's also a good habit to addVehicle to your group : _drivers addVehicle _veh; For some reason, it doesn't work this way: vehicle allowCrewInImmobile [brokenWheels, upsideDown]; Neither if I put it in the init file nor if I put it in the init field of the vehicle. Nor if I put it in the spawn script. 😞 Share this post Link to post Share on other sites
Harzach 2517 Posted October 11, 2022 1 hour ago, simicsko said: it doesn't work this way You are changing "vehicle" to the appropriate relevant variable, yes? 1 Share this post Link to post Share on other sites
simicsko 4 Posted October 13, 2022 On 10/11/2022 at 9:26 PM, Harzach said: You are changing "vehicle" to the appropriate relevant variable, yes? Of course. In script: REDAPC1 allowCrewInImmobile [brokenWheels, upsideDown]; In object init: this allowCrewInImmobile [brokenWheels, upsideDown]; Share this post Link to post Share on other sites
pierremgi 4904 Posted October 13, 2022 55 minutes ago, simicsko said: Of course. In script: REDAPC1 allowCrewInImmobile [brokenWheels, upsideDown]; In object init: this allowCrewInImmobile [brokenWheels, upsideDown]; REDAPC1 allowCrewInImmobile [TRUE,TRUE]; // needs boolean 2 Share this post Link to post Share on other sites
simicsko 4 Posted October 14, 2022 17 hours ago, pierremgi said: REDAPC1 allowCrewInImmobile [TRUE,TRUE]; // needs boolean It still doesn't work, but it may be caused by objects in the Terminator MOD and only not working for objects loaded in the EDEN editor. But that's okay, because it works with the function. However, speaking of script-based spawning, I'd like a little more help with convoy spawning. I tried to use the script below to spawn convoly. The vehicles spawn in, but don't start: _convSpawn = (getMarkerPos "RedConv_Init1"); _MRAPCrews1 = createGroup east; _MRAPVeh1 = "O_MRAP_02_gmg_F" createVehicle (getMarkerPos _convSpawn); "Max_terminator_skeleton" createUnit [(getMarkerPos _convSpawn),_MRAPCrews1]; "Max_terminator_skeleton" createUnit [(getMarkerPos _convSpawn),_MRAPCrews1]; ((units _MRAPCrews1) select 0) assignAsDriver _MRAPVeh1; ((units _MRAPCrews1) select 0) moveInDriver _MRAPVeh1; ((units _MRAPCrews1) select 1) assignAsGunner _MRAPVeh1; ((units _MRAPCrews1) select 1) moveInGunner _MRAPVeh1; _MRAPVeh1 call KK_fnc_allowCrewInImmobile; [_MRAPVeh1] joinSilent _convoyGroup; sleep 0.5; _MRAPCrews2 = createGroup east; _MRAPVeh2 = "O_MRAP_02_gmg_F" createVehicle (getMarkerPos _convSpawn); "Max_terminator_skeleton" createUnit [(getMarkerPos _convSpawn),_MRAPCrews2]; "Max_terminator_skeleton" createUnit [(getMarkerPos _convSpawn),_MRAPCrews2]; ((units _MRAPCrews2) select 0) assignAsDriver _MRAPVeh2; ((units _MRAPCrews2) select 0) moveInDriver _MRAPVeh2; ((units _MRAPCrews2) select 1) assignAsGunner _MRAPVeh2; ((units _MRAPCrews2) select 1) moveInGunner _MRAPVeh2; _MRAPVeh2 call KK_fnc_allowCrewInImmobile; [_MRAPVeh2] joinSilent _convoyGroup; sleep 0.5; _MRAPCrews3 = createGroup east; _MRAPVeh3 = "O_MRAP_02_gmg_F" createVehicle (getMarkerPos _convSpawn); "Max_terminator_skeleton" createUnit [(getMarkerPos _convSpawn),_MRAPCrews3]; "Max_terminator_skeleton" createUnit [(getMarkerPos _convSpawn),_MRAPCrews3]; ((units _MRAPCrews3) select 0) assignAsDriver _MRAPVeh3; ((units _MRAPCrews3) select 0) moveInDriver _MRAPVeh3; ((units _MRAPCrews3) select 1) assignAsGunner _MRAPVeh3; ((units _MRAPCrews3) select 1) moveInGunner _MRAPVeh3; _MRAPVeh3 call KK_fnc_allowCrewInImmobile; [_MRAPVeh3] joinSilent _convoyGroup; sleep 0.5; convoyScript = [_convoyGroup] spawn TOV_fnc_SimpleConvoy; // The RedConv1wp1 marker is created in the EDEN editor // _RedConv1wp1 = _MRAPCrews1 addWaypoint [(getmarkerpos "RedConv1wp1"), 0]; _RedConv1wp1 setWaypointType "MOVE"; _RedConv1wp1 setWaypointSpeed "LIMITED"; _RedConv1wp1 setWaypointBehaviour "COMBAT"; _RedConv1wp1 setWaypointCombatMode "RED"; What needs to be done to start the convoy? What am I doing wrong? I note that if I only spawn one vehicle using this method, it does its job okay. Share this post Link to post Share on other sites
pierremgi 4904 Posted October 14, 2022 should be: _MRAPVeh1 allowCrewInImmobile [TRUE,TRUE]; Anyway: _RedConv1wp1 setWaypointBehaviour "COMBAT" // Never for a convoy Use: _RedConv1wp1 setWaypointBehaviour "CARELESS" as far as your group is made of vehicles (and that's already the behavior if you're using KK's function). Note: for vehicles, gunners can still fire in careless behavior (that's Arma!) Use also : setConvoySeparation 1 Share this post Link to post Share on other sites
simicsko 4 Posted October 14, 2022 1 hour ago, pierremgi said: should be: _MRAPVeh1 allowCrewInImmobile [TRUE,TRUE]; Anyway: _RedConv1wp1 setWaypointBehaviour "COMBAT" // Never for a convoy Use: _RedConv1wp1 setWaypointBehaviour "CARELESS" as far as your group is made of vehicles (and that's already the behavior if you're using KK's function). Note: for vehicles, gunners can still fire in careless behavior (that's Arma!) Use also : setConvoySeparation Alright, as soon as I'm at the machine, I'll give it a try. One question: did I give the waypoint to the right group? Share this post Link to post Share on other sites
pierremgi 4904 Posted October 14, 2022 16 minutes ago, simicsko said: One question: did I give the waypoint to the right group? Difficult to say, there are too many lines and calls for extra functions to have a clear view for your scripts. That double work imho. Try with _convoyGroup and check what TOV function does for convoy. Share this post Link to post Share on other sites
simicsko 4 Posted October 14, 2022 2 minutes ago, pierremgi said: Difficult to say, there are too many lines and calls for extra functions to have a clear view for your scripts. That double work imho. Try with _convoyGroup and check what TOV function does for convoy. Okay. Ok, I'll test it and send feedback. 😉 Share this post Link to post Share on other sites
simicsko 4 Posted October 15, 2022 22 hours ago, simicsko said: Alright, as soon as I'm at the machine, I'll give it a try. One question: did I give the waypoint to the right group? 23 hours ago, pierremgi said: should be: _MRAPVeh1 allowCrewInImmobile [TRUE,TRUE]; Anyway: _RedConv1wp1 setWaypointBehaviour "COMBAT" // Never for a convoy Use: _RedConv1wp1 setWaypointBehaviour "CARELESS" as far as your group is made of vehicles (and that's already the behavior if you're using KK's function). Note: for vehicles, gunners can still fire in careless behavior (that's Arma!) Use also : setConvoySeparation The convoy still does not start. All vehicles spawning, the crew gets in but they don't start. 😞 Share this post Link to post Share on other sites
Larrow 2822 Posted October 16, 2022 On 10/14/2022 at 7:51 AM, simicsko said: [_MRAPVeh1] joinSilent _convoyGroup; Joining a vehicle to a group. Only units respond to join group. Also, what is _convoyGroup? As it is never defined. On 10/14/2022 at 7:51 AM, simicsko said: _convSpawn = (getMarkerPos "RedConv_Init1"); _MRAPVeh1 = "O_MRAP_02_gmg_F" createVehicle (getMarkerPos _convSpawn); You get the marker position of "RedConv_Init1" in the variable _convSpawn, but then when spawning the units you try to get the marker position of a position(_convSpawn). All references to the position should just be _convSpawn without the getMarkerPos. _convSpawn = (getMarkerPos "RedConv_Init1"); _MRAPVeh1 = "O_MRAP_02_gmg_F" createVehicle _convSpawn; Spoiler _convSpawn = getMarkerPos "RedConv_Init1"; _convGroups = []; for "_i" from 1 to 3 do { _group = createGroup east; _convGroups pushBack _group; _vehicle = createVehicle[ "O_MRAP_02_gmg_F", _convSpawn, [], 0, "NONE" ]; _driver = _group createUnit[ "Max_terminator_skeleton", _convSpawn, [], 0, "FORM" ]; _driver assignAsDriver _vehicle; _driver moveInDriver _vehicle; _gunner = _group createUnit[ "Max_terminator_skeleton", _convSpawn, [], 0, "FORM" ]; _gunner assignAsGunner _vehicle; _gunner moveInGunner _vehicle; _vehicle call KK_fnc_allowCrewInImmobile; //[_vehicle] joinSilent _convoyGroup; //makes no sense joining a vehicle to a group }; //What is _convoyGroup? It is undefined from the code you have shown //convoyScript = [_convoyGroup] spawn TOV_fnc_SimpleConvoy; // The RedConv1wp1 marker is created in the EDEN editor // _wp = _convGroups select 0 addWaypoint[ getMarkerPos "RedConv1wp1", 0 ]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "LIMITED"; _wp setWaypointBehaviour "COMBAT"; _wp setWaypointCombatMode "RED"; Share this post Link to post Share on other sites
simicsko 4 Posted October 17, 2022 15 hours ago, Larrow said: Joining a vehicle to a group. Only units respond to join group. Also, what is _convoyGroup? As it is never defined. You get the marker position of "RedConv_Init1" in the variable _convSpawn, but then when spawning the units you try to get the marker position of a position(_convSpawn). All references to the position should just be _convSpawn without the getMarkerPos. _convSpawn = (getMarkerPos "RedConv_Init1"); _MRAPVeh1 = "O_MRAP_02_gmg_F" createVehicle _convSpawn; Reveal hidden contents _convSpawn = getMarkerPos "RedConv_Init1"; _convGroups = []; for "_i" from 1 to 3 do { _group = createGroup east; _convGroups pushBack _group; _vehicle = createVehicle[ "O_MRAP_02_gmg_F", _convSpawn, [], 0, "NONE" ]; _driver = _group createUnit[ "Max_terminator_skeleton", _convSpawn, [], 0, "FORM" ]; _driver assignAsDriver _vehicle; _driver moveInDriver _vehicle; _gunner = _group createUnit[ "Max_terminator_skeleton", _convSpawn, [], 0, "FORM" ]; _gunner assignAsGunner _vehicle; _gunner moveInGunner _vehicle; _vehicle call KK_fnc_allowCrewInImmobile; //[_vehicle] joinSilent _convoyGroup; //makes no sense joining a vehicle to a group }; //What is _convoyGroup? It is undefined from the code you have shown //convoyScript = [_convoyGroup] spawn TOV_fnc_SimpleConvoy; // The RedConv1wp1 marker is created in the EDEN editor // _wp = _convGroups select 0 addWaypoint[ getMarkerPos "RedConv1wp1", 0 ]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "LIMITED"; _wp setWaypointBehaviour "COMBAT"; _wp setWaypointCombatMode "RED"; Sorry, the variable definition was accidentally missed while copying. The variable in question was defined as follows: _convoyGroup = createGroup [EAST,true]; Thank you so much for the script. As soon as I'm at the machine I'll try it out and feedback. 😉 Share this post Link to post Share on other sites
Larrow 2822 Posted October 18, 2022 11 hours ago, simicsko said: Sorry, the variable definition was accidentally missed while copying. The variable in question was defined as follows: _convoyGroup = createGroup [EAST,true]; Then you might as well spawn the units into that group(use in createUnit) rather than creating a new group each time(_MRAPCrews1/2/3) and then transferring them into _convoyGroup. Share this post Link to post Share on other sites
simicsko 4 Posted October 18, 2022 On 10/16/2022 at 10:38 PM, Larrow said: Joining a vehicle to a group. Only units respond to join group. Also, what is _convoyGroup? As it is never defined. You get the marker position of "RedConv_Init1" in the variable _convSpawn, but then when spawning the units you try to get the marker position of a position(_convSpawn). All references to the position should just be _convSpawn without the getMarkerPos. _convSpawn = (getMarkerPos "RedConv_Init1"); _MRAPVeh1 = "O_MRAP_02_gmg_F" createVehicle _convSpawn; Reveal hidden contents _convSpawn = getMarkerPos "RedConv_Init1"; _convGroups = []; for "_i" from 1 to 3 do { _group = createGroup east; _convGroups pushBack _group; _vehicle = createVehicle[ "O_MRAP_02_gmg_F", _convSpawn, [], 0, "NONE" ]; _driver = _group createUnit[ "Max_terminator_skeleton", _convSpawn, [], 0, "FORM" ]; _driver assignAsDriver _vehicle; _driver moveInDriver _vehicle; _gunner = _group createUnit[ "Max_terminator_skeleton", _convSpawn, [], 0, "FORM" ]; _gunner assignAsGunner _vehicle; _gunner moveInGunner _vehicle; _vehicle call KK_fnc_allowCrewInImmobile; //[_vehicle] joinSilent _convoyGroup; //makes no sense joining a vehicle to a group }; //What is _convoyGroup? It is undefined from the code you have shown //convoyScript = [_convoyGroup] spawn TOV_fnc_SimpleConvoy; // The RedConv1wp1 marker is created in the EDEN editor // _wp = _convGroups select 0 addWaypoint[ getMarkerPos "RedConv1wp1", 0 ]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "LIMITED"; _wp setWaypointBehaviour "COMBAT"; _wp setWaypointCombatMode "RED"; I tried your script last night. Vehicles and skeletal units spawn, get into the vehicle, but for some reason the convoy does not start. What could still be the problem? Share this post Link to post Share on other sites