ExtraPublicBone is used to expose a bone in a W3D model in a Draw module to logic outside of the draw module, so other behavior modules can access those bones.
Certain bone names are already hard coded as being public (in GameData.ini), but sometimes even those bones have to be declared in ExtraPublicBone lines.
Another useful line in a Draw module is
ParticlesAttachedToAnimatedBones = Yes
This is in Zero Hour. In Generals they use a
ClientUpdate = AnimatedParticleSysBoneClientUpdate
behavior module to achieve the same effect, namely, to make sure that particle effects that attach to bones that are animated stay attached to those bones as they move. Without this, then when the bones move, the particle systems will still stay at the old bone positions.
A useful use of ExtraPublicBone is to attach a model in one Draw module to a bone in model in another drae module. The draw module that has the bone to attach to declares it in an ExtraPublicBone line, and the draw module that has the model to attach to that bone has a line that says AttachToBoneInAnotherModule. See the GLA technicals for example. The technical gunners are attached to the vehicle models in this way.
The CivilianVehiclePTBoat has a coding error in which the ExtraPublicBone line is missing from the draw module that draws the boat model, which is why you see the PT boat gunner standing inside the deck of the boat instead of standing on the deck on the boat. Since the bone is not made public, the module that draws the gunner does not know where to attach the model to and just draws it at the object origin.
Note that attaching models to other models using this method only works properly for objects that have BuildCompletion = APPEARS_AT_RALLY_POINT and are built by Unit_BUILD commmand buttons, as oppsed to objects that have BuildCompletion = PLACED_BY_PLAYER and are created using DOZER_CONSTRUCT command buttons. For dozer built objects, they will appear as though the extra public bone line was missing when built. But when you save the game and reload the saved game, they will then appear with the models correctly attached to bones.
Last edited by beng; 01-07-2008 at 06:32 PM.
|