info_remarkable

From Valve Developer Community
Jump to: navigation, search

<Left 4 Dead><Left 4 Dead 2> info_remarkable is a point entity available in the Left 4 Dead series. An object in the world such that characters seeing it will speak a TLK_REMARK concept. Info_remarkable in L4D2 official maps can be found in the commentary text file located in the maps directory within pak01_dir.vpk. Left 4 Dead commentary files can be found in the maps folder of the Left 4 Dead installation for Left 4 Dead (No VPK extraction necessary). This entity can be placed with the Commentary Editor

Keyvalues

Subject context <string>
Text to put in the SUBJECT context of the TLK_REMARK fired upon sighting this object.

Origin:

Origin (X Y Z) <origin>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.

Targetname:

Name <string>
The targetname that other entities refer to this entity by.
Entity Scripts <scriptlist> (New with Left 4 Dead 2)
Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.
Script think function <string> (New with Left 4 Dead 2)
Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call.
Note:Try to avoid expensive operations in this function, as it may cause performance problems.

Inputs

Targetname:

Kill
Removes this entity and any entities parented to it from the world.
KillHierarchy
Functions the same as Kill, although this entity and any entities parented to it are killed on the same frame, being marginally faster than Kill.
AddOutput  <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
Use  !FGD
Same as a player invoking +use; may not do anything. Can also be invoked by creating an output that does not specify an input.
This input is not included in Valve's FGDs.
RunScriptFile  <script> (New with Left 4 Dead 2)
Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode  <string> (New with Left 4 Dead 2)
Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console.
Bug: In <Left 4 Dead 2>, the code is executed in the script scope of the entity that fires the output, not the one receiving the input.
Warning: Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.
CallScriptFunction  <string> (New with Left 4 Dead 2) !FGD
Execute a VScript function in the scope of the receiving entity.
SetLocalOrigin  <coordinates> (New with Alien Swarm) !FGD
Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.
SetLocalAngles  <angles> (New with Alien Swarm) !FGD
Set this entity's angles.

Outputs

Targetname:

OnUser1 to OnUser4
These Outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.
OnKilled  (Only in the Left 4 Dead series)
This Output fires when the entity is killed and removed from the game.

Tutorial/How to - Step by Step

So here is a mock scenario:

You have a rooftop on your campaign. You want the survivors to comment on the rooftop as we would hear in Valve's campaigns. Here's how we do it.

  • Step 1

(If you know how to access the /talker scripts with GCFScape, skip to step 2.) First -- There are files that let you know what the survivors can say and what the 'Subject Context' is in these files:

For Left 4 Dead - common\left 4 dead\left4dead\scripts\talker For Left 4 Dead 2 - You'd have to look around in the files with GCFScape from the VPK dir at: common\left 4 dead 2\left4dead2\pak01_dir.vpk

Once inside the folder structure, navigate to: \scripts\talker

The files for both L4D and L4D2 are associated with the survivor's name. So for instance in L4D2, Ellis's available remarks are in mechanic.txt. Rochelle's are in producer.txt etc.

Be aware that The Passing talker scripts are in the own VPK structure located in: common\left 4 dead 2\left4dead2_dlc1\pak01_dir.vpk and additional DLC scripts are located in their respective folders as they become available.


  • Step 2

Ok. Now that we know where the text files are, lets check out one of the responses.

Response PlayerRemarkc2m4_upbarnaMechanic
{
	scene "scenes/Mechanic/WorldC4M4B04.vcd"  //We can climb across the roofs!
}
Rule PlayerRemarkc2m4_upbarnaMechanic
{
	criteria ConceptRemark IsMechanic Isc2m4_upbarna IsNotSaidc2m4_upbarna IsNotCoughing NotInCombat IsTalk IsTalkMechanic IsWorldTalkMechanic IsSubjectNear300 AutoIsNotScavenge AutoIsNotSurvival IsNotSrcGrp_C2M4_003 IsNotSpeakingWeight0
	ApplyContext "Saidc2m4_upbarna:1:0,SrcGrp_C2M4_003:1:0"
	applycontexttoworld
	Response PlayerRemarkc2m4_upbarnaMechanic
}


This is the talker script for Dark Carnival map 4, where you cross the barn rooftops just before the panic event at the stadium entrance.

First you have the VCD scene file it refers to: scenes/Mechanic/WorldC4M4B04.vcd and what is actually spoken. Next, is the Rule and the criteria that need to be met for it to be "spoken". There are a bunch of "Is" and "IsNot" criteria shown there. I.E.:


IsMechanic = Is Ellis
Isc2m4_upbarna = I assume this is variable set then referred to for the criterion's sake
IsNotSaidc2m4_upbarna = Hasn't, or is not currently saying this.
The rest are fairly self explanatory.


One that is important is 'IsSubjectNear300'. This is the radius that the player must be within the info_remarkable for it to fire. At the end of this writeup, I made a change to the FGD for both games that will show a mock radius(similar to ambient_generic's radius for sound distance) so you can place it right where you want it to be.

Many remarks are able to be used by different survivors, so even if you find it in say, mechanic.txt, another survivor may comment on it also.

--SOME TALKER REMARKS HAVE THE CRITERIA 'ISMAP', THESE WILL NOT WORK BECAUSE THEY LOOK FOR A SPECIFIC MAP NAME -- SO KEEP AN EYE OUT FOR THEM--

Back to it now. To use this particular remark in our info_remarkable we would take c2m4_upbarna from the text and put it in our 'Subject Context' field of our info_remarkable. You can always tell what the remarks are by the rule.

Rule PlayerRemarkc2m4_upbarnaMechanic

Forget about Rule PlayerRemark and forget about the survivor name at the end. It will be the text between them. So in this case, c2m4_upbarna. Don't forget to remove the survivor name at the end.

So now we have this in Hammer
Info remarkable hammer.jpg


Be aware that the most important criteria, although not listed with the others, is the player having line of sight with the info_remarkable. This needs to be met first, before radius and the other criteria.

We are basically done. When a survivor gets within 300 units of this info_remarkable, they will say, "We can climb across the roofs!". It is nice that Valve has the actual text spoken in the .txt files so you can Ctrl-F with whatever program you use and search for specific sayings.

FGD Additions

(This works for L4D and L4D2 Hammer versions)

To help with placement of the info_remarkables and associated radii that will come with whatever Remark you are using (I.E. IsSubjectNear300 etc.), I added a change to the leftdead(2).fgd that allows you to see the radius for placement.

If you open up your left4dead(2).fgd (use notepad or equivalent) at \common\left 4 dead (2)\bin and do a search for info_remarkable and replace:


@PointClass base(Origin,Targetname) = info_remarkable : "An object in the world such that characters seeing it will speak a TLK_REMARK concept"
[
	contextsubject(string) : "Subject context" : "" : "Text to put in the SUBJECT context of the TLK_REMARK fired upon sighting this object." 
]

With

@PointClass base(Origin,Targetname) sphere() = info_remarkable : "An object in the world such that characters seeing it will speak a TLK_REMARK concept"
[
	contextsubject(string) : "Subject context" : "" : "Text to put in the SUBJECT context of the TLK_REMARK fired upon sighting this object."
	radius(string) : "Mock Radius for Origin Placement" : "500" : "Allows you to set a mock radius to determine origin placement on info_remarkables based off their associated Remark radius"
]

You can set a radius that will help with placement. Just set the Mock Radius to the number specified in IsSubjectNear*number here*.


See also