Data/Actors/Model

# CActorModel

Inherits from CActor<-CActorBase<-CActorBearings

## Description

Actors that have visuals in the game world are inherited from this Actor type (with some exceptions like Splats, Quads and Squibs)

### Hint

* Always remember to destroy your actors after the visual has ended to prevent lag
* When used as an attachment, model actors can be chained ad nauseum. If combined with careful scaling and positional/rotational site operations units can be made to look completely different.

## Example Usage

### Fungal Growth

When the Fungal Growth ability of the Infestor applies the associated buff onto target units, the model actor is created attached to the unit's center attachment point when unit has the buff applied. The model is then destroyed after the BSD animation has played after the buff expires.

### Leviathan Tentacle A-D

Permanent hardpoint attached tentacle models on the Leviathan unit capable of coinciding movement with the attacks associated with the tentacles.

### Yoink Tentacle

Viper's abduct ability is a CActorModel Model.

## Fields Description

#### Description

Link to the model entry this actor uses, defined under Models data type

#### Description

Configures model aspects for the CActorModel. Model aspects cause different models to appear to different players, depending on the rules in the aspect set

#### ModelAspectSet

* Aspects
* Trigger Model

#### Description

Scale applied to this actor in the X,Y,Z dimensions

#### Notes

* Model scale can also be set under the model that this actor uses in the models data type
* It is most of the time better practice to adjust the models scale instead of adjusting actor scale.
* Actor scale changes are recommended for buffs like warcraft 'Blood Lust' that temporarily increases the scale through SetScale actor messages.

#### Description

This model actor will be automatically scaled by an amount determined by multiplying the Auto Scale Factor with the ratio between the parent model's radius and this model's radius defined in Model Data. For example, the model would be scaled larger when attached to a model with a radius greater than the model's own radius. Burrowed splats use this to automatically scale to each Zerg unit.

#### Description

This model actor will be automatically scaled by an amount determined by multiplying the Auto Scale From Selection Factor with the ratio between the parent model's selection radius and this model's selection radius defined in Model Data. This works exactly like the Auto Scale Factor field except it is based on the Selection Radius field in Model Data.

#### Notes

* Useful for setting your own custom scaling factors instead of the 3d model itself.

#### Description

This affects the animation blend times for all animations on this model.  When set to -1, this will use the Global Animation Blend Time setting.

### Hosted Attachements

This field allows you to dynamically control bones in the model that are configured as attach points. The attach point will be procedurally positioned based on the position of the host actor configured here. This can be used to stretch the model to follow a missile mover like for the Spine Crawler's Tentacle attack.

* Let's take the picture above as an example. When HotS Leviathan is created, its CUnit actor creates 4 tentacles CModel Actors. Here, in the first one of them (Model A), there is the Hosted Attachment field. Here's how it works:
	1. The Methods field indicates which part of the tentacle model should be pulled out for a stretch.
	2. When the Leviathan tentacle attack strikes, an invisible missile actor (its model is invisible) is launched, referencing itself as "TentacleAttack" within its actor events. In doing so, that missile actor takes hold of the tip of the tentacle (this is where the weapon point is on the model, chosen by the method). This indicates to the Tentacle CActor Model to stretch, to where exactly the missile currently is. Then, when the missile returns (because it's a Return type of launch missile effect that commands the tentacle), then arrives, it sends a signal to the CModel Actor to clear any "TentacleAttack" reference, allowing the Tentacle to stay back at its hosted position.
	3. On the same note, the host (the Leviathan) remains the holder of the root of the model (the supporter). The Host Site Operation of the Tentacle CActor Model adjusts where it goes; In other words, Hosted Attachment is not related to the host itself, but rather is a permission given to any other actor to take hold of the specified point of the Tentacle actor and stretch it.

#### HostedAttach

* Attachment Query
* Host Site Operations
* Name

#### Description

(Unsure) NovaXanthosRocketBarrageIndicatorModel is the only model that uses this.

#### SplatHeight

* **Actor Minimum:** At its lowest, the splat draws itself at the z value of its owning actor.
* **Automatic:** Acts as the MinimumTerrain option for splats that are marked as AOELayer, and acts as the Normal option for splats that are not.
* **Normal:** Unrestricted; the splat can draw itself at whatever height it finds terrain to map itself to.
* **Terrain Minimum:** At its lowest, the splat draws itself at the z value of the map's base height.

#### Description

Defines a different host actor when performing 2nd visibility test.

#### ActorRequest

* Actor
* Fail If No Host
* Scope
* Effect
* Reach Across Effect Trees

### HostSiteOpsFor2ndVisibilityTest

Name:Host Site Ops For Second Visibility Test

#### Description

Site ops are used to customize the position and rotation (bearings) that are inherited from the 2nd Visibility host.

#### SiteOpsData

* Hold Position
* Hold Rotation
* Operations

### LocalOffsetFor2ndVisibilityTest

Name:Local Offset For 2nd Visibility Test

#### Description

Fog of War visibility tests are performed at the Proximity Position, which is typically the actor's center (0, 0, 0). If this field is set, a second visibility test will be performed that can only make the actor more visible. The offset is specified in local coordinates where positive y matches the facing of the actor and positive x is to the right of the actor. This can be used to extend an actor's visibility in only one direction.

#### Description

Flags that apply to all model actors.  These flags change certain aspects of model behavior such as whether it can be hit tested (clicked on), whether it ignores walkables (pass through doodads rather than stand on top of them), and whether visibility tests are performed at all.

#### Flags

* **Allow Hit Test:** Determines whether an actor can be clicked on or selected by the player.
	+ This can also be changed from the event: "Model Allow hit test" action, but using this flag leads to the same outcome.
	+ Sometimes we want a model to inherit from a model. At same time, we want the model to remain at its location (Hold Position Flag from Host Site Ops), and these 2 circumstances cause a problem with the model blocking units from clicking on the ground or even from selecting a unit from this model that is away.
	+ One good example is the Kerrigan Zerg Drop Pods. It is created from a model addition to have it spawn pods in random directions, on the unit. Once it's crashed and decaying, clicking on the decaying pod keeps redirecting the click on the unit the model is attached to, and not the point location. Allow hit test should be disable to fix that.

* **Animations Don't Reset On Unhide:** The animations on this actor model will not be reset when another animation that is hiding them is removed.

* **Automate Global Loops:** Cause the actor to look through the animations of its model and automatically start them when the actor is created.  Global loops are animation brackets with GLbirth, GLstand, GLdeath and/or GLdead animations that can be played automatically when a model is created.  They are typically used for continuous 'background' anims that need to play regardless of what the unit is doing.  The spinning rotor blades on the Banshee are an example.

* **Automated Global Loops Ignore Orphan:** Causes automated global loops to not transition out when the CActorModel's owning actor scope is orphaned.

* **Ignore Tipability With Host Or Site Ops:** While the CActorModel is getting its bearings from a host or from siteOps, it ignores the model's tipability setting in ModelData.xml.

* **Ignore Walkables:** Prevents 'walkable' models from adjusting the height of this actor.  Can be useful when positioning doodad actors such that they intersect with a walkable model to varying degrees, rather than always being on top of it (this can make maps feel more natural).

* **Needs Volume Monitor:** Marks an actor as containing target attach volumes (TAVs) that the engine must monitor during attacks. (TAVs cause an attack to appear to hit the surface of its target, rather than its center.)  For instance, a unit attacking a Command Center during construction must be aware of the construction scaffolding TAVs -- even though they are part of a separate model -- so that it can appear to impact the scaffolding while it is present.

* **Outline Emitter:** The model generates an outline when obscured by a model with the OutlineOccluder flag set.  In other words, the player can see an outline of the model through other models, almost as if he had X-ray vision.

* **Outline Occluder:** The model causes models marked by the OutlineEmitter flag to generate an outline that appears through the OutlineOccluder.  Useful for large buildings and other models behind which players might lose units.

* **Suppress Missing Attachment Errors:** Prevents errors when an attach query does not find any results and attempts to use a fallback attach point that is missing.  Useful for widely used default CActorModels that may be used with some models that do not have a complete set of basic attach points.

* **Suppress Player Decals:** Prevents decal textures from appearing on the model contained by this actor.

* **Undetected Is Hidden:** Causes a model to be invisible to enemies when it is not detected.  When present, overrides the ModelData.xml version of the flag.

* **Update Visibility:** Enables the actor to update its visibility in response to whether it is under the fog of war and various other factors.  It is almost always true, but is often turned off for death models.  In this case, the visibility is set once during the actor's creation and then never updated.  (This is so the player can see the full death animation, even when the target disappears under the fog of war.)

* **Use Constant Synchronous Seed:** Causes the model to use a synchronous random number seed from the game when choosing its model variation.  This seed is always the same for the lifetime of the actor's parent scope and cannot be accidentally made asynchronous.  Enables different Dark Templar variations to always appear the same on all machines participating in the game.

* **Use Player Spray For Decal:** Uses the player's selected spray reward as the decal texture.

* **Use Synchronous Seed:** Causes the model to use a synchronous random number seed from the game when choosing its model variation.  After it is used, the seed is modified and written back to the parent scope, such that if all model-setting events are synchronous, then all model variations on that particular model actor will be the same on all machines.  Used to ensure that some unit-related models like building attachments look the same on all machines.

* **Wireframe Render:** Causes the model to render as a wireframe, rather than with textures.  Good for displaying debugging actors, such as those that represent a camera's bearings.

#### Description

In the Model Data you can configure Events that will display actual footprints left by a unit's movement. The model specified here will be created to display the left or right footprints.

#### EventDataFootprint

* Actor
* Model
* Name

#### Description

In the Model Data you can configure Events that will display actual footprints left by a unit's movement. The actor specified here will be created to display the left or right footprints.

#### Description

In the Model Data you can configure Events that will play sounds at a specific point in an animation. The sound specified here will be played at that point in the animation.

#### EventDataSound

* Actor
* Sound
* Name

#### Description

In the Model Data you can configure Events that will play sounds at a specific point in an animation. The sound actor specified here will be created and played at that point in the animation.

#### Description

The proximity position determines where the first visibility test will be performed for the actor. Most actors use the Center Actor option to perform the test at (0, 0, 0). However, models that are not symmetrical typically need to use the Center Model Bounds option in order to move the visibility test offset from the center of the actor.

#### Proximity

* **Center Actor:** The model stores itself in the proximity query system using its parent actor's position.
* **Center Model Bounds:** The model stores itself in the proximity query system using the center of its model bounds.  Can produce more accurate query results when a model is very large and its model bounds center is quite distant from its actor's center.

#### Description

Configures the height of creep engulfment for this model based on the Actor Global Config's Creep Height Classes field. The default game data has Tiny, Small, and Medium configurations that normally match the height of the model.

#### LabelKey

* Default values defined in Actor Global Config are as follow, but can be edited by the user
	+ Default
	+ Medium
	+ Small
	+ Smaller
	+ Tiny
	+ Large
	+ Huge
	+ Full

#### Description

Configures the growth rate of creep engulfment for this model based on the Actor Global Config's Creep Rates field. This field must be set in order for a building to be engulfed by creep.

#### LabelKey

* Default value in Actor Global Config for 'Grow' is 0.3 speed, but can be edited by the user to include more varying rates

#### Description

Configures the shrink rate of creep engulfment for this model based on the Actor Global Config's Creep Rates field.

#### LabelKey

* Default value in Actor Global Config for 'Shrink' is 3.0 speed, but can be edited by the user to include more varying rates

#### Description

Physics impact data determines how a model responds to a Physics Impact Customize message. The values specified in the default physics impact data will be used unless the customized values have been modified from their default values.

#### PhysicsImpactData

* Actor Model
* Actor Sound
* Auto Volume Range
* Auto Volume Range Max
* Auto Volume Range Min
* Group
* Model Link
* Name
* Occurance Throttling Distance
* Occurance Throttling Distance Timeout
* Occurance Throttling Period
* Site Operations
* Sound Link

#### Description

Physics impact data determines how a model responds to a Physics Impact Customize message. The model or sound specified in the physics impact data will be created when the impact occurs. For example, this can be used to play a metallic sound when a physics body collides with a metal pipe.

#### PhysicsImpactData

* Actor Model
* Actor Sound
* Auto Volume Range
* Auto Volume Range Max
* Auto Volume Range Min
* Group
* Model Link
* Name
* Occurance Throttling Distance
* Occurance Throttling Distance Timeout
* Occurance Throttling Period
* Site Operations
* Sound Link

#### Description

Optionally limits the number of glazes that are drawn on the model at any given time.  Can be used to maintain performance in cases where a large number of materials might occasionally be applied simultaneously.

#### Description

Prioritizes CActorLookAts that might drive turret groups on this CActorModel.  In this way, one CActorLookAt can drive a turret group, but then be temporarily overridden by another, higher priority CActorLookAt.  For instance, a tank turret that normally points at an attack target might be temporarily overridden by an ability that casts a spell with visual FX that come from the barrel of the turret.

Later in the list has the most priority (ex.Cyclone Lock On ability LookAt has more priority)

```
<LookAtPriorityList value="CycloneWeaponTurretLookAt"/>
<LookAtPriorityList value="CycloneLockOnTurretLookAt"/>

```

#### ActorKey

* Array of direct references to CActorLookAt actors

## Related

* Attach Methods
* Events
* Models
* Site Operations (SOps)