<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<!--(==============================================================)-->
<!--(Document created with RoboEditor. )============================-->
<!--(==============================================================)-->

<head>

<title>Spawning Items Reference</title>
<!--(Meta)==========================================================-->

<meta name=generator content="RoboHELP by eHelp Corporation - www.ehelp.com">
<meta name=generator-major-version content=0.1>
<meta name=generator-minor-version content=1>
<meta name=filetype content=kadov>
<meta name=filetype-version content=1>
<meta name=page-count content=1>
<meta name=layout-height content=1375>
<meta name=layout-width content=700>
<meta name=date content="06 8, 2001 3:37:23 PM">


<!--(Links)=========================================================-->

<SCRIPT language="javascript" title="WebHelpSplitCss">
<!--
if (navigator.appName=="Netscape")
{   document.write("<LINK rel='StyleSheet' href='../default_ns.css'>");}
else
{   document.write("<LINK rel='StyleSheet' href='../default.css'>");}
//-->
</SCRIPT>
<style>
<!--
p.whs1 {font-weight: bold;}
p.whs2 {font-weight: bold;}
p.whs3 {font-style: italic; font-size: 10pt;}
ul.whs4 {list-style: disc;}

-->
</style>
<script language="javascript" title="WebHelpInlineScript">
<!--
function reDo() {
  if (innerWidth != origWidth || innerHeight != origHeight)
     location.reload();
}
if ((parseInt(navigator.appVersion) >= 4) && (navigator.appName == "Netscape")) {
	origWidth = innerWidth;
	origHeight = innerHeight;
	onresize = reDo;
}
//-->
</script>
<style>
<!--
  div.WebHelpPopupMenu {position:absolute; left:0px; top:0px; z-index:4; visibility:hidden;}
  p.WebHelpNavBar {text-align:right;}
-->
</style>
<script src="../bsscnbar.js" language="JavaScript" title="WebHelpNavBarExtJs" >
</script>
</head>

<!--(Body)==========================================================-->


<body>

<SCRIPT language="JavaScript" title="WebHelpNavBar">
<!--
gbstrRelHomePageURL="../index.html";
if (parseInt(navigator.appVersion) >=3  && window.name.indexOf("BSSCPopup") == -1)
{
var strNvHome=""; var strNvBrowse=""; var strNvWebSearch="";
if ((parseInt(navigator.appVersion) >= 3) && (typeof (BsscNavHasNavFrame) != "undefined") &&
 (typeof(BsscNavIsList) == "undefined" || !BsscNavIsList())) 
{
  if (!BsscNavHasNavFrame()) {
    strNvHome  = "<a href=\"javascript:void(0);\" onclick=\"onBsscNavShow();return false;\"><img src='../bsscnav1.gif' width=42 height=19 border=no></a>";
  } else {
    strNvHome  = "<a href=\"javascript:void(0);\" onclick=\"onBsscNavHide();return false;\"><img src='../bsscnav2.gif' width=37 height=19 border=no></a>";
  }
}
if ((strNvHome.length != 0) || (strNvBrowse.length != 0) || (strNvWebSearch.length != 0)) {
  document.write("<p id='NavBar' align='right' class=WebHelpNavBar><nobr><font size=1>");
  if (strNvHome.length != 0) document.write(strNvHome);
  if (strNvBrowse.length != 0) document.write(strNvBrowse);
  if (strNvWebSearch.length != 0) document.write(strNvWebSearch);
  document.write("</font>&nbsp;&nbsp;&nbsp;</nobr></p>");
  }
}
//-->
</SCRIPT>

<h1>Spawning HL Entities</h1>

<p>This is a quick and dirty tutorial on spawning things. Why is a spawning 
 tutorial in the Admin Mod documentation, you ask? Well, we get a lot of 
 questions about how to use the spawning commands, and the almighty second 
 god of Admin Mod, Jaguar, wrote this tutorial back when he first gave 
 Admin Mod spawning capabilities. It is still completely valid today, and 
 barely edited. Praise Jaguar! (We're not worthy!)</p>

<p>&nbsp;</p>

<p style="font-style: normal; font-weight: bold;">Jag speaks:</p>

<p>&nbsp;</p>

<p>So, this tutorial's broken down into two parts:</p>

<p>&nbsp;</p>

<ul style="list-style: disc;"
	type=disc>
	
	<li class=kadov-p><p>Adding stuff onto a map ahead of time</p></li>
	
	<li class=kadov-p><p>Adding stuff onto a map at run time</p></li>
</ul>

<p style="font-weight: bold;">&nbsp;</p>

<p style="font-weight: bold;">Adding stuff onto a map ahead of time</p>

<p>First, you need a map. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->I 
 play TFC, so I'm going to use 2fort as an example. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->How 
 many people haven't dreamed of plopping down a Xen tree or 3 on the bridge 
 of 2fort? <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->Well, 
 ok...more of you than I expected, but that's what we're going to do anyways. 
 =P</p>

<p>&nbsp;</p>

<p>For you CS people, you can just follow along (it's pretty easy), or 
 one of you can write me up an example for CS, which I can include.</p>

<p>&nbsp;</p>

<p>Anyways, you need 2fort.bsp. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->This 
 is found in all server installs, so you should have it if you have a server, 
 in hlserver\tfc\maps. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->Before 
 doing anything else, BACK UP THE MAP! <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->Copy 
 it to 2fort.bak or something.</p>

<p>&nbsp;</p>

<p>Now, you've got two options: you can edit the .bsp file by hand, or 
 you can export the entities and edit those. </p>

<p>&nbsp;</p>

<p><span style="font-weight: bold;">Option 1:</span> Editing by hand requires 
 you to have a decent text editor; one that doesn't barf at characters 
 above ASCII 127. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->What 
 you need to do is look for the entity information. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->2fort.bsp 
 is roughly 2.5 megs; in it, the entity information begins at offset 255800h. 
 <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->You should 
 see this:</p>

<p>&nbsp;</p>

<p>{</p>

<p>&quot;wad&quot; &quot;\tffree\tfc\tfc.wad;\tffree\valve\halflife.wad;\tffree\valve\liquids.wad;&quot;</p>

<p>&quot;mapversion&quot; &quot;340&quot;</p>

<p>&quot;mapversion&quot; &quot;220&quot;</p>

<p>&quot;sounds&quot; &quot;1&quot;</p>

<p>&quot;message&quot; &quot;2 Forts Classic&quot;</p>

<p>&quot;skyname&quot; &quot;dusk&quot;</p>

<p>&quot;MaxRange&quot; &quot;4096&quot;</p>

<p>&quot;classname&quot; &quot;worldspawn&quot;</p>

<p>&quot;classname&quot; &quot;worldspawn&quot;</p>

<p>}</p>

<p>&nbsp;</p>

<p>All of the entities follow in the same format: enclosed in braces ( 
 {} ), with key/value pairs describing the data.</p>

<p>&nbsp;</p>

<p><span style="font-weight: bold;">Option 2:</span> Exporting the entity 
 list requires Zoner's Half-Life Editing Tools (ZHLET), which you can find 
 here:</p>

<p>&nbsp;</p>

<p><a href="http://www.valve-erc.com/resources/?page=zhlt" target="_blank">http://www.valve-erc.com/resources/?page=zhlt</a></p>

<p>&nbsp;</p>

<p>Once you've downloaded the tools (and compiled them, if need be), run 
 the ripent.exe tool:</p>

<p>ripent -export (map)</p>

<p>&nbsp;</p>

<p><!--kadov_tag{{<spaces>}}-->&nbsp;&nbsp;<!--kadov_tag{{</spaces>}}-->ripent 
 -export d:\hlserver\tfc\maps\2fort.bsp</p>

<p>&nbsp;</p>

<p>This will create a file in the same directory as the .bsp, but with 
 the extension .ent (eg, in the example, it would create d:\hlserver\tfc\maps\2fort.ent). 
 <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->This .ent 
 file is the entity list from the .bsp file, and can be edited (IMHO) much 
 easier, allows for easier searching, etc.</p>

<p>&nbsp;</p>

<p>Moving on...</p>

<p>&nbsp;</p>

<p>What do these key/value pairs do? <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->Some 
 of them are obvious. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->Some 
 of them are not. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->Some 
 of them _seem_ obvious, but are actually not (who would guess that 'maxammo_shells' 
 key on a 'tf_detect' entity actually controls the class limits for team 
 1? <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->I wouldn't...)</p>

<p>&nbsp;</p>

<p>The most comprehensive entity list I've found so far is on Wavelength:</p>

<p><A href="http://www.planethalflife.com/wavelength/levels/entities/index.html">http://www.planethalflife.com/wavelength/levels/entities/index.html</a></p>

<p>&nbsp;</p>

<p>(It covers TFC entities...but not CS ones. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->Sorry.) 
 <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->Probably 
 the easiest way to start is to find a map that already has what you want 
 in it, and take a look at its entities, copying as you go. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->But 
 for this little example, I'll just give you the entity for a xen_tree:</p>

<p>&nbsp;</p>

<p>{</p>

<p>&quot;renderamt&quot; &quot;255&quot;</p>

<p>&quot;rendercolor&quot; &quot;0 10 200&quot;</p>

<p>&quot;origin&quot; &quot;0 0 0&quot;</p>

<p>&quot;angles&quot; &quot;0 0 0&quot;</p>

<p>&quot;classname&quot; &quot;xen_tree&quot;</p>

<p>}</p>

<p>&nbsp;</p>

<p>Oh, but there's a problem. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->What 
 are the coordinates of where we want to put it? <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->You've 
 got three ways to get them:</p>

<p>&nbsp;</p>

<ul style="list-style: disc;"
	type=disc>
	
	<li class=kadov-p><p>Using a program to decompile the .bsp into a .map 
 file (such as winbspc for Win32 machines), open the map in Worldcraft 
 and locate the coordinates that way.</p></li>
	
	<li class=kadov-p><p>Load the map up into a dedicated server on your 
 machine. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->Walk 
 around until you find the spot, and then use the 'status' cmd to get your 
 coordinates.</p></li>
	
	<li class=kadov-p><p>If you have Admin Mod, and are using the plugin 
 scripts, load the map up into a server and then user the 'admin_userorigin 
 (player)' cmd to get your coordinates.</p></li>
</ul>

<p>&nbsp;</p>

<p>Using one of these methods, get the coordinates of where you want to 
 place the xen_tree. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->I'm 
 going to go ahead and just use ones I've already gotten: X:0, Y:0, Z:-480.</p>

<p>&nbsp;</p>

<p>So, update the entity info with your new coordinates (origin) data:</p>

<p>&nbsp;</p>

<p>{</p>

<p>&quot;renderamt&quot; &quot;255&quot;</p>

<p>&quot;rendercolor&quot; &quot;0 10 200&quot;</p>

<p>&quot;origin&quot; &quot;0 0 -460&quot;</p>

<p>&quot;angles&quot; &quot;0 0 0&quot;</p>

<p>&quot;classname&quot; &quot;xen_tree&quot;</p>

<p>}</p>

<p>&nbsp;</p>

<p>Put that at the end of the entity list (making sure to be very careful 
 if you're editing the .bsp by hand). <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->If 
 you're using ripent, then you have to import the .ent file back in ripent 
 -import (map)</p>

<p>&nbsp;</p>

<p><!--kadov_tag{{<spaces>}}-->&nbsp;&nbsp;&nbsp;<!--kadov_tag{{</spaces>}}-->ripent 
 -import d:\hlserver\tfc\maps\2fort.bsp</p>

<p>&nbsp;</p>

<p>Once this is done, load the map up into a server. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->A 
 cute li'l xen tree should be awaiting you on the bridge.</p>

<p>The tree can be removed easily...just remove the entity information 
 from the bsp or the ent (being sure to import when done if editing an 
 ent). <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->Similarly, 
 other trees can be added at other spots, or other entities entirely could 
 be added (more spawn points in CS, ammo packs for TFC in the hldm maps, 
 etc).</p>

<p>&nbsp;</p>

<p style="font-weight: bold;">Adding stuff onto a map at run time</p>

<p>Adding stuff on the fly requires one of two things:</p>

<p>&nbsp;</p>

<ul style="list-style: disc;"
	type=disc>
	
	<li class=kadov-p><p>sv_cheats 1 enabled.</p></li>
	
	<li class=kadov-p><p>Admin Mod, latest version</p></li>
</ul>

<p>&nbsp;</p>

<p>However, before you can add anything onto a map, (and this is the important 
 bit) it has to already have been precached. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->Things 
 can only be precached when the map loads. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->In 
 general, this means that the only things you can add onto a map at run-time 
 are things that already exist on the map.</p>

<p>&nbsp;</p>

<p>It boils down to this: If you want to add a xen tree somewhere at run 
 time, a xen tree must already exist on the map. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->It 
 doesn't matter where (it doesn't have to be 'in the map')...but it's got 
 to exist.</p>

<p>&nbsp;</p>

<p>So, getting back to 2fort, remove the original xen_tree (if necessary), 
 and add this in:</p>

<p>&nbsp;</p>

<p>{</p>

<p>&quot;renderamt&quot; &quot;255&quot;</p>

<p>&quot;rendercolor&quot; &quot;0 10 200&quot;</p>

<p>&quot;origin&quot; &quot;5000 5000 5000&quot;</p>

<p>&quot;angles&quot; &quot;0 0 0&quot;</p>

<p>&quot;classname&quot; &quot;xen_tree&quot;</p>

<p>}</p>

<p>&nbsp;</p>

<p>Note the origin; 5000 5000 5000 is well outside the map. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->No 
 one will ever see, touch, or interact with this xen tree in any way. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->It's 
 only purpose in life is so that we can spawn other xen trees. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->Without 
 it, we can't spawn any xen trees at all.</p>

<p>&nbsp;</p>

<p>With this down, we can now spawn an army of xen trees, anywhere we want.</p>

<p>&nbsp;</p>

<p>Using sv_cheats, the cmd is 'give xen_tree'. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->It'll 
 spawn one wherever you are.</p>

<p>&nbsp;</p>

<p>Using Admin Mod, the cmd would be 'admin_spawn xen_tree (X) (Y) (Z) 
 (XAngle) (YAngle) (ZAngle)'. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->The 
 angles can default to 0, but having a ZAngle of 180 will give you an upside 
 down Xen tree, which is kind of amusing. =)</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

</body>

</html>
