Because team weapon crew is so complex there's bound to be many issues that arise from us doing what the game isn't meant to do. Although it may not be possible to get everything perfect, we can mitigate and fix some of the problems that team weapon crew presents.
Normally how team weapon tp_mobile works is that the team weapon itself does not have its HP displayed within the squad. Instead the squad HP bar is split evenly between all its members. We can trick the game into making the HP bar behave as a normal entity though. Add a blank team_weapon_ext to all child entities with tp_mobile. You can then just delete health_ext and that will make the child entities invincible. Weapon targeting should be off in type_ext.
Unfortunately I don't think it's possible to fix this one.
Terrain Kick Up
If you're dealing with multiple child entities you may have noticed that there's a lot of material that the wheels kick up because of the many stacked entities. To fix this use the above state on child entities.
Clean Up Your Extensions
Since child entities are purely for visuals you should probably remove everything that isn't necessary. An example would be shot blocking or some similar unintended consequence.
Because there's a movement delay between parent and child you'll have much better results by just making all the visuals as child entities. This comes at the cost of not having any turrets move but we can somewhat get around that which will be explained later.
Set the damage_state of the parent to crush or some similar state that hides it. Ensure that the movement_ext as well as the simvis attributes of all entities are the same. If your entities have a hold remove the garrison state action as I believe this interferes with movement somehow.
There will still be some desyncs, especially if the unit travels over long distances, but it will be much better than before.
There are 3 ways to have turrets with team weapons, each with certain advantages and disadvantages.
- The 'vanilla' system. This is the default system that requires set up and tear down that was explained in a previous post. It only allows firing when not moving and is prone to many bugs if not implemented correctly. Possible issues are the ignoring of cooldown on rapid attack moving among other things.
- The replacement system. Like the previous method it only allows firing when stationary. This will create an unattached entity with offsets when stationary allowing you to bypass some of the undesirable behavior of team weapons. However, you will not be able to order attacks directly and kills will not be logged as the firing entity isn't part of the squad. This system would be recommended if you've run out of hold blueprints or would like to add multiple turrets to a parent.
- The garrison system. This will superficially match most of the behavior of a normal turret and does allow attacking whilst moving unlike the other two methods. However, because it is a garrison, it will suffer from similar problems as the previous method of not being able to order attacks and having kills logged on the garrisoned squad. It will also create a decorator besides the team weapon squad although we can remove the decorator in the top right UI.
Normally a garrisoned squad will choose a random combat slot as well as have a diagonal facing rotation which of course isn't ideal for making a turret. Luckily there's a way around these two issues. Some types of buildings have combat slots for mortar, hmg, and other types. These differ from the normal infantry slots as they are exclusively reserved for these hold types. For example a mortar combat slot will only allow mortar hold type units in it.
There are many different buildings that have these special combat slots but the ones we will be focusing on are those that do not normally hold units to prevent conflicts as we will be using offsets. Keep in mind that because garrisons wont be able to show their held units if you use a different abp name than the original you're hard limited to a certain amount of holds. Below is a list of some buildings that A, only have a single combat slot per hold type and B, do not natively hold units. There may be more but I'll leave that up to someone else to look for.
To correctly position your offset you'll need to look at the mua marker and adjust the offsets accordingly. You can change the hold type with holdable_ext in ebps for the garrisoned entity and hold_ext for the garrison. The red cells mean that there's multiple markers for that hold type so it's probably not compatible with this specific purpose.
You can learn more about combat slots in the hold_info within the tuning tab. Type will refer to the same string within the mua file. Use_slot_heading means if the garrisoned entity will use the same direction as the parent. Everything but "infantry only" and "mortar" have limited angles so keep that in mind. In short, the mortar type combat slot should generally be the preferred combat slot for turrets. Others will only be useful if you're fine with a 120 degree firing angle.
The medium combat slot can hold several types of entities. This means there can be issues which slot the entity is assigned to depending on the other types of combat slots available for the hold. For example for the Soviet base_building_2 you should probably have the garrisoned squad have 2 entities. One with a hold_large_gun type to occupy the medium slot, and another with your desired combat slot such as hmg.
Infantry only is not ideal for turrets because the use_slot_heading is false. The only instance where I can think of this being useful would be if the hull is hidden either through skins or being obscured by something else, showing only the turret part of the tank. Another use would be to use this for an extremely slow moving unit as the lag in updating position will be obscured by its slow movement.
You can delete moving_ext for garrisoned entities to prevent them from turning to face targets. This will allow only the turrets to turn whilst the hull will keep the direction of the parent. If you use an infantry holdable type it will have some visual issues turning as they use their own movement but without a moving_ext it wont update correctly. To fix this just add the moving_ext but also know that the entity's direction will always face its target. If rotation is set to 0 then the entity's rotation will be locked, regardless of the parent entity's rotation.
The angle_of_fire will override the values within tracking in the weapon category.
Facing up, mortar. Sov base_building_1 left GER base_building_1 right.
Landkreuzer from my mod.
The above picture shows the garrison system in action. There are 7 garrisoned squads in addition to a team weapon. Each turret is able to fire when moving.
World builder is a great tool to save time and design your models. However there's a couple of limitations with vehicles that unfortunately cannot be worked around. Vehicles cannot have their x or z axis rotation changed, presumably because world builder reads the simvis attributes and thus make the blueprint have gravity. Similarly if you change the y position the vehicle will fall 1 meter but you can simply account for this when setting offsets. These impediments will make designing models more difficult.