Logic director query

From Valve Developer Community
Revision as of 04:37, 13 January 2010 by TomEdwards (talk | contribs) (cleaned)
Jump to navigation Jump to search

Template:L4d2 point It is used to reference the AI Director's 'anger' value, and create different outputs so that the map can be adjusted accordingly. The director is angered by players performing well.

You can have any number of logic_director_query entities in the same map, each with their own range and noise settings.

Example uses

The logic_director_query can be used both as a dynamic reference to the AI Director's anger and as semi-random number generator.

To use the entity to reference the AI director's anger level: Set up the events you want to use the entity to trigger, create the logic_director_query and whatever method you want to use to trigger it. Name the logic_director_query something you'll remember (directorAnger01 or whatever), then set its Min/Max Anger Range to 1 (or the lowest value you want it to output) and X (being the highest value you want the entity to output).

Select your triggering entity/brush and create an output pointing to the logic_director_query using HowAngry (such as OnTrigger – directorAnger01 – HowAngry).

Create a logic_case entity and name it something relevant or something you'll remember (ex. barricadePicker). Set the cases to do whatever it is you want them to do, keeping in mind that any case over CaseX (X being Max Anger Range) won't be called. Now go to your logic_director_query and create an output pointing at the logic_case entity that reads OutAnger – (logic_case) – InValue. This will send the value of the director's anger to the logic_case entity to execute the corresponding case number.

Playing around with the Noise setting will allow the output to less predictable, and combining this with multiple case statements will allow for a large amount of dynamic events.

KeyValues

Min Anger Range <int>
Max Anger Range <int>
The range of integers used to represent the director's anger. The value will be mapped within it. Choosing a wider range of numbers allows finer "anger management".
Noise <choices>
Randomises the entity's output slightly. “No noise” will cause the output being the exact remapped value of the director's anger, while “complete noise” will result in a random number within the anger range. There are various other levels in between.
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Inputs

HowAngry
Asks the director: “On a scale of <Min Anger Range> to <Max Anger Range>, how angry are you?”


Outputs

OutAnger <int>
Fired in response to HowAngry. Sends the current remapped value of the director's anger to an entity of your choice (logic_case is generally the most useful).
On20SecondsToMob
Confirm:Fires 20 seconds before the director's anger causes it to spawn a mob of common infected.