Ai relationship: Difference between revisions
JurgenKnops (talk | contribs) m (Spam revert.) |
m (minoro) |
||
Line 1: | Line 1: | ||
{{wrongtitle|title=ai_relationship}} | {{wrongtitle|title=ai_relationship}} | ||
==Entity | == Entity description == | ||
[[Image:{{PAGENAME}}.png|right]] | [[Image:{{PAGENAME}}.png|right]] | ||
Sets a relationship type between two parties. These parties can be an [[NPC]], an NPC class, or the player(s). | Sets a relationship type between two parties. These parties can be an [[NPC]], an NPC class, or the player(s). | ||
There are four types of relation: Neutral, hate, like and fear. Certain NPC classes will react differently when in these states. | There are four types of relation: Neutral, hate, like and fear. Certain NPC classes will react differently when in these states. | ||
{{todo|Do some more behavioral research on NPC(s) and post your observations below. Possibly these results could later on be placed in the corresponding article of each NPC instead.}} | {{todo|Do some more behavioral research on NPC(s) and post your observations below. Possibly these results could later on be placed in the corresponding article of each NPC instead.}} | ||
=== Neutral === | |||
Will not attack. Rebels avoid | Will not attack. Rebels avoid player apologetically, and cannot be commanded. [[Npc_zombie|Zombies]] will remain still and only turn to face the target. | ||
[[Npc_zombie]] | |||
=== Hate === | |||
Considers the target an enemy/enemies and will attack. | Considers the target an enemy/enemies and will attack. | ||
=== Like === | |||
Will not attack the target. Rebels follow automatically, and can be commanded. The player will lower his gun until the target shows signs of hostility (but can still shoot the target before this). | Will not attack the target. Rebels follow automatically, and can be commanded. The player will lower his gun until the target shows signs of hostility (but can still shoot the target before this). Zombies will remain still and only turn to face the target. | ||
=== Fear === | |||
Avoids the target. | Avoids the target. [[Npc_headcrab|Headcrabs]] run away without attacking. [[Npc_metropolice|Metropolice]] attacks. Rebels avoid without attacking, and cannot be commanded. Zombies will occasionally also swipe at the target as if it is in their flight path, but these swipes will afflict no damage to player, unless the zombie has been attacked. | ||
Headcrabs | |||
{{ | {{note|The relationship can refer to the player as <code>!player</code> (single-player) or any client as <code>player</code> (single-player or multiplayer).}} | ||
== Keyvalues == | |||
==Keyvalues== | |||
* {{kv targetname}} | * {{kv targetname}} | ||
* '''subject''' | * '''subject''' | ||
Line 55: | Line 50: | ||
: {{boolean}} Set this to have the new relationship mirrored by target | : {{boolean}} Set this to have the new relationship mirrored by target | ||
==Flags== | == Flags == | ||
* {{ep1 add|1 : Notify subject of target's location}} | * {{ep1 add|1 : Notify subject of target's location}} | ||
* {{ep1 add|2 : Notify target of subject's location}} | * {{ep1 add|2 : Notify target of subject's location}} | ||
==Inputs== | == Inputs == | ||
* {{i targetname}} | * {{i targetname}} | ||
Line 73: | Line 66: | ||
: Revert relationship changes to the default relationship, which may have changed since this ai_relationship was applied. This returns control of the entity relationship to the code. | : Revert relationship changes to the default relationship, which may have changed since this ai_relationship was applied. This returns control of the entity relationship to the code. | ||
==Outputs== | == Outputs == | ||
* {{o targetname}} | * {{o targetname}} | ||
==See also== | == See also == | ||
* [[List of default AI relationships]] | * [[List of default AI relationships]] | ||
[[Category:AI]] [[Category:Entities]] | [[Category:AI]] | ||
[[Category:Entities]] |
Revision as of 03:32, 26 November 2007
Entity description
Sets a relationship type between two parties. These parties can be an NPC, an NPC class, or the player(s). There are four types of relation: Neutral, hate, like and fear. Certain NPC classes will react differently when in these states.
Neutral
Will not attack. Rebels avoid player apologetically, and cannot be commanded. Zombies will remain still and only turn to face the target.
Hate
Considers the target an enemy/enemies and will attack.
Like
Will not attack the target. Rebels follow automatically, and can be commanded. The player will lower his gun until the target shows signs of hostility (but can still shoot the target before this). Zombies will remain still and only turn to face the target.
Fear
Avoids the target. Headcrabs run away without attacking. Metropolice attacks. Rebels avoid without attacking, and cannot be commanded. Zombies will occasionally also swipe at the target as if it is in their flight path, but these swipes will afflict no damage to player, unless the zombie has been attacked.

!player
(single-player) or any client as player
(single-player or multiplayer).Keyvalues
- Template:Kv targetname
- subject
- <target_name_or_class> This is the NPC(s) whose disposition will change.
- target
- <target_name_or_class> This is the NPC(s) ( or
!player
orplayer
) about whom the Subject(s) will change their disposition.
- disposition
- <choices> Choose the way the Subject(s) should feel about the target(s)
Literal Value Description 1 Hate 2 Fear 3 Like 4 Neutral
- radius
- <float> Radius for subject
- rank
- <integer> How much the Subject(s) should Like/Hate/Fear the target(s). Higher priority = stronger feeling.
- StartActive
- <boolean>
- Reciprocal
- <boolean> Set this to have the new relationship mirrored by target
Flags
Inputs
- ApplyRelationship
- Apply relationship changes
- RevertRelationship
- Revert relationship changes
- Revert relationship changes to the default relationship, which may have changed since this ai_relationship was applied. This returns control of the entity relationship to the code.