Dynamic interactions: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Ugh. I spent all that time... and I forgot to add it to the QC Keyvalues category...)
(Added more information. Removed WIP banner. Anyone is welcome to add or confirm things.)
Line 1: Line 1:
{{wip|[[User:Gjsdeath|Gary]]}}
{{Screenshot}}


The '''dynamic_interactions''' [[KeyValues]] block defines when and how to perform a dynamic interaction. For example; when [[Alyx]] kicks a zombie. It is embedded in a model with the [[$keyvalues]] QC command.
The '''dynamic_interactions''' [[KeyValues]] block defines when and how to perform a dynamic interaction. For example; when [[Alyx]] kicks a zombie. It is embedded in a model with the [[$keyvalues]] QC command.  


{{Warning | This page is not done yet, all the information on it has not been confirmed!! I will be working on it for the next one or two days. If you want to confirm or add something, please add it to the discussion page for now. All the "confirms" are there because I just assumed a lot of those descriptions. My assumptions were based on the names and the code that they use.}}
Once a dynamic interaction is defined in a model, the character(s) with this model can have the interaction with any other character that has the same [[sequence]] names or [[activity]] names. This only has to be defined in one of the two characters([[NPC]]s)'s model participating in the interaction. For example; Alyx has the dynamic interactions defined in her model using this keyvalue, but the zombie model just has matching activity names.
 
{{Warning | Most of the "confirms" are there because I just assumed a lot of those descriptions. My assumptions were based on the names, Valve use in models, and the code that they use.}}




== Example ==
== Example ==


Found in <code>models/Alyx_animations.mdl</code>
{{Note | This is only one of the interactions and it has been restructured for easier reading! }}
<pre>
<pre>
  $keyvalues  
  $keyvalues  
Line 29: Line 33:
  }
  }
</pre>
</pre>


==Options==
==Options==
Line 34: Line 39:


;<code>trigger <choices></code>
;<code>trigger <choices></code>
: ''What triggers this interaction...''
: ''What triggers this interaction... If this isn't defined, the interaction can be trigged via input <code>forceinteractionwithnpc "<[[targetname]]> <interaction name>"</code>''
:; <code>auto_in_combat</code>
:; <code>auto_in_combat</code>
:: Automatically in combat.  
:: Automatically in combat.  


;<code>loop_break_trigger <choices></code>
;<code>loop_break_trigger <choices></code>
: ''Stop looping the action animation if <code>loop_in_action</code> was set.{{TODO | Find out what exactly this does...}}''
: ''Stop looping the action animation if <code>loop_in_action</code> was set.'' {{confirm}}
:; <code>on_damage</code>
:; <code>on_damage</code>
:: Break loop on damage. {{TODO | Confirm. }}
:: Break loop on damage.
:; <code>on_flashlight_illum</code>
:; <code>on_flashlight_illum</code>
:: Break loop once illuminated by player's flashlight. {{TODO | Confirm. }}  
:: Break loop once illuminated by player's flashlight. {{confirm}}


;<code>origin_relative <[[vector]]></code>
;<code>origin_relative <[[vector]]></code>
Line 52: Line 57:


;<code>entry_sequence <[[sequence]]></code>
;<code>entry_sequence <[[sequence]]></code>
: ''What sequence to play for this interaction before the main sequence/activity.'' {{TODO | Confirm. }}  
: ''What sequence to play for this interaction before the main sequence/activity.'' {{confirm}}


;<code>entry_activity <[[activity]]></code>
;<code>entry_activity <[[activity]]></code>
: ''What activity to play for this interaction before the main sequence/activity.'' {{TODO | Confirm. }}  
: ''What activity to play for this interaction before the main sequence/activity.'' {{confirm}}  


;<code>sequence <[[sequence]]></code>
;<code>sequence <[[sequence]]></code>
Line 64: Line 69:


;<code>exit_sequence <[[sequence]]></code>
;<code>exit_sequence <[[sequence]]></code>
: ''What sequence to play for this interaction after the main sequence/activity.'' {{TODO | Confirm. }}  
: ''What sequence to play for this interaction after the main sequence/activity.'' {{confirm}}


;<code>exit_activity <[[activity]]></code>
;<code>exit_activity <[[activity]]></code>
: ''What activity to play for this interaction after the main sequence/activity.'' {{TODO | Confirm. }}  
: ''What activity to play for this interaction after the main sequence/activity.'' {{confirm}}


;<code>delay <[[float]]></code>
;<code>delay <[[float]]></code>
: ''The delay... before starting the interaction? {{TODO | Confirm. }}
: ''The delay... before starting the interaction? {{confirm}}


;<code>origin_max_delta <[[float]]></code>
;<code>origin_max_delta <[[float]]></code>
: ''Something to do with delta animation... {{TODO | Confirm. }}
: ''Something to do with delta animation... {{confirm}}


;<code>loop_in_action <[[float]]></code> {{Note | While the value is a float, it's used as a bool in code. }}
;<code>loop_in_action <[[float]]></code> {{Note | While the value is a float, it's used as a bool in code. }}
: ''Loop in the "action" animation(the "activity" or "sequence" options.). {{TODO | Confirm. }}
: ''Loop in the "action" animation(the "activity" or "sequence" options.). {{confirm}}


;<code>dont_teleport_at_end <choices></code>
;<code>dont_teleport_at_end <choices></code>
: ''Don't teleport/fix up positions at the end {{TODO | Find out what exactly this does...}}''
: ''Don't teleport/fix up positions at the end ''
:; <code>me</code>
:; <code>me</code>
:: Don't teleport/fix up this character's position{{TODO | Confirm. }}
:: Don't teleport/fix up this character's position
:; <code>them</code>
:; <code>them</code>
:: Don't teleport/fix up this character's partner's position {{TODO | Confirm. }}
:: Don't teleport/fix up this character's partner's position
:; <code>both</code>
:; <code>both</code>
:: Don't teleport/fix up this character's or his partner's position {{TODO | Confirm. }}
:: Don't teleport/fix up this character's or his partner's position  


;<code>needs_weapon <choices></code>
;<code>needs_weapon <choices></code>
: ''Needs a weapon to perform this interaction?''
: ''Needs a weapon to perform this interaction?''
:; <code>ME</code>
:; <code>ME</code>
:: Does this character need a weapon? {{TODO | Confirm. }}
:: Does this character need a weapon?  
:; <code>THEM</code>
:; <code>THEM</code>
:: Does this character's partner need a weapon? {{TODO | Confirm. }}
:: Does this character's partner need a weapon?  
:; <code>BOTH</code>
:; <code>BOTH</code>
:: Does both this character and his partner need a weapon? {{TODO | Confirm. }}
:: Does both this character and his partner need a weapon?  


;<code>weapon_mine <[[classname]]></code>
;<code>weapon_mine <[[classname]]></code>
: ''This character needs this specific weapon to perform this interaction? {{TODO | Confirm. }}
: ''This character needs this specific weapon to perform this interaction?  


;<code>weapon_theirs <[[classname]]></code>
;<code>weapon_theirs <[[classname]]></code>
: ''This character needs this specific weapon to perform this interaction? {{TODO | Confirm. }}
: ''This character needs this specific weapon to perform this interaction?  


== Related or Useful Animation Events ==
== Related or Useful Animation Events ==
Line 116: Line 121:
: ''Hurt either this character or his partner... and how much(the int).''
: ''Hurt either this character or his partner... and how much(the int).''
:; <code>ME</code>
:; <code>ME</code>
:: Hurt this character {{TODO | Confirm: Works? }}
:: Hurt this character
:; <code>THEM</code>
:; <code>THEM</code>
:: Hurt the partner
:: Hurt the partner
Line 130: Line 135:


* [[$keyvalues]]
* [[$keyvalues]]
 
* [[Animation Events]]
* [[sequence]]
* [[activity]]
* [[qc]]


[[Category:QC Keyvalues]]
[[Category:QC Keyvalues]]

Revision as of 14:52, 26 February 2012

Nuvola apps ksnapshot.png
This article or section needs a screenshot to help visually convey the subject.
You can upload screenshots at Special:Upload. For help, see Help:Images.

The dynamic_interactions KeyValues block defines when and how to perform a dynamic interaction. For example; when Alyx kicks a zombie. It is embedded in a model with the $keyvalues QC command.

Once a dynamic interaction is defined in a model, the character(s) with this model can have the interaction with any other character that has the same sequence names or activity names. This only has to be defined in one of the two characters(NPCs)'s model participating in the interaction. For example; Alyx has the dynamic interactions defined in her model using this keyvalue, but the zombie model just has matching activity names.

Warning.pngWarning: Most of the "confirms" are there because I just assumed a lot of those descriptions. My assumptions were based on the names, Valve use in models, and the code that they use.


Example

Found in models/Alyx_animations.mdl

Note.pngNote: This is only one of the interactions and it has been restructured for easier reading!
 $keyvalues 
 { 
 
	dynamic_interactions 
	{

		"alyx_v_zombie_180deg_64" 
		{ 
		"trigger" "auto_in_combat" 
		"origin_relative" "64 0 0" 
		"angles_relative" "0 180 0" 
		"activity" "ACT_DI_ALYX_ZOMBIE_MELEE"
		"delay" "10.0" 
		"needs_weapon" "ME" 
		"weapon_mine" "weapon_alyxgun" 
		}   
 
	}
 }


Options

Note.pngNote: The "partner" is the character that this character is interacting with.
trigger <choices>
What triggers this interaction... If this isn't defined, the interaction can be trigged via input forceinteractionwithnpc "<targetname> <interaction name>"
auto_in_combat
Automatically in combat.
loop_break_trigger <choices>
Stop looping the action animation if loop_in_action was set. [confirm]
on_damage
Break loop on damage.
on_flashlight_illum
Break loop once illuminated by player's flashlight. [confirm]
origin_relative <vector>
angles_relative <angles>
velocity_relative <vector>
entry_sequence <sequence>
What sequence to play for this interaction before the main sequence/activity. [confirm]
entry_activity <activity>
What activity to play for this interaction before the main sequence/activity. [confirm]
sequence <sequence>
What sequence to play for this interaction.(The "action")
activity <activity>
What activity to play for this interaction.(The "action")
exit_sequence <sequence>
What sequence to play for this interaction after the main sequence/activity. [confirm]
exit_activity <activity>
What activity to play for this interaction after the main sequence/activity. [confirm]
delay <float>
The delay... before starting the interaction? [confirm]
origin_max_delta <float>
Something to do with delta animation... [confirm]
loop_in_action <float>
Note.pngNote: While the value is a float, it's used as a bool in code.
Loop in the "action" animation(the "activity" or "sequence" options.). [confirm]
dont_teleport_at_end <choices>
Don't teleport/fix up positions at the end
me
Don't teleport/fix up this character's position
them
Don't teleport/fix up this character's partner's position
both
Don't teleport/fix up this character's or his partner's position
needs_weapon <choices>
Needs a weapon to perform this interaction?
ME
Does this character need a weapon?
THEM
Does this character's partner need a weapon?
BOTH
Does both this character and his partner need a weapon?
weapon_mine <classname>
This character needs this specific weapon to perform this interaction?
weapon_theirs <classname>
This character needs this specific weapon to perform this interaction?

Related or Useful Animation Events

These are useful animation events for those wanted to create an activity for a dynamic interaction. READ: Animation_Events

Todo:  Move to dedicated page or animation event page?


Example

{ event AE_NPC_HURT_INTERACTION_PARTNER 28 "THEM 100" }


Animation Events

AE_NPC_HURT_INTERACTION_PARTNER "<choices> <int>"
Hurt either this character or his partner... and how much(the int).
ME
Hurt this character
THEM
Hurt the partner
AE_NPC_SET_INTERACTION_CANTDIE "<bool>"
Set those participating in the interaction to become invincible
Todo:  Which NPC? The partner or this character
AE_NPC_WEAPON_FIRE "<bool>"
Fire this character's weapon. The bool is whether or not you want him to use the weapon's secondary fire.


See Also