Havok Script Commands

 

 

 

Which commands will I find in this document?

 

����������� havok_game_driven

����������� havok_physics_driven

����������� havok_lock_sleeping

����������� havok_force_awake

����������� havok_disable_wakeup

����������� havok_enable_wakeup

����������� force_explode

����������� altmodel

����������� altmodel_int

 

 

 

havok_game_driven

 

����������� Syntax:

 

����������������������� $targetname havok_game_driven [joint_name]

 

����������� What it does:

 

Sets bones to be game-driven. Game-driven bones cannot be woken-up directly by bullets, grenades, etc.

If no joint name is specified it will act on all joints in the asset. If a joint name is specified it will act only

On that joint. �Acting on the joint� means that if the joint is set to havok_physics_driven, it will set the joint to havok_game_driven. If the joint is static or game_driven, this command will have no effect.

 

����������� Examples:

 

����������������������� $village_hut�� havok_game_driven������������������� //set all physics-driven bones to game_driven���������

����������������������� $super_planehavok_game_driven joint_wing //if joint_wing is physics-driven, set it to game_driven

 

 

havok_physics_driven

 

����������� Syntax:

 

����������������������� $targetname havok_physics_driven [joint_name]

 

����������� What it does:

 

Sets bones to be physics-driven. Game-driven bones that are set to physics-driven will WAKE UP!

If no joint name is specified it will act on all joints in the asset. If a joint name is specified it will act only

On that joint. �Acting on the joint� means that if the joint is set to havok_game_driven, it will set the joint

to havok_physics_driven. If the joint is static or physics_driven, this command will have no effect.

 

����������� Example:

�����������������������

����������������������� $cratehavok_physics_driven������������������������ //set all game-driven bones to physics-driven, and wake them up

����������������������� $fence havok_physics_driven joint_post01�� //if joint_post01 is game-driven, set it to physics-driven and wake it up

 

 

 

havok_lock_sleeping

 

����������� Syntax:

 

����������������������� $targetname havok_disable_wakeup[joint_name]

 

����������� What it does:

 

Sets bones that have never woken up to not be allowed to wake up.If the asset has already woken

up this command will have no effect. This command is useful for telling an asset to be allowed to be

woken up until a certain event happens. For instance: do not allow the player to destroy the wall of the building

until after the second objective has been completed. This does the same thing as havok_disable_wakeup

 

����������� Example:

 

����������������������� $building havok_lock_sleeping�������������������� //if $building has not yet been woken up, do not allow any bones to wake up

����������������������� $fence����� havok_lock_sleepingjoint_post//if $fence has not yet been woken up, do not allow joint_post to wake up

 

 

havok_force_awake

 

����������� Syntax:

 

����������������������� $targetname havok_force_awake

 

����������� What it does:

 

Tell the bones in the asset to wake up.Any bone that is set to static will not wake up (static

bones will never wake up). Again, this command not only tells the asset�s bones to be able to

be woken up, it actually wakes them up.

 

Example:

 

����������� $hut���� havok_force_awake���� //tell the hut to wake up and fall to the ground

����������� $barrel havok_force_awake���� //wake up the barrel

 

 

 

havok_disable_wakeup

 

����������� Syntax:

 

����������������������� $targetname havok_disable_wakeup[joint_name]

 

����������� What it does:

 

Sets bones that have never woken up to not be allowed to wake up.If the asset has already woken

up this command will have no effect. This command is useful for telling an asset to be allowed to be

woken up until a certain event happens. For instance: do not allow the player to destroy the wall of the building

until after the second objective has been completed.

 

����������� Example:

 

����������������������� $building havok_disable_wakeup��������� �����������//if $building has not yet been woken up, do not allow any bones to wake up

����������������������� $fence����� havok_disable_wakeupjoint_post//if $fence has not yet been woken up, do not allow joint_post to wake up

 

 

 

havok_enable_wakeup

 

����������� Syntax:

 

$targetname havok_enable_wakeup

 

����������� What it does:

 

Sets bones that have been told to sleep via havok_enable_wakeup to be allowed to wake up.If the

asset has not had the havok_disable_wakeup command issued on it,this command will have no effect.

 

����������� Example:

 

$building havok_enable_wakeup�������������������� //if $building has not yet been woken up, do not allow any bones to wake up

����������������������� $fence����� havok_enable_wakeupjoint_post //if $fence has not yet been woken up, do not allow joint_post to wake up

 

 

 

force_explode

 

����������� Syntax:

 

����������������������� $targetname force_explode

 

����������� What it does:

 

Tells asset to swap visible renderable to the renderable (and renderable�s collision) to one called �destroyed�.

A renderable called �destroyed� should exist in the asset. All bones set to game-driven or physics-driven will

wake-up. This command can also be called from within the server section of an animation in a .hag file.

 

����������� Examples:

 

����������������������� $village_hut�� force_explode������ //tell $village_hut to go to destroyed renderable, and wake up

����������������������� $super_planeforce_explode���� ��//tell $super_plane to go to destroyed renderable, and wake up

 

 

altmodel

 

����������� Syntax:

 

����������������������� $targetname altmodel �renderableName�

 

����������� What it does:

 

Sets the named renderable (and that renderable�s collision) to be the current renderable.

The collision is just as much a part of the renderable as a mesh or an LOD, all will be updated with this command.

This command is useful when an asset has more than one renderable and you know the name of the renderable

you want to switch to.

 

����������� Examples:

 

����������������������� $plane altmodel �destroyed����������������������� //set the visible renderable to the renderable called �destroyed������������

����������������������� $pier�� altmodel �really_really_damaged�//set the visible renderable to the renderable called �really_really_damaged�

 

 

altmodel_id

 

����������� Syntax:

 

����������������������� $targetname altmodel_id renderableIndex //base zero

 

����������� What it does:

 

Sets the indexed renderable (and that renderable�s collision) to be the current renderable.

The collision is just as much a part of the renderable as a mesh or an LOD, all will be updated with this command.

This command is useful when an asset has more than one renderable and you know the index of the renderable

you want to switch to.

 

����������� Examples:

 

����������������������� $plane altmodel_id 0//set the visible renderable to the first renderable

����������������������� $pier�� altmodel_id 4//set the visible renderable to the fifth renderable