Hr/Targetname: Difference between revisions

From Valve Developer Community
< Hr
Jump to navigation Jump to search
(Croatian page, not fully translated)
 
m (Nescius moved page KV Targetname/Targetname to Hr/Targetname without leaving a redirect: I assume this was intended)
(No difference)

Revision as of 09:52, 11 August 2024

English (en)Hrvatski (hr)中文 (zh)Translate (Translate)
Info content.png
This page needs to be translated.
This page either contains information that is only partially or incorrectly translated, or there isn't a translation yet.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article complies with the alternate languages guide.(en)

Targetname is a base Keyvalue available in all Source Source games. Targetname (prevedeno: ime cilja) (također poznato jednostavno kao Name) je ime entiteta. Ciljno ime nije potrebno za postojanje entiteta, ali općenito mora biti prisutno da bi entitet igrao ulogu u I/O sustav(en).

Bilješke

  • Entiteti također mogu biti meta njihovih classname(en) (npr. prop_dynamic).
  • Imena ciljeva ne moraju biti jedinstvena, mogu se dijeliti (a unosi će se slati svakom). Duplicirani nazivi ciljeva prikazani su podebljanim fontom.
  • Nazivi ciljeva ne mogu sadržavati ! ili * znakova (vidi dolje).
  • Nazivi ciljeva također ne mogu sadržavati , znakova ako namjeravate koristiti entitet kao nadređenog, jer se to koristi za postavljanje točke privitka(en).

Instance

  • Instance(en) može koristiti popravke imena prefiksa ili postfiksa i automatski će generirati prefiks ako nisu navedeni parametri.
  • Prefiksi i postfiksi odvojeni su jednom crticom, npr. hall_a3-door_02.
  • Postavljanje @ simbol na početku naziva cilja (e.g. @exit_door) će zaobići popravak imenovanja za taj određeni entitet. Ako @exit_door i exit_door_relay bili dio instance s prefiksom Door_01, nazivi entiteta bili bi @exit_door i Door_01-exit_door_relay.

Događaji Igrača

U većini igara za više igrača, bilo kojem entitetu sa sljedećim imenima ciljeva bit će poslan unos Use(en) kada se taj događaj dogodi.

  • game_playerdie - Pali svaki put kad player umre. Igrač koji je umro je !activator.
  • game_playerkill - Pali svaki put kad player ubije drugog igrača, ubojica je !activator.
  • game_playerjoin - Pali svaki put kad player pridruži igri, igrač koji se pridruži je !activator.
    Icon-Bug.pngGreška:game_playerjoin nije otpušten od botove(en).  [to-do: testirano u ?]
  • game_playerspawn - Pali svaki put kad Pojavljuje se player, s igračem koji se pojavljuje kao !activator.
    Icon-Bug.pngGreška:game_playerspawn ne funkcionira u Counter-Strike: SourceCounter-Strike: Global OffensiveTeam Fortress 2.  [to-do: testirano u ?]
  • game_playerleave - Pali se svaki put kad player napusti igru. !activator neće raditi u ovom slučaju, jer entitet player više ne postoji.
Potvrdi:U kojim igrama game_playerjoin i game_playerspawn zapravo rade?
Tip.pngSavjet:U Team Fortress 2Left 4 Dead 2, koristite VScript zakačke događaja koji također nude dodatne informacije uz svaki događaj (kao što je napadač o smrti itd.). Ekvivalentni nazivi događaja su player_spawn, player_death i player_disconnect.

Podudaranje imena

Dok traži entitet, Source može koristiti nekoliko proširenih značajki podudaranja koje su korisne u raznim situacijama. Koriste se za ciljanje entiteta s nepoznatim ili djelomično poznatim imenom, a najčešće se koriste u I/O lancima, ali se također mogu koristiti u ključnim vrijednostima koje ciljaju entitete, poput filtra KV u filter_activator_name/klasa](en) ili nadređeno(en) polje entiteta. Proširene značajke su:

  • Wildcards
Source supports * wildcards to a limited extent. This means searching for area1* will match any targetnames that start with area1, like area1_portal or area1_door, but not area2_door. These wildcards are also limited to trailing *, which means more complex wildcards like *_door or area*_door will not function.
Note.pngBilješka:Mapbase Mapbase has support for complex wildcard matching like *_door, area*_door, ar*a*_d*r, ? wildcards, etc.
Note.pngBilješka:Hammer does not recognize most of these forms of matching and will see them as errors in the editor, but they will work in-game.

The I/O System also supports classname matching, which matches by an entity's classname rather than its targetname. This uses all of the same extended matching features listed above. Some other parts of Source support classname matching, but this usually isn't the case unless stated otherwise.

Tip.pngSavjet:Although not feasible for some situations, most implementations of VScript support standalone entity iteration and contain string comparison tools, regex, etc., allowing for virtually any type of name matching.

Keywords

The following special targetnames can be used to dynamically select an entity.

Note.pngBilješka:Not all entity parameters can evaluate these targetnames. For example SetParent input can evaluate !activator parameter but player's SetFogController input is not able to evaluate !activator/!caller and needs to use the desired env_fog_controller's targetname.
!activator
The entity that began the current I/O chain.
  If a player walks into a trigger that fires a logic_relay, the player is the !activator of the relay's output(s).
!self
The entity from which the current input originates.
  If a player walks into a trigger that fires a logic_relay, the relay is the !self of its output(s).
Special case: 
  • If a logic_relay fires ForceSpawnAtEntityOrigin !self to an env_entity_maker with OnTrigger, the !self entity is the env_entity_maker itself.
!caller
The entity from which the current output originates.
If a player walks into a trigger that fires a logic_relay, the trigger is the !caller of the relay's output(s).
Special case: 
  • If a logic_relay fires ForceSpawnAtEntityOrigin !caller to an env_entity_maker with OnTrigger, the !caller entity is the relay itself.
  • For entities such as filter_activator_[xxxx] or logic_case, the !caller of a TestActivator or PickRandom/PickRandomShuffle is the filter_activator_[xxxx]/logic_case itself, not the entity that fired the input.
Note.pngBilješka:Individual inputs can override the entity targeted by !caller! This is done by point_entity_finder, math_counter, logic_case, and filter entities.
!player
Targets the player.
  In multiplayer games, it targets the first player that joined the server.
Note.pngBilješka:When testing an entity's name, this behaves as expected, matching if the entity is a player.
Tip.pngSavjet:To target all players in a server, use the player classname.
Icon-Bug.pngGreška:In Portal 2, entities parented using the parentname parameter fail to parent on map startup.  [to-do: testirano u ?]
PlacementTip.pngRaditi okolo:Use a logic auto and a SetParent input instead.
!player_blue(samo u Portal 2)
In Portal 2 Coop, this targets ATLAS (player 1).
!player_orange(samo u Portal 2)
In Portal 2 Coop, this targets P-Body (player 2).
!pvsplayer
The first player found in the entity's Potential Visibility Set. The PVS used is taken from the entity doing the searching, or the activator if no searching entity exists. If no activator exists either, the first player in the game is returned (i.e. !player).
!picker
The first entity under the player's crosshair; mostly only for debugging. Entities without collision can only be selected by aiming at their origin.
  In multiplayer games, it uses the first player that joined the server.

FindNamedEntity Keywords

These keywords are only available in FindNamedEntity, a method specific to NPCs which is only searched by specific systems (e.g. choreographed scenes) and not by things like the I/O System.

Napraviti: Mapbase Mapbase makes this available to I/O searches. Is this the case in any other branch?
!speechtarget
The entity at which the !caller is looking due to a Look At Actor or Face Actor choreography event.
!friend
The !caller's nearest friendly NPC. This returns the player on NPCs which don't descend from CAI_PlayerAlly.
!enemy
The current enemy of the !caller.

Keyword Notes

  • Both !activator and !caller can be different for specific inputs, which depends on each input's implementation. In most cases this is in an undesired manner, like GetValue for math_counter.
  • When an output's "Target Entity" is empty, !self is not set to the !caller value.
  • Targetnames used in an output's parameter override field are evaluated by the entity that receives the output, not the one that sends it.

See also


Stub

This article or section is a stub. You can help by expanding it.