Targetname

From Valve Developer Community
< Hr
Revision as of 10:05, 11 August 2024 by N0one (talk | contribs)
Jump to navigation Jump to search
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 je osnovna Keyvalue(en) dostupna u svim Source Source igrama. 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 English (en)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:

  • zamjenski znakovi
Source podržava * zamjenske znakove u ograničenoj mjeri. To znači da će traženje area1* odgovarati svim ciljevima koji počinju s area1, poput area1_portal ili area1_door, ali ne area2_door. Ovi zamjenski znakovi također su ograničeni na * na kraju, što znači složenije zamjenske znakove poput *_door ili area*_door neće funkcionirati.
Note.pngBilješka:Mapbase Mapbase ima podršku za složeno podudaranje zamjenskih znakova poput *_door, area*_door, ar*a*_d*r, ? zamjenski znakovi itd.
Note.pngBilješka:Hammer ne prepoznaje većinu ovih oblika podudaranja i vidjet će ih kao pogreške u uređivaču, ali će raditi u igri.

I/O sustav(en) također podržava podudaranje naziva klase, koje se podudara prema nazivu klase entiteta, a ne prema nazivu cilja. Ovo koristi sve iste značajke proširenog podudaranja navedene gore. Neki drugi dijelovi Izvora podržavaju podudaranje naziva klase, ali to obično nije slučaj osim ako nije drugačije navedeno.

Tip.pngSavjet:lako nije izvedivo u nekim situacijama, većina implementacija VScript(en) podržava iteraciju samostalnog entiteta i sadrži alate za usporedbu nizova, regex, itd., dopuštajući gotovo bilo koju vrstu podudaranja imena.

Ključne riječi

Sljedeći posebni nazivi ciljeva mogu se koristiti za dinamički odabir entiteta.

Note.pngBilješka:Ne mogu svi parametri entiteta procijeniti ove nazive ciljeva. Na primjer, SetParent unos može procijeniti !activator parametar, ali igračev unos SetFogController ne može procijeniti !activator/!caller i treba koristiti ciljno ime željenog env_fog_controller-a.
!activator
Entitet koji je započeo trenutni I/O lanac.
  Ako igrač uđe u trigger koji aktivira logic_relay, igrač je !activator izlaza(a) releja.
!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.

Vidi također

Stub

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