This article's documentation is for anything that uses the Source engine. Click here for more information.

Point template: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (ortadarv)
 
(58 intermediate revisions by 33 users not shown)
Line 1: Line 1:
[http://bilharmania.com/cutenews/data/archives/images/index.html webmap] [http://sweetheartloghomes.com/gallery/cache/live-test/mcmahan/pics/fuquaco.html crosley] [http://equiraf.com/fotos/newsletter_old/small/henbob.html free audio books] [http://barbocol.pt/barbocol/images/stories/catalogo/pixel/ousito.html american idol and text messaging] [http://fredericks-photo.com/12all/admin/tmp_imp/cache/mexolori.html girls nicknames] [http://aeesep.com/forum/forum/images/avatars/pics/delacelt.html vty] [http://a2zgiftoutlets.com/store/var/skins_repository/base/customer/addons/gift_registry/event/lanrpa.html alman konsolosluk] [http://pedrotochas.com/guesting/gfx/flags/pics/lorealq.html warehouse recruitment] [http://sports-articles.com/components/com_magazine/magazine/sedbasfi.html regal beagle] [http://cantinhodasaromaticas.pt/ficheiros_loja/images/icons_old/enfevertr.html mother and daughter] [http://phocas.net/todd/wp-content/uploads/2008/02/caouro.html anagram finder] [http://elisabetejacinto.com/files/upload/thumbs/kofixo.html volvo part] [http://sacborg.com/renoswapmeet/forms/use/sampleform/files/any/sitemap.html domain] [http://a2zgiftoutlets.com/store/var/skins_repository/base/customer/addons/gift_registry/event/ricwenn.html life stories] [http://sports-articles.com/components/com_magazine/magazine/rosedt.html raytech] [http://gotasdorvalho.com/forum/store/language/pt/files/fevfevbo.html dionex] [http://myfamily-magazine.com/wp-content/uploads/2007/09/lic4tqash.html free download of msn 6] [http://interbeiras-turismo.pt/site/downloads/docs/fuwoloqa.html miracle truss] [http://sweetheartloghomes.com/gallery/cache/live-test/mcmahan/pics/index.html index] [http://www.bingaswingas.com/wp-content/uploads/2007/11/acelalro.html toma 5] [http://www.acib.es/go/tmp/cache/g/xdront.html profit masters] [http://bntu.net/forum2/style_images/ip.boardpr/folder_team_icons/thumbs/sitemap.html sitemap] [http://emeraldwinter.com/news/skins/.jsk/int/letokosa.html heart palpatations] [http://www.chuzanet.com/sb/as/4/9/1/cabrcaac.html roman shade patterns free] [http://bntu.net/forum2/style_images/ip.boardpr/folder_team_icons/thumbs/cnapasr.html vintage fabrics] [http://airfareglobal.com/_trcache/tmp/racwborel.html new strides day camp] [http://corner-news.com/wp-content/uploads/2007/06/ricacreva.html favorites] [http://fmaruba.com/pics/albums/userpics/10001/enelto.html downloadable games] [http://tm-warez.net/engine/cache/system/images/zrolroldr.html elen cole] [http://hryhorczuk.com/transmissions/attachments/files/golbase.html cedars-sinai] [http://www.bingaswingas.com/wp-content/uploads/2007/11/bugmexde.html mustang floormats] [http://equiraf.com/fotos/newsletter_old/small/getbocf.html aboriginal food] [http://newdaynews.com/gallery/albums/userpics/10009/bodomel.html informed comments] [http://blogoltre.com/wp-content/plugins/alinks/logs/log_tmp/pascael.html aricept 5mg] [http://hryhorczuk.com/transmissions/attachments/files/quabocac.html m 89 cinema plainwell mi] [http://palmbeachrsl.com.au/documents/txt/golnel.html qmfm radio station] [http://ideiabiba.pt/destaques/pics/cadarq.html wedding announcement magnets] [http://americanhome-landrealty.com/user_images/thumb/trocfev.html messenger plus 3.25 download] [http://gotasdorvalho.com/forum/store/language/pt/files/zarrolerf.html giant dildo fuck] [http://hryhorczuk.com/transmissions/attachments/files/index.html webmap] [http://fredericks-photo.com/12all/admin/tmp_imp/cache/fevrolv.html channel 4] [http://beog.org/forums/uploads/photos/droncdelp.html sherline] [http://aeesep.com/forum/forum/images/avatars/pics/kovisalof.html homes for sale in toms river new jersey] [http://beog.org/forums/uploads/photos/cnadelc4t.html ashley bryan illustrator] [http://emeraldwinter.com/news/skins/.jsk/int/celfok.html amy carter] [http://mousemanproductions.com/apib/files/cache/moncaboa.html 101 building taipei] [http://beog.org/forums/uploads/photos/alcnad.html school closings] [http://piercedhearts.org/consecrated_hearts/vocational_stories/images/sitemap.html page] [http://cibernau.pt/loja/templates/tmp/trinquan.html lolita sex underage, preteen fuck] [http://elisabetejacinto.com/files/upload/thumbs/fokqasboc.html vlipart] [http://myfinance-magazine.com/wp-content/uploads/2007/09/sitemap.html map] [http://ideiabiba.pt/destaques/pics/monsittro.html anaconda eating people] [http://hryhorczuk.com/transmissions/attachments/files/sitemap.html web] [http://sameasiteverwas.net/rabble/wp-content/uploads/images/golacel.html in sandal shoes womens] [http://lrpctech.com/186/gb-bak/upload/preview/pics/cnazlizg.html aims college greeley] [http://hymstyle.com/oempro.old/system/data/campaign_attachments/files/letora.html thunderhorse] [http://onlinedatingtips.org/blog/wp-content/uploads/2008/03/elttrocpa.html mdf] [http://sameasiteverwas.net/rabble/wp-content/uploads/images/quatroc.html girls pee in shower] [http://sacborg.com/renoswapmeet/forms/use/sampleform/files/any/quazelgo.html umax astra 2100u xp] [http://sweetheartloghomes.com/gallery/cache/live-test/mcmahan/pics/cahens.html team chaotix] [http://hryhorczuk.com/transmissions/attachments/files/sitendes.html traffic delineators] [http://newdaynews.com/gallery/albums/userpics/10009/golchir.html big apple circus] [http://airfareglobal.com/_trcache/tmp/alsabugra.html requiem] [http://sameasiteverwas.net/rabble/wp-content/uploads/images/bugzarfus.html home garage] [http://palmbeachrsl.com.au/documents/txt/index.html webmap] [http://bntu.net/forum2/style_images/ip.boardpr/folder_team_icons/thumbs/golracr.html tingling in the penis] [http://westwideweb.com/sonarama/p5/images/temp/f/f3/sitemap.html homepage] [http://a2zgiftoutlets.com/store/var/skins_repository/base/customer/addons/gift_registry/event/caelterl.html safety nets] [http://moserdesigns.com/ssp_director/albums/album-4/mk/dronelfao.html business accept credit card] [http://blogoltre.com/wp-content/plugins/alinks/logs/log_tmp/tasedsa.html lusitania ss] [http://open-orbit.com/wp-content/uploads/2008/02/chicabo.html throat cancer causes] [http://nryb.com/mobil/pics/thumbs/boceletro.html os x fax software] [http://festivaldeguitarra.org/images/UserFiles/Image/2006/taaczboc.html canoe trailers] [http://grafislab.pt/pt/caixas/images/vivarleto.html young beach] [http://palmbeachrsl.com.au/documents/txt/index.html www] [http://www.bingaswingas.com/wp-content/uploads/2007/11/acquab.html thos cook travel agents] [http://moserdesigns.com/ssp_director/albums/album-4/mk/troczmond.html edison movie release date] [http://myfinance-magazine.com/wp-content/uploads/2007/09/rewcnazor.html it reminds] [http://lrpctech.com/186/gb-bak/upload/preview/pics/kodomsa.html round column concrete form] [http://newdaynews.com/gallery/albums/userpics/10009/basrocn.html iflex] [http://ideiabiba.pt/destaques/pics/eltoufi.html lipase] [http://phocas.net/todd/wp-content/uploads/2008/02/laouhe.html adult nudism] [http://phocas.net/todd/wp-content/uploads/2008/02/roderolbo.html olsen twin sex] [http://investing-magazine.com/wp-content/plugins/alinks/tmp/cache/firovar.html shutters usa] [http://sweetheartloghomes.com/gallery/cache/live-test/mcmahan/pics/fasanef.html international map street] [http://elisabetejacinto.com/files/upload/thumbs/troctrocf.html virtual ibiza] [http://beog.org/forums/uploads/photos/wgoldelie.html shin chan] [http://airfareglobal.com/_trcache/tmp/eldeld.html irish coffee] [http://hymstyle.com/oempro.old/system/data/campaign_attachments/files/ricqaso.html mike tyson punchout online] [http://bilharmania.com/cutenews/data/archives/images/nerolnrwd.html xanga skins] [http://gotasdorvalho.com/forum/store/language/pt/files/sacnaa.html backup hard drive] [http://cibernau.pt/loja/templates/tmp/filetoplr.html shop exhaust fans] [http://piercedhearts.org/consecrated_hearts/vocational_stories/images/quanrcafa.html quality inn baron suite] [http://bntu.net/forum2/style_images/ip.boardpr/folder_team_icons/thumbs/index.html http] [http://hipchicksmacrobiotics.com/blog/wp-content/uploads/2007/10/nenrfipl.html empresa.asp] [http://planetadofutebol.com/backoffice/download/dump/nobrerget.html how to grow pumpkins] [http://hymstyle.com/oempro.old/system/data/campaign_attachments/files/sittare.html yarrow] [http://dhadvisor.com/cache/googlefree/olofao.html in god we trust license plates] [http://onlinedatingtips.org/blog/wp-content/uploads/2008/03/pascogetc.html last minute airfare] [http://cibernau.pt/loja/templates/tmp/licarol.html type of employee training] [http://piercedhearts.org/consecrated_hearts/vocational_stories/images/mexfic.html jewelry exchange] [http://melonmania.org/ips/tmp/index.html http] [http://municipiodelagoa.net/cultura/biblioteca/autogallery/templates/icons/brsitdo.html reebok ladies] [http://bilharmania.com/cutenews/data/archives/images/chield.html aunt jennifer] [http://newdaynews.com/gallery/albums/userpics/10009/gololoelt.html granular ferric oxide] [http://cantinhodasaromaticas.pt/ficheiros_loja/images/icons_old/erdelelpl.html radiator covers canada] [http://equiraf.com/fotos/newsletter_old/small/chizrac.html nikon camera] [http://open-orbit.com/wp-content/uploads/2008/02/libasgolp.html apex2000.net] [http://onlinedatingtips.org/blog/wp-content/uploads/2008/03/cnaorp.html thursday] [http://myfamily-magazine.com/wp-content/uploads/2007/09/taacchi.html engine robin small subaru] [http://open-orbit.com/wp-content/uploads/2008/02/quabrz.html acanthosis nigrican] [http://grafislab.pt/pt/caixas/images/nec4tzerm.html friendship e card] [http://emeraldwinter.com/news/skins/.jsk/int/fuinrolt.html nice tight butt] [http://emeraldwinter.com/news/skins/.jsk/int/rolfokn.html pacific coast highway] [http://cibernau.pt/loja/templates/tmp/mexraccod.html backweb] [http://airfareglobal.com/_trcache/tmp/qasc4ta.html attack bethany hamilton shark] [http://myfinance-magazine.com/wp-content/uploads/2007/09/basfidro.html ucla neuropsychiatric hospital] [http://sports-articles.com/components/com_magazine/magazine/domkota.html ufc.com] [http://hryhorczuk.com/transmissions/attachments/files/qasrof.html romex] [http://myfinance-magazine.com/wp-content/uploads/2007/09/fokolodr.html fye] [http://alvormar.com/cms/autogallery-photos/templates/Thumbs/index.html http] [http://agneloquelhas.com/demo453/components/com_mambelfish/classes/txt/nrdarracc.html aircraft control model radio] [http://municipiodelagoa.net/cultura/biblioteca/autogallery/templates/icons/pastrrez.html northeastern state university] [http://jpcunha.com/website/autogallery/Geral/photo/zmexccn.html new york city pictures] [http://onlinedatingtips.org/blog/wp-content/uploads/2008/03/aceltrwbo.html gushing women] [http://aeesep.com/forum/forum/images/avatars/pics/ricacelc.html empress] [http://dhadvisor.com/cache/googlefree/domcae.html kahlen] [http://westwideweb.com/sonarama/p5/images/temp/f/f3/lisedfic.html embry riddle] [http://melonmania.org/ips/tmp/henbowr.html hotel in london] [http://onlinedatingtips.org/blog/wp-content/uploads/2008/03/eltzels.html tiki torch] [http://www.acib.es/go/tmp/cache/g/cochipasc.html australian phone book] [http://www.chuzanet.com/sb/as/4/9/1/noroin.html obd diagnostics software] [http://palmbeachrsl.com.au/documents/txt/bocnoou.html jennifer paige crush] [http://www.chuzanet.com/sb/as/4/9/1/vielrace.html service] [http://mysports-magazine.com/wp-content/uploads/2007/09/hendarvit.html vitamaster exercise bike] [http://interbeiras-turismo.pt/site/downloads/docs/tachixdel.html sit on face] [http://sports-articles.com/components/com_magazine/magazine/delchixle.html train fares from london to newcastle] [http://www.chuzanet.com/sb/as/4/9/1/rerolsedq.html private mortgage insurance] [http://mysports-magazine.com/wp-content/uploads/2007/09/corovim.html side effects of crohns disease] [http://hryhorczuk.com/transmissions/attachments/files/sitemap.html home] [http://www.bingaswingas.com/wp-content/uploads/2007/11/zarhenca.html rochester ny fire department] [http://municipiodelagoa.net/cultura/biblioteca/autogallery/templates/icons/varlolosa.html when was the space shuttle discovery built] [http://myfamily-magazine.com/wp-content/uploads/2007/09/cosedacel.html leftover crack rock the 40oz] [http://piercedhearts.org/consecrated_hearts/vocational_stories/images/getmonfu.html image inc new product professional] [http://municipiodelagoa.net/cultura/biblioteca/autogallery/templates/icons/derobug.html schwartzian transforms] [http://sweetheartloghomes.com/gallery/cache/live-test/mcmahan/pics/tafasit.html online tax preparation] [http://www.acib.es/go/tmp/cache/g/varnoh.html mile kitic] [http://moserdesigns.com/ssp_director/albums/album-4/mk/sedbrlet.html jean carlos soccer brazil] [http://emeraldwinter.com/news/skins/.jsk/int/fevouvip.html dirt road] [http://americanhome-landrealty.com/user_images/thumb/vifokolos.html luxury down comforters] [http://sweetheartloghomes.com/gallery/cache/live-test/mcmahan/pics/konoinmon.html voli prezzo basso] [http://melonmania.org/ips/tmp/cmonzd.html game mods] [http://corner-news.com/wp-content/uploads/2007/06/negollatr.html afrika bambaataa] [http://bntu.net/forum2/style_images/ip.boardpr/folder_team_icons/thumbs/c4teltza.html basement] [http://phocas.net/todd/wp-content/uploads/2008/02/almexza.html free bible black download] [http://cantinhodasaromaticas.pt/ficheiros_loja/images/icons_old/cadomd.html shuffle] [http://hryhorczuk.com/transmissions/attachments/files/getqas.html 6 b effects side vitamin] [http://mousemanproductions.com/apib/files/cache/acelorl.html kg to lb] [http://myfinance-magazine.com/wp-content/uploads/2007/09/alroldar.html accuscan instruments] [http://festivaldeguitarra.org/images/UserFiles/Image/2006/faletoca.html green laser pointer] [http://municipiodelagoa.net/cultura/biblioteca/autogallery/templates/icons/getcaalr.html download adult movie] [http://ez-spyware.com/cache/googledown/tabugv.html al-jazeera] [http://piercedhearts.org/consecrated_hearts/vocational_stories/images/cacodar.html eros fetish.com] [http://melonmania.org/ips/tmp/oloerel.html r.kelly] [http://bntu.net/forum2/style_images/ip.boardpr/folder_team_icons/thumbs/qualoca.html southern living feature] [http://phocas.net/todd/wp-content/uploads/2008/02/pasbocnoe.html automatic reinvestment plan] [http://myfinance-magazine.com/wp-content/uploads/2007/09/basereto.html sbc voice mail access number] [http://gotasdorvalho.com/forum/store/language/pt/files/sitemap.html www] [http://interbeiras-turismo.pt/site/downloads/docs/fevgolou.html taxi fares uk] [http://cibernau.pt/loja/templates/tmp/quarof.html lypoma] [http://elisabetejacinto.com/files/upload/thumbs/taeloun.html zantrex 3] [http://nryb.com/mobil/pics/thumbs/olodeli.html paul walker contact] [http://palmbeachrsl.com.au/documents/txt/cozelfevx.html upc] [http://hymstyle.com/oempro.old/system/data/campaign_attachments/files/boplzarn.html mike jones - back then] [http://myfinance-magazine.com/wp-content/uploads/2007/09/c4talcrol.html enter the dragon] [http://scorpiogeek.com/povertyhillgarage/wp-content/uploads/2007/10/index.html web] [http://investing-magazine.com/wp-content/plugins/alinks/tmp/cache/zelenm.html international spy museum] [http://alvormar.com/cms/autogallery-photos/templates/Thumbs/index.html http] [http://americanhome-landrealty.com/user_images/thumb/koinxlori.html lone star automotive] [http://sweetheartloghomes.com/gallery/cache/live-test/mcmahan/pics/rolnobrc.html suddenly seymour] [http://hryhorczuk.com/transmissions/attachments/files/chictrf.html land for sale by owner in san antonio] [http://lrpctech.com/186/gb-bak/upload/preview/pics/sitemap.html link] [http://dhadvisor.com/cache/googlefree/elcade.html cheryl lynn khan] [http://onlinedatingtips.org/blog/wp-content/uploads/2008/03/acbasrel.html cleveland museum of art] [http://blogoltre.com/wp-content/plugins/alinks/logs/log_tmp/fabozel.html reversing] [http://myfinance-magazine.com/wp-content/uploads/2007/09/domfevcar.html bit comet] [http://tm-warez.net/engine/cache/system/images/quagold.html thanks giving shopping] [http://palmbeachrsl.com.au/documents/txt/liqasmexb.html october 2005 phases of the moon] [http://hryhorczuk.com/transmissions/attachments/files/loorric.html valenite] [http://corner-news.com/wp-content/uploads/2007/06/henracfu.html mystikal liquid city] [http://bntu.net/forum2/style_images/ip.boardpr/folder_team_icons/thumbs/index.html top] [http://elisabetejacinto.com/files/upload/thumbs/eltdomn.html basic meth recipes] [http://sacborg.com/renoswapmeet/forms/use/sampleform/files/any/bugfas.html wfir 960] [http://grafislab.pt/pt/caixas/images/mexmexsed.html hilarious t shirts] [http://ez-spyware.com/cache/googledown/letoneor.html poker] [http://phocas.net/todd/wp-content/uploads/2008/02/sadrone.html children story books] [http://sports-articles.com/components/com_magazine/magazine/tacafiw.html 50 cent movies] [http://municipiodelagoa.net/cultura/biblioteca/autogallery/templates/icons/inpasvi.html buy refurbished laptop] [http://fmaruba.com/pics/albums/userpics/10001/pasfuac.html vivid videos] [http://hryhorczuk.com/transmissions/attachments/files/oloelca.html exit reality]
{{LanguageBar}}
{{wrongtitle|title=point_template}}
{{CD|CPointTemplate|file1=1}}
[[File:Point template.png|frameless|link=]][[File:Point template classic.png|frameless|link=]]{{this is a|point entity|name=point_template}}


== Entity description ==
== Entity Description ==
Turns an entity, or set of entities, into a single template that can be instanced anywhere, and multiple times.
{{ent|point_template}} turns an [[entity]] or set of entities into a single template that can be instanced anywhere and multiple times. When activated (<tt>ForceSpawn</tt>), it will spawn the entities in the template at the same positions, relative to itself, that they had when this entity was created. This will be their original positions if the <code>point_template</code> has not been moved. To spawn the template in other places, an {{ent|env_entity_maker}} can be used.
{{tip|Any {{ent|logic_relay}} entities within a template will fire their <tt>OnSpawn</tt> output when spawned. This behavior can be used to make templated entities do things when they spawn.}}
{{bug|hidetested=1|{{insurgency}}{{doi}} This entity is broken and will usually crash the game. If the gamemode is set to training in {{insurgency}}, it will work normally.}}
{{bug|hidetested=1|{{csgo}} Spawning a {{ent|func_breakable_surf}} with this entity will crash the game.}}
{{note|Any entity from [[S_PreserveEnts]] cannot be instanced by default. This can be workarounded by making the point_template a preserved entity itself at map load which can be done by using [[logic_auto]] to change the classname of the template with AddOutput to one from S_PreserveEnts. When spawning this template a message will be shown that there are no templated entities, however it will work anyways.}}
{{warning|Entities that have a <code>globalname</code> will not spawn if they have been killed previously.}}
<!--{{Important|{{l4d2}} Do NOT spawn a map's only <kbd>trigger_finale</kbd> via <kbd>point_template</kbd>! Late spawning it with a template results in poor VScript compatibility and other issues. See {{ent|trigger_finale}} for more info.}}-->
Before using this entity, consider sections like [[#Name Fix-up|Name Fix-up]] and [[#FGD Enhancement(s)|FGD Enhancement(s)]] first.


If there are interdependencies (entity I/O, hierarchy, or other name references) between the entities
=== Name Fix-up ===
in the template, the entities in the template will have their names changed and the interdependencies will
To prevent interdependencies (entity I/O, hierarchy, or other name references) between entities, the entities in the template will have their names changed, with any interdependent outputs reconnected to the changed names. The name change format is as follows: '<original name>&XXXX', where the '&XXXX' will be replaced with the current global template instance spawn count, so wildcard searches for '<original name>&*' will still find them. Name fixing is ''only'' for template entities spawned by output; The outputs of the point_template are ''not'' name fixed, and neither are the outputs of other objects referring to template entities.
be reconnected to the changes names. The name change format is as follows: '<original name>&0000', where the 0000
will be replaced with the current global template instance, so wildcard searches for '<original name>*' will still find them.


If you don't want the name fixup to happen, because you're only spawning the template once, or you want inputs to
The special [[targetname]]s (<code>!self</code> and such) work on spawned objects, so a {{ent|trigger_multiple}} with an output to <code>!activator</code> can be used to affect individual spawned objects. Wildcards can refer to all entities spawned by a fix-up-enabled point_template.
trigger all instances of the template, check the 'Preserve entity names' spawnflag.


If used to spawn on its own, this entity spawns the entity/entities at the position of the original template(s) (and not the point_template entity itself). To spawn the template in other places, use an [[env_entity_maker]].
Note that if '"Don't remove template entities"' flag is active, the first (batch of) entities spawned will be postfixed<code>&0002</code>. If you don't want the name fixup to happen, because you're only spawning the template once, or you want inputs to trigger all instances of the template, check the 'Preserve entity names' spawnflag.
 
{{Confirm|If<code>spawnflag 2</code>is active, will the unremoved entity have its name postfixed with<code>&0001?</code>}}
=== Notes on name fixup ===
{{warning|<code>point_template</code> ''will not'' do any name fixing-up in the parameter override boxes of its templated entities.}}
Name fixing is ''only'' performed on the outputs of template entities (the entities being spawned). The outputs of the point_template are ''not'' fixed, and neither are the outputs of other objects referring to template entities.
{{note|Entities must be referenced by name in a keyvalue or external I/O connection to get fixed up. If neither is present, then the name is preserved. If this isn't desired, a easy fix is to add a dummy keyvalue in the entity that references it's own name. It doesn't even have to be a keyvalue that really exists on the entity.}}
 
The special targetnames (see the [[targetname]] article) work on spawned objects, so a [[trigger_multiple]] with an output to <code>!activator</code> can be used to effect individual spawned objects. Wildcards can refer to all entities spawned by a fix-up-enabled point_template.
 
With fixup on, the first entity spawned will be named with <code>&0002</code>. If the '''Do not remove template''' spawnflag of the point_template is enabled, the unremoved template entity will have its name fixed with number <code>&0001</code>.
 
=== Tutorial ===
A [[Respawning_Items|tutorial]] has been created for respawning items using this entity.


== Keyvalues ==
== Keyvalues ==
* {{kv targetname}}
{{KV Targetname}}
* '''Template''01-16'''''
{{KV|Template 1|intn=Template01|to=Template 16|intn2=Template16|target_destination| [[Targetname]](s) to search for entities to template. These can be exact matches, or wildcards (*). If multiple entities are matched, all entities will be included in the template.}}
: <target_destination>


== Flags ==
== Flags ==
* 1 : Don't remove template entities
{{fl|1|Don't remove template entities|Prevent template entities being removed automatically.}}
* 2 : Preserve entity names (Don't do name fixup)
{{fl|2|Preserve entity names (Don't do name fixup)|Causes the spawned entities to be named exactly as their templates were (as opposed to renamed).}}


== Inputs ==
== Inputs ==
* {{i targetname}}
{{I|ForceSpawn|Spawn an instance of the template at the original position.}}
* '''ForceSpawn'''
: Spawn an instance of the template at the original position.


== Outputs ==
== Outputs ==
* {{o targetname}}
{{O|OnEntitySpawned|ac-is-this=1|Fired after spawning an instance of this template.}}
* '''OnEntitySpawned'''
 
: Fired after spawning an instance of this template.
== FGD Enhancement(s) ==
From [https://github.com/TeamSpen210/HammerAddons TeamSpen210's Hammer Addons],<code>point_template</code>can be made to show connecting lines to all entities part of its template.
 
First, go to this line in your<code>base.fgd</code>and highlight the same characters:
<source lang="cpp">@PointClass base(Targetname) iconsprite("editor/point_template.vmt") = point_template : </source>
Then copy all of this, and paste all of this over it:
<source lang="cpp">@PointClass base(BaseEntityPoint)
iconsprite("editor/point_template.vmt")
line(255 255 0, targetname, Template01)
line(255 255 0, targetname, Template09)
line(255 255 0, targetname, Template02)
line(255 255 0, targetname, Template10)
line(255 255 0, targetname, Template03)
line(255 255 0, targetname, Template11)
line(255 255 0, targetname, Template04)
line(255 255 0, targetname, Template12)
line(255 255 0, targetname, Template05)
line(255 255 0, targetname, Template13)
line(255 255 0, targetname, Template06)
line(255 255 0, targetname, Template14)
line(255 255 0, targetname, Template07)
line(255 255 0, targetname, Template15)
line(255 255 0, targetname, Template08)
line(255 255 0, targetname, Template16)
= point_template: </source>


== See also ==
== See also ==
* [[env_entity_maker]] - automatic respawning and/or spawning at a different location.
* [[Respawning Items|tutorial for respawning items using this entity]]
* [[npc_maker]] - an alternative spawning entity, also with optional automatic respawning.
* {{ent|env_entity_maker}} - Automatic respawning and/or spawning at a different location
 
* {{ent|npc_maker}} - An alternative spawning entity, also with optional automatic respawning
[[Category:Entities]]
* {{l4d2}} {{ent|point_script_template}} - Version of <code>point_template</code> catered to [[VScript]]ing

Latest revision as of 20:16, 28 May 2025

English (en)中文 (zh)Translate (Translate)
C++ Class hierarchy
CPointTemplate
CLogicalEntity
CServerOnlyEntity
CBaseEntity
C++ point_template.cpp

Point template.pngPoint template classic.pngpoint_template is a point entity available in all Source Source games.

Entity Description

point_template turns an entity or set of entities into a single template that can be instanced anywhere and multiple times. When activated (ForceSpawn), it will spawn the entities in the template at the same positions, relative to itself, that they had when this entity was created. This will be their original positions if the point_template has not been moved. To spawn the template in other places, an env_entity_maker can be used.

Tip.pngTip:Any logic_relay entities within a template will fire their OnSpawn output when spawned. This behavior can be used to make templated entities do things when they spawn.
Icon-Bug.pngBug:InsurgencyDay of Infamy This entity is broken and will usually crash the game. If the gamemode is set to training in Insurgency, it will work normally.
Icon-Bug.pngBug:Counter-Strike: Global Offensive Spawning a func_breakable_surf with this entity will crash the game.
Note.pngNote:Any entity from S_PreserveEnts cannot be instanced by default. This can be workarounded by making the point_template a preserved entity itself at map load which can be done by using logic_auto to change the classname of the template with AddOutput to one from S_PreserveEnts. When spawning this template a message will be shown that there are no templated entities, however it will work anyways.
Warning.pngWarning:Entities that have a globalname will not spawn if they have been killed previously.

Before using this entity, consider sections like Name Fix-up and FGD Enhancement(s) first.

Name Fix-up

To prevent interdependencies (entity I/O, hierarchy, or other name references) between entities, the entities in the template will have their names changed, with any interdependent outputs reconnected to the changed names. The name change format is as follows: '<original name>&XXXX', where the '&XXXX' will be replaced with the current global template instance spawn count, so wildcard searches for '<original name>&*' will still find them. Name fixing is only for template entities spawned by output; The outputs of the point_template are not name fixed, and neither are the outputs of other objects referring to template entities.

The special targetnames (!self and such) work on spawned objects, so a trigger_multiple with an output to !activator can be used to affect individual spawned objects. Wildcards can refer to all entities spawned by a fix-up-enabled point_template.

Note that if '"Don't remove template entities"' flag is active, the first (batch of) entities spawned will be postfixed&0002. If you don't want the name fixup to happen, because you're only spawning the template once, or you want inputs to trigger all instances of the template, check the 'Preserve entity names' spawnflag.

Confirm:Ifspawnflag 2is active, will the unremoved entity have its name postfixed with&0001?
Warning.pngWarning:point_template will not do any name fixing-up in the parameter override boxes of its templated entities.
Note.pngNote:Entities must be referenced by name in a keyvalue or external I/O connection to get fixed up. If neither is present, then the name is preserved. If this isn't desired, a easy fix is to add a dummy keyvalue in the entity that references it's own name. It doesn't even have to be a keyvalue that really exists on the entity.

Keyvalues

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

Template 1 (Template01) to Template 16 (Template16) <targetname>
Targetname(s) to search for entities to template. These can be exact matches, or wildcards (*). If multiple entities are matched, all entities will be included in the template.

Flags

Don't remove template entities : [1]
Prevent template entities being removed automatically.
Preserve entity names (Don't do name fixup) : [2]
Causes the spawned entities to be named exactly as their templates were (as opposed to renamed).

Inputs

ForceSpawn
Spawn an instance of the template at the original position.

Outputs

OnEntitySpawned
!activator = !caller = this entity
Fired after spawning an instance of this template.

FGD Enhancement(s)

From TeamSpen210's Hammer Addons,point_templatecan be made to show connecting lines to all entities part of its template.

First, go to this line in yourbase.fgdand highlight the same characters:

@PointClass base(Targetname) iconsprite("editor/point_template.vmt") = point_template :

Then copy all of this, and paste all of this over it:

@PointClass base(BaseEntityPoint) 
	iconsprite("editor/point_template.vmt")
	line(255 255 0, targetname, Template01)
	line(255 255 0, targetname, Template09)
	line(255 255 0, targetname, Template02)
	line(255 255 0, targetname, Template10)
	line(255 255 0, targetname, Template03)
	line(255 255 0, targetname, Template11)
	line(255 255 0, targetname, Template04)
	line(255 255 0, targetname, Template12)
	line(255 255 0, targetname, Template05)
	line(255 255 0, targetname, Template13)
	line(255 255 0, targetname, Template06)
	line(255 255 0, targetname, Template14)
	line(255 255 0, targetname, Template07)
	line(255 255 0, targetname, Template15)
	line(255 255 0, targetname, Template08)
	line(255 255 0, targetname, Template16)
= point_template:

See also