nyuuzyou/wikis huggingface dataset:
Porting maps from one mod to another (GoldSrc)

If you're interested in porting a map from one Half Life mod to another, this tutorial will show you how to do it. EG if you want to port a Condition Zero map to Half Life, this will show you how to do it.
Required tools:
* - Can edit entities in bsp
* - Can edit geometry etc
* Notepad - Can edit lines
* Resgen - Creates a res file that specifies the assets used on the map
* HUSKMD - Can decompile map files (WinBSPC, BSP2MAP, MBSPC, are not recommended)
==Collecting assets==
Extract Resgen to the source directory of the maps which you want to copy. Click and drag the maps you want to copy onto resgen.exe.
Resgen will dump some *.res files, open these up. The *.res files will tell you which WAV, TGA, MDL, SPR and WAD files you will need to copy over. Make sure when you copy these files that you retain file directory structures!
Once you have copied these files, copy over your maps. You should now be able to load up the maps, but many of the entities probably won't display properly (or at all).
==Fixing entities==
Run BSPedit, and direct it to your mod's map directory. It should show up the maps which you have copied over.
Load up one of these maps, and start looking at the entities. Typically you will need to change MONSTER_ WEAPON_ or AMMO_ entities. A simple way of doing this is to copy all the text you see into notepad, and using the "replace" tool.
Some maps may have props in. If they do, you will need to convert the props from something like env model/item generic to a cycler sprite (buggy) or env sprite.
Paste this text back into BSPedit, and save the map. Load the map up in game, and with any luck it should run more or less perfectly!
You may that find some games with unusual entities don't work quite properly. These maps will require further editing.
==Further editing==
If Step 2 isn't enough, you will need to do some further editing.
A typical problem encountered may be that some doors may not open in your map. If this happens you will need to decompile the map, and load it up in Hammer. Look for the problematic door, and note down the entity name.
Load up BSPedit again, and search for that entity name. This should bring up the problematic door in question. Rename this door to func_derp or some other useless name - this will result in the door not appearing in game.
Afterpoint: adding more detail to a map
If you want to add in more detail/entities to your map, you can do so with Hammer and BSPedit.
Load up a decompiled map in Hammer, and start adding entities as you please. As you add the entities, note down the entity name, X Y Z coordinates, targetname, and angles.
Once you have all the entities you want added, close down Hammer and load up BSPedit. We now need to copy the entity names, X Y Z coordinates, targetname and angle data of the new entities into the original compiled map.
There you have it! This is a complicated process to go through, but once you get the hang of it becomes easy.
== External links ==
* ModDB
Category:Modding
Category:Level Design
Category:Scripting
Category:Tutorials
Category:Glossary
Category:GoldSrc
Category:Level Design FAQ
Position Along Path Sequential

The Position Along Path Sequential initializer causes particles to spawn at points along a straight line between two control points.
== Properties ==
; Operator fade/oscillate
: No effect
; Start control point number
; End control point number
: The two CPs to form a path between.
; Particles to map from start to end
: How many particles are needed to complete the path. Defines particle density.
; Mid point position
: Normalised percentage. The position on either side of which there should be an equal number of particles. 
; Maximum distance
: How far from its ordinary location each particle is allowed to spawn.
: 
; Restart behavior
: What should happen when the end of the path has been reached but there are still particles to spawn.
:; 0 - Bounce
:: Reverse direction
:; 1 - Loop
:: Start again at the first CP. Doesn't work properly with render_rope.
; Bulge
: The maximum distance from a straight line that the path can deviate. Bulging creates a smooth curve in the path.
: 
; Bulge control
: The manner in which bulge is calculated.
:; 0 - Random
:: Bulge in any direction and peak anywhere. Bulge distance interpreted as units.
:; 1 - Orientation of start CP
:; 2 - Orientation of end CP
:: Bulge along the +X axis of the CP, peaking at the specified midpoint. Bulge distance interpreted as proportion of path length.
Category:Particle initializers
Powerstation 17

is a singleplayer mod for . Gordon Freeman infiltrates a power station commandeered by Combine forces in an effort to destabilize their control of the region.
== Media ==
Visit PlanetPhillip (Archive) for more screenshots, a panoramic viewer, and reviews!
== History ==
This mod was released on August 18, 2008, with development begining back in February 2008.
== Team ==
Design and Construction
* Jason Gimba
Playtesting
* Jon Azzara
* David Bollesen
* Dustin DeVoe
* Peter Giokaris
* Darren Korman
* Brian Morgan
* Bradley Rebh
* Micah Rollins
* Randal Shaffer
Special Thanks
* All Tutorial Authors
* Interlopers
* Nem's Tools
* PlanetPhillip
* SDK Nuts
* Valve
* Valve Developer Community
== Download ==
* ZIP file at ModDB
== External links ==
* Powerstation 17 @ PlanetPhillip (Archive)
* Kyo Maps (Archive)
Category:Single Player Mods
Pre-Fortress 2

__NOTOC__
 is a free mod that attempts to recreate the visual aesthetic of 2006 beta version of as seen in Trailer 1 and Trailer 2 of . Its gameplay mechanics takes cues from predecessors, and .
==Features==
* Different grenade variations given depending on which class is chosen (like 's predecessors and ).
* Beta graphics and aesthetic (including player models) like in Trailer 1 and Trailer 2.
* Beta sound effects.
* Armor has been added back (like in and ).
* The Engineer can now repair teammates' armor by hitting a teammate with his wrench.
* The Spy now has a tranquilizer gun that makes enemies mouse sensitivity high and makes it hard to aim when hit.
* The Scout now has a nail gun (like in and ).
* The Heavy now has a lead pipe as his melee weapon.
* The Sniper's default sniper rifle now works like The Classic in (or the sniper rifle from ).
* The Demoman now has dynamite as his throwable item.
* The Pyro can now shoot incendiary rockets by pressing right click instead of airblast.
* The Sniper now has a club as his melee weapon.
* The Medic has a syringe as his melee weapon that heals teammates and poisons enemies when hit.
* The Pyro has a branding iron with the logo on it as his melee weapon.
==Used Assets==
* 
* 
* 
* 
* Project 2006
* Source SDK 2013 Community Edition
* Team Fortress 2 Vintage
==Requirements==
* 
:* 
==See also==
* 
* 
* 
* 
* 
* 
==External links==
* 
* Discord
* Twitter
==References==
* 
* Official Website
	 
Category:Released Mods
PrecacheMaterial

PrecacheMaterial is a function provided to precache materials by string. File paths are relative to the mod's "Materials" folder.
== Usage ==
//-----------------------------------------------------------------------------
// Purpose: Add material to precache
// Input : *pMaterialName - material name
// Output : 
//-----------------------------------------------------------------------------
void PrecacheMaterial( const char *pMaterialName )
== Examples ==
void CFireTrail::Precache( void )
{
	PrecacheMaterial( "sprites/flamelet1" );
	PrecacheMaterial( "sprites/flamelet2" );
	PrecacheMaterial( "particle/particle_smokegrenade" );
	PrecacheMaterial( "particle/particle_noisesphere" );
}
void CCitadelEnergyCore::Precache()
{
	BaseClass::Precache();
	PrecacheMaterial( "effects/combinemuzzle2_dark" ); 
}
Category:Programming
Category:UTIL
PrecacheModel

PrecacheModel is a function provided to precache models or materials by string.
== Usage ==
//-----------------------------------------------------------------------------
// Purpose: Add model to level precache list
// Input : *name - model name
// Output : int -- model index for model
//-----------------------------------------------------------------------------
int CBaseEntity::PrecacheModel( const char *name )
== Examples ==
#define PROP_COMBINE_BALL_MODEL	"models/effects/combineball.mdl"
#define PROP_COMBINE_BALL_SPRITE_TRAIL "sprites/combineball_trail_black_1.vmt" 
//-----------------------------------------------------------------------------
// Precache 
//-----------------------------------------------------------------------------
void MyEntity::Precache( void )
{
	BaseClass::Precache( );
	PrecacheModel( PROP_COMBINE_BALL_MODEL );
	PrecacheModel( PROP_COMBINE_BALL_SPRITE_TRAIL );
}
//This example loops through an array of possible models
//And precaches each one.
void CSDKPlayer::Precache()
{
	int i = 0;
	while( pszPossiblePlayerModels[i] != NULL )
	{
		PrecacheModel( pszPossiblePlayerModels[i] );
		i++;
	}	
	BaseClass::Precache();
}
Category:Programming
Category:UTIL
PrecacheParticleSystem

PrecacheParticleSystem is a function provided to precache particle effects by string. Make sure to specify the name of the actual particle effect and not the name of the .pcf file. All child systems in question will be precached as well.
== Usage ==
//-----------------------------------------------------------------------------
// Precaches a particle system
//-----------------------------------------------------------------------------
void PrecacheParticleSystem( const char *pParticleSystemName )
{
	g_pStringTableParticleEffectNames->AddString( false, pParticleSystemName );
	g_pParticleSystemMgr->PrecacheParticleSystem( pParticleSystemName );
}
== Examples ==
void CWeaponSMG1::Precache( void )
{
	PrecacheParticleSystem( "muzzle_smg1" );
}
Category:Programming
Category:UTIL
PrecacheScriptSound

PrecacheScriptSound is a function provided to precache Soundscripts by name. The Soundscript must be declared in the Soundscript manifest document.
== Usage ==
//-----------------------------------------------------------------------------
// Purpose: Add a Sound Script to the precached list so you can use it
// Input : *soundname - Sound's name as defined in scripts/game_sounds.txt
// Output :
//-----------------------------------------------------------------------------
HSOUNDSCRIPTHANDLE CBaseEntity::PrecacheScriptSound( const char *soundname )
== Examples ==
//-----------------------------------------------------------------------------
// Precache 
//-----------------------------------------------------------------------------
void CPropJeepEpisodic::Precache( void )
{
	PrecacheScriptSound( "JNK_Radar_Ping_Friendly" );
	PrecacheScriptSound( "Physics.WaterSplash" );
	BaseClass::Precache();
}
void CWeaponGravityGun::Precache( void )
{
	BaseClass::Precache();
	PrecacheScriptSound( "Weapon_Physgun.Scanning" );
	PrecacheScriptSound( "Weapon_Physgun.LockedOn" );
	PrecacheScriptSound( "Weapon_Physgun.Scanning" );
	PrecacheScriptSound( "Weapon_Physgun.LightObject" );
	PrecacheScriptSound( "Weapon_Physgun.HeavyObject" );
}
Category:Programming
Category:UTIL
Precaching Assets

To provide a smooth loading of assets for a typical game session, it is important that the engine does as much work as possible to load those assets before the session begins. By doing this, the player's experience is not disturbed by interruptions as the engine tries to load assets in the middle of a session, often causing "hitching", lag or delays in rendering. With precaching, the assets are already loaded and are immediately ready for use. To do this, entities must declare and precache the assets they intend to use before the session starts. There are multiple utility functions in place to achieve this.
== Functions ==
The Precache() function is available to all descendants of the CBaseEntity class and must be called in the Spawn() function of each entity. All assets used by the entity (models, sounds, VCD, decals) must be declared in this function to be used. Assets may not be precached outside of this function. 
Assets are precached using the functions below.
* PrecacheModel
* PrecacheMaterial
* PrecacheScriptSound
* PrecacheParticleSystem
* PrecacheStandardParticleSystem
* PrecacheGibsForModel
* PrecacheFileWeaponInfoDatabase
* PrecacheInstancedScene
* PrecachePhysicsSoundByStringIndex
* PrecachePhysicsSounds
* PrecachePointTemplates
* PrecacheVGuiScreen
* PrecacheVGuiScreenOverlayMaterial
* UTIL_PrecacheDecal
* UTIL_PrecacheOther
* UTIL_PrecacheOtherGrenade
=== PrecacheInstancedScene ===
Used to precache a VCD file.
void PrecacheInstancedScene(
 char const *pszScene
)
Parameters
* pszScene
** Filename of the VCD to precache.
Return Value
* None.
=== UTIL_PrecacheOther ===
Utility function that will call the Precache() function for an entity that will be referenced or created during the lifetime of the calling entity. This is often used for weapons that will create a child entity (like a grenade) dynamically during the course of a session.
void UTIL_PrecacheOther(
 const char *szClassname,
 const char *modelName
)
Parameters
* szClassname
** Entity classname to precache assets for.
* modelName
** Model name to use for this entity.
Return Value
* None.
=== UTIL_PrecacheDecal ===
Used to precache a decal.
int UTIL_PrecacheDecal(
 const char *name,
 bool preload
)
Parameters
* name
** Name of the decal to precache.
* preload
** Whether or not to preload this decal.
Return Value
* Reference index for the decal model.
=== More ===
* IEngineSound::PrecacheSound
* IVEngineServer::PrecacheSentenceFile
* IVEngineServer::PrecacheDecal
* IVEngineServer::PrecacheGeneric
== Forcing Precache ==
If you have an entity you will be creating that isn't explicitly placed in the level, you can force precaching by modifying InitBodyQue as follows:
void InitBodyQue()
{
 CBaseEntity *pEnt = CreateEntityByName("my_entity");
 if ( pEnt )
 {
 pEnt->Precache();
 UTIL_Remove(pEnt);
 }
}
Alternatively, certain entities like the player use the PRECACHE_REGISTER definition to force precache. 
== Defines ==
* PRECACHE_WEAPON_REGISTER
* CLIENTEFFECT_REGISTER_BEGIN
Category:Programming
Precipitation issues

A func_precipitation can be very effective for your map's atmosphere. However, there are some glitches that can cause your map to lock up and crash, or at the least run slowly.
== Major glitches ==
# If the precipitation is too dense, causing more than 32000 vertices visible at once, it will cause a fatal crash. Dense precipitation is possible, but in sparsely populated areas.
# If you have rain and water in the same map, make sure they are positioned so that the rain does not go into the water. This has not been verified as a crash-causing glitch, but by preventing this, you can avoid more serious glitches.
# Make sure your rain stays within your map. Rain and snow fall some ways below the end of your func_precipitation, and as such could fall out of your map. This has been noted as causing a map lock-up, yet does not create a compile glitch.
# If you use a func_smokevolume brush under your func_precipitation, make sure that there is enough space in between them so that as the precipitation falls down it doesn't enter the smoke volume below. If it does, the map will stop loading at the end of the progress bar (there are no compile errors).
== Minor glitches ==
When a func_precipitation is next to a thin enough wall, the rain or snow will sometimes fall through the wall and appear on the other side.
The density keyvalue is based on the volume of the individual func_precipitation. Because of this, having several func_precipitations of varying sizes with the same densities can create a varying rain intensity. This is not a glitch, but can be difficult to alter exactly. You can calculate the volumes of the individual func_precipitations by multiplying length, height, and depth of each and comparing the results.
If there is a point_camera entity active in a map containing rain, it will generally cause the rain to not render at all. This can be verified in game using the r_rainprofile 1 cmd. A work around for this is to disable any cameras when a player is to see rain. (Add an I/O trigger: OnTrigger camera_name SetOff) 
--tehwin 17:20, 6 March 2009 (PDT)
If you are too close to the top of the rain volume the rain will stop rendering even though you are still inside of it.
In Portal 2, if func_precipitation is used with portals, visual artifacts may occur. This is especially true if one or both open portals are visible onscreen. Performance will also take a fairly major hit.
Category: Developer Issues and Workarounds
Preparations for building content for Source with Max

In order to compile content for use in Source you should be using Max 7 or newer.
==A list of recommended tools==
*Studiocompiler
:This reduces the amount of time you spend compiling the SMDs to MDLs. It can convert TGAs to VTF as well.
*VTFEdit
:VTFEdit allows greater degree of control for importing TGAs and has more options than StudioCompiler's converter.
*Cannonfodder's 3DS tools
*Mangled Poly's 3DS tools
:Copy the plugins to your 3DS Max plugins directory.
*Game Level Builder (Downloads Section)
:Free plugin that adds several features for level creation into Max including a walls and floors creator. It also includes an "export to map" feature that can export a scenes contents into the .map format that is compatible with older (3.4) versions of the Hammer Editor.
== Units Setup ==
Begin by entering the Units Setup dialog.
Choose the display units you like to work with. I have chosen centimeters because it gives best compromise between accuracy and usability.
In the System Unit Setup, choose Inches.
Click OK and you're done.
Category:3DS_Max
PrimaryAttack()

This is a method to control the primary attack of bullet-based weapons. It exists in CBaseCombatWeapon::PrimaryAttack() form, but it is generally overloaded in specific methods. Half-Life 2 weapons that use PrimaryAttack():
*357 Magnum
*Alyxgun
*AR2 Machine Gun
*Pistol
*Shotgun
*SMG
Generally the method is concerned with checking ammo for the weapon, calling the FireBullets() method, playing the sound and adding the view kick.
----
== Functions ==
m_flNextPrimaryAttack = gpGlobals->curtime + 0.75; - (Example taken from weapon_357.cpp) Sets the time until next attack can be made to 3/4 of a second.
 Vector vecSrc		= pPlayer->Weapon_ShootPosition();
 Vector vecAiming	= pPlayer->GetAutoaimVector( AUTOAIM_SCALE_DEFAULT );
This sets the vectors that will be passed to FireBullets().
Category:Programming
Prime

==Introduction==
Prime is a FPS RPG Hybrid for the source engine and was under development at Nigredo Studios in Sydney, lead by Adam McKern, with an experienced team composing:
* Marcello D’Altilia (Lead Artist & Design Lead)
* Fei Zhao (Lead Modeller)
* Jun Lee (Lead Animator)
* Jesse James (Audio Design - Audio)
* Travis "garandhero" Christie (Level Design) - past history from Battle Grounds 2
==Planned Features==
* RPG Inventory System
* PC Bleeding
* Advanced AI
* Dynamic Environments
* Level design in the footsteps of Prime's sister project NightFall
==External links==
*Nigredo Studios Official Site
Primitive

==Primitive Types==
A primitive is by definition a very simple structure. Primitive, as it relates to the Valve Hammer Editor, refers to a brush-based object that conforms to a common shape. Primitives include arches, blocks, cylinders, spheres, spikes, tori and wedges. Some are made up of multiple brushes but are still considered primitive, as they are used commonly and are of a simple shape. Two examples of multiple-brush primitives are tori and arches.
===Simple===
====Block====
The block, a basic cube, is the most-used object when mapping in Hammer.
====Cylinder====
A cylindrical brush created with a specified number of sides.
====Sphere====
The sphere is a rather complicated piece of geometry, so it would be wise to be careful with the number of faces you give the sphere.
====Spike====
Like the cylinder, but all the top vertices come to 1 central point.
====Wedge====
The wedge is basically a triangular prism.
===Complex===
====Arch====
This creates a basic arch as defined by the Arch Tool. Multiple blocks slightly rotated will be created within 1 group.
====Torus====
The torus resembles an inner tube or a donut. This primitive can easily mass polygons, so keep the number of faces on this primitive low. Like the arch, it has a special Tool.
==See also==
* Basic Construction
* Hammer Block Tool
Category:GlossaryCategory:Level Design
Printing to Multiple Locations

==Overview==
When modding, the situation can frequently occur when you wish to display some text in the chat area, and also have it show in the console.
Previously, two calls to UTIL_ClientPrint or UTIL_ClientPrintAll would be required, as shown:
 UTIL_ClientPrintAll( HUD_PRINTTALK, "Message text" );
 UTIL_ClientPrintAll( HUD_PRINTCONSOLE, "Message text" );
While this works, sending the same text from the server to the client twice is a highly inefficient solution. This tutorial will show you how to add two new text 'destinations,' HUD_PRINTTALKCONSOLE, which will cause the text to be displayed in both the talk area and on the console, and HUD_PRINTCENTERCONSOLE, which will display text in the centre of the screen, and log it in the console. Both of these will result in the text only being sent across the network once.
==Procedure==
First, open shareddefs.h and find where the current text destinations are defined (around line 103):
 #define HUD_PRINTNOTIFY		1
 #define HUD_PRINTCONSOLE	2
 #define HUD_PRINTTALK		3
 #define HUD_PRINTCENTER		4
Under these, add your own:
 #define HUD_PRINTTALKCONSOLE 5
 #define HUD_PRINTCENTERCONSOLE 6
----
Next up is the MsgFunc_TextMsg function of hl2mp_hud_chat.cpp (ep1) or hud_basechat.cpp (ob):
To briefly summarise, this reads the message and its destination, and then does a switch, based upon the destination (msg_dest), which decides how to display it. We are going to cause it to loop over this switch statement twice if msg_dest has one of the "two destination" values.
Just before the loop, add two booleans, and the following checks (shown in bold):
 	if ( !cl_showtextmsg.GetInt() )
 		return;
 
 	bool looping = true, runAgain = false;
 	if ( msg_dest == HUD_PRINTTALKCONSOLE )
 	{
 		msg_dest = HUD_PRINTTALK;
 		runAgain = true;
 	}
 	else if ( msg_dest == HUD_PRINTCENTERCONSOLE )
 	{
 		msg_dest = HUD_PRINTCENTER;
 		runAgain = true;
 	}
 
 	int len;
 	switch ( msg_dest )
 	{
Now, surround the entire switch block in a while loop, and add a little bit on the end: (for neatness, I have increased the switch block's indentation)
 	while ( looping )
 	{
 		int len;
 		switch ( msg_dest )
 		{
 		case HUD_PRINTCENTER:
 			blah blah
 			break;
 
 		case HUD_PRINTNOTIFY:
 			blah blah
 			break;
 
 		case HUD_PRINTTALK:
 			blah blah
 			break;
 
 		case HUD_PRINTCONSOLE:
 			blah blah
 			break;
 		}
 
 		if ( runAgain )
 		{
 			runAgain = false;
 			msg_dest = HUD_PRINTCONSOLE;
 		}
 		else
 			looping = false;
 	}
==Conclusion==
That should do it. Now, to print a text block to both the chat area and the console, for all players, you need only:
 UTIL_ClientPrintAll( HUD_PRINTTALKCONSOLE, "Message text");
Its the same procedure for the centre of the screen and the console, only using HUD_PRINTCENTERCONSOLE.
Category:Programming
Category:Tutorials