nyuuzyou/wikis huggingface dataset:
Creating a wake-up bed

== Introduction ==
Creating a wake-up bed is extremely easy. If you have decompiled the first level and analyzed it, you may have noticed a bunch of extra entities, which over complicate it.
===Models===
Create two prop_dynamic entities. One should be models\props\bed_body_reference.mdl and the other models\props\bed_cover_reference.mdl. Call the cover bed_cover. Disable shadows on both.
===Blackout===
Create another prop_dynamic. Call it blackout, with the model models\blackin.mdl. This model will provide the movement for the camera. Place the blackout model as shown. Disable shadows on the model.
===Start===
Put a info_player_start, so it shares the exact origin of the blackout model. Their origins are highlighted here. The player should form a right angle with the blackout model's origin. The position of this is very important so the transition is as smooth as possible.
===Camera===
Place a point_viewcontrol somewhere near the bed. Its position does not matter. Do not rotate the camera, leave it at the default rotation. Call it blackout_cam and set its parent to blackout. Have only these three flags checked: Freeze player, Infinite hold time, and Snap to goal angles.
===Other Entities===
Add a env_fade, set to fade from. Call it blackout_fadeAdd an ambient_generic, call it bed_cover_sound, set its sound origin to bed_cover, and set its sound to Doors.FullClose14.
===Logic===
Create a logic_auto with the following outputs:
	Output named	Target entities	Via this input 	Parameter 	Delay
	OnMapSpawn 	blackout_cam 	SetParentAttachment	vehicle_driver_eyes	0.00
	OnMapSpawn 	blackout_cam 	Enable 	 	0.00
	OnMapSpawn 	blackout_fade 	Fade 	 	0.00
	OnMapSpawn 	bed_cover 	SetAnimation 	opening 	5.00
	OnMapSpawn 	bed_cover 	SetDefaultAnimation	open 	5.00
	OnMapSpawn 	bed_cover_sound	PlaySound 	 	5.00
	OnMapSpawn 	blackout 	SetAnimation 	exit1 	5.00
Set these for the blackout model:
	Output named 	Target entities	Via this input 	Parameter	Delay
	OnAnimationDone	bed_cover 	SetAnimation 	closing 	0.00
	OnAnimationDone	bed_cover_sound	PlaySound 	 	0.00
	OnAnimationDone	blackout_cam 	Disable 	 	0.00
	OnAnimationDone	bed_cover 	SetDefaultAnimation	idle 	0.00
== Conclusion ==
This has the exact same function as the bed in the first chamber. It uses 1 sound entity (as the open and close sound are the exact same). It does not involve a teleporter, as it serves no logical purpose.
== See also ==
* Portal Level Creation
== External links ==
* Example map Example map using this tutorial. VMF included.
Category:Portal
Category:Level Design
Category:Tutorials
Category:Sbrown Tutorials
Creating a wall light

Category:Portal Category:Level Design Category:Tutorials
In this tutorial you'll learn how to make a wall light that is seen in the test chambers.
== Steps ==
=== Step 1 ===
Create a room for the light to be in. For the sake of this tutorial, we will use a 384×384×256 room with walls 16 units thick. Ensure the roof is touching the walls only by its edges.
=== Step 2 ===
Texture the edges of the roof with the same texture you used for your roof.
=== Step 3 ===
Shrink the roof by 4 on each end. In this case, from 384×384 to 376×376.
=== Step 4 ===
Create a 4×16 block with the invisible texture and put it right beside your newly shrunk roof. They should fit so there are no leaks.
=== Step 5 ===
Copy the invisible blocks and re-texture them with Nodraw. Move them higher above the invisible blocks so you can easily perform step 6.
=== Step 6 ===
Texture the bottom of the 4×16 Nodraw blocks with light_recessedcool002. Rotate the recessed texture with the face edit tool so it is parallel with the block, with the lighter side of the gradient facing the inside of the room.
=== Step 7 ===
Move the Nodraw blocks to sit on top of the invisible blocks.
=== Step 8 ===
Select all the top walls and pull them up so they enclose the invisible blocks.
=== Step 9 ===
Add an overlay with the texture decals/overlay_light_gradient, and change the VStart/VEnd to .99 instead of 1.
=== Step 10 ===
Resize to fit, and move inside of the hole.
=== Step 11 ===
Repeat for every wall.
=== Step 12 ===
Compile your map and ensure there are no leaks.
== See also ==
* Portal Level Creation
Creating a working Crane in Half-Life 2

Creating a working crane as seen in Half Life 2.
==Overview==
In the chapter Highway 17, the player has to use a crane to knock down a bridge and move their car to continue. Other metal objects like cargo containers and barrels can also be picked up with the magnet and moved. The crane is simple, but for begining mappers, making one can be a challenge. We will be using the entities prop_vehicle_crane and a phys_magnet.
==Tutorial==
Before we build a crane, build a map. Keep in mind that if the crane is the highest point, you will need to give the crane about 100 units of extra room, and give plenty of room around the crane so the player can use it. 
Once that is done, add in a prop_static and set the world model to models/crane/crane_frame.mdl, then add another prop_static and set the world model to models/crane/crane_frame_interior.mdl and put that inside the frame. Next, create a prop_vehicle_crane and set the world model to models/crane/crane_docks.mdl, name it crane1, and set that on the frame. 
Now, create a phys_magnet, set its name to magnet1, set the world model to models/props_wasteland/cranemagnet01a.mdl, set its mass scale to 500 (This stops it from swinging wildly in the air. Change it higher to lower its swing more,) and finally, position it under the crane's boom arm near the tip. 
If you're wondering, the lines will automatically be set up and the magnet will be put in the default position when the map loads. Finally, open up the properties for crane1 and set magnet entity to magnet 1.
==Finishing Up==
To finish up the crane, add a platform on the frame so the player can walk to the controls. Don't forget to put a ladder so the player can get up. You don't have to use the crane frame, and you can mount it onto any brush or prop. So be creative. Add a few crates, maybe a jeep, and you are done!
==See also==
* prop_vehicle_crane
* phys_magnet
* npc_cranedriver For AI driven cranes
Category:Tutorials
Creating an Effectscript model

An effectscript model is a model with attachment animation sequence events. With an effectscript file, it'll create sprite animation effects in game. Examples are models\effects\teleporttrail.mdl and models\effects\teleporttrail_Alyx.mdl, utilized during the teleport scene in the chapter 'Red Letter Day' of Half-Life 2.
You can place one in your map with the env_effectscript entity.
The default effectscript model consists of a single cube textured with materials/models/effects/base.vmt (this is maybe because if there is no mesh, .SMD wont't be exported), several bones(one root parent, others are child bones of the root), and attachments corresponding to child bones. It also has a sequence that animates bones and attachments. Check Attachments and Bones in HLMV.exe render tab to preview it.
==Authoring effectscript models==
===3D Package===
*Make an animating model.
**Place some nulls. Name one null "root", and make this one the parent of the other nulls.
**Name the other nulls like "test1", "test2", etc. You'll make attachments to these bones in .qc file. 
**Make keyframe animations with the child nulls. (Use the translate tool)
**Add a small cube, with the base.tga texture (only the name matters; you don't have to extract the original one).
*Export it as reference and animation .smd files. Make sure to uncheck "Remove all unused bones" when you are using XSI's SMD exporter.
===Setting up the .qc===
*In .qc, make attachments to child bones, and add a sequence with AE_START_SCRIPTED_EFFECT and AE_STOP_SCRIPTED_EFFECT events.
Here is a sample .qc:
$modelname "effects/testtrail.mdl"
$model "Body" "test_ref.smd"
$cdmaterials "models/effects/"
$hboxset "default"
$hbox 0 "root" -1.000 -1.000 -1.000 1.000 1.000 1.000
// Model uses material "base.vmt"
$attachment "MyParticle1" "test1" 0.00 0.00 0.00 rotate 0.00 0.00 0.00
$surfaceprop "metalpanel"
$sequence idle "test_ref" fps 30.00
$sequence spiral "test_anim" fps 30.00 {
 { event AE_START_SCRIPTED_EFFECT 1 "mytest_sprite" } //specify the effect name and its start frame 
 { event AE_STOP_SCRIPTED_EFFECT 99 "mytest_sprite" } //specify the effect name and its end frame.
}
===effectscript file===
*Write an effect script file. Valve puts their effect script file in hl2\scripts\effects\testeffect.txt, but you can put your file anywhere under the game directory. You can specify the script file location in env_effectscript entity.
sample "mytesteffect.txt":
effect "mytest_sprite" //effect name
{
	type "sprite" //the other option is "trail" 
	material "sprites/glow01.vmt"
	attachment "MyParticle1" //point to the attachment in your effectscript model
	color "255 50 240 128"
	scale 1
	fadetime 3
	stopfollowonkill 1
}
===Hammer===
*In Hammer, place env_effectscript. Specify your model and scriptfile there.
*Effect starts when the env_effectscript receives SetSequence input.
Category:Modeling
Creating an HL2DM megacharger

__NOTOC__
==Introduction==
This guide will show you how to create megachargers seen in dm_lockdown. This is a good way to make megachargers distinct from normal chargers in your deathmatch map.
==Creation==
===The Charger===
Create an item_suitcharger entity, set its name to megacharger and tick the Citadel recharger flag.
Enter the following outputs:
	OnEmpty	megacharger_light 	HideSprite	<none>	0.00	No
	OnEmpty	megacharger_light_	TurnOff 	<none>	0.00	No
	OnFull 	megacharger_light 	ShowSprite	<none>	0.00	No
	OnFull 	megacharger_light_	TurnOn 	<none>	0.00	No
===Charger Model===
Create prop_dynamic entity and enter the following properties:
Property Name 	Value
World Model 	models/props_combine/Combine_Dispenser.mdl
Disable Shadows	Yes
Collisions 	Not Solid
Position the model so it covers the suitcharger's model.
===Charger Glow===
Create an env_sprite entity and enter the following properties:
Property Name 	Value
Name 	megacharger_light
Render FX 	Slow Pulse
Render Mode 	World Space Glow
FX Color 	0 255 0
Scale 	0.25
Size of Glow Proxy Geometry.	5
===Charger Light===
Create a light entity and enter the following properties:
Property Name 	Value
Name 	megacharger_light_
Pitch Yaw Roll	-60 0 -90
Brightness 	0 255 64 25
Inner angle 	5
Outer angle 	30
Pitch 	-60
Category:HL2DM level design
Category:Half-Life 2: Deathmatch
Category:Level Design
Category:Tutorials
Creating an NPC

In this tutorial we're going to create an functional NPC.
() 
== Defining the NPC ==
To begin the creation of your NPC you must first create a definition for it. The first step is to copy Npc_New.cpp to a new file. Next, make changes to the Precache, Spawn, and Classify functions.
== Giving an NPC Memory ==
== Creating a Condition ==
Conditions show what is going on to the NPC. Are they drowning? Are they blocked? Are they on fire? Conditions tell the NPC to act accordingly to what is happening.
First, create a name for the condition you're making, and add it to the Enum. Once you have added the condition to the Enum, use the DECLARE_CONDITION macro in the AI_BEGIN_CUSTOM_NPC section.
== Creating a Task ==
To start creating your custom task declare a new Enum.
== Creating an Activity ==
== Creating an Animevent ==
== Creating a Squadslot ==
== Creating an Interaction ==
== Creating a Schedule==
== NPC Relationship Table==
Dont Forget to add your NPC in the relationship table
Category:AI Programming
Category:Stubs
Creating an Observation Hallway

This is a tutorial for Portal.
== Introduction ==
Making bts (behind the scenes) style observation halls is a simple job. It takes little time, especially with prefabricated items.
Due to the highly detailed nature of observation rooms, this tutorial will be provided in images. Reading order is left to right, then down.
== Tutorial ==
===Base Layout===
Image:Halltut.jpg|Create the floor for your hallway. Create minimal paths to cause less confusion. Hallways are generally 128 units wide.
Image:Halltut_(1).jpg|Add the walls (128 units tall)
Image:Halltut_(2).jpg|Texture the floor and walls, then copy the walls, resize to 64 and re texture (floor texture: tile/observation_tilefloor001a. wall textures: concrete/observationwall_001a for the wall that matches with the ceiling, concrete/observationwall_001b for the wall that matches with the floor. Typing only "observation" will show a more general list of observation hallways skins.)
Image:Halltut_(3).jpg|Add the roof (texture: plastic/plasticwall002a)
===Light Sources===
Image:Halltut_(4).jpg|Add the light bars around the perimeter. These are 4 units thick. (white009)
Image:Halltut_(5).jpg|Create the base for the light. 160x120x16. Cut two wedges on the ends.
Image:Halltut_(6).jpg|Make a hole in the center, 96x96 units.
Image:Halltut_(7).jpg|Create an arch as shown.
Image:Halltut_(8).jpg|Select the whole arch, and clip it square. Make it a func_detail.
Image:Halltut_(9).jpg|Seal the func_detail.
Image:Halltut_(10).jpg|Texture the light. Make the inside light, white009 with a scale of 50. The outside part of the light should have the same texture of your ceiling.
Image:Halltut_(11).jpg|Add a light_spot and a point_spotlight. Set the light_spot brightness value to 183 204 218 600. Set the point_spotlight color value to 183 204 218.
Image:Halltut_(12).jpg|Group the light and place in multiple locations.
Image:Halltut_(13).jpg|Cut away the roof where the light goes.
===Detailing===
Image:Halltut_(16).jpg|Add doors. 
Image:Halltut_(18).jpg|Create the detailed fuse sets.
===Final Steps===
Image:Halltut_(21).jpg|Final result. (Use expert compile for proper shadows)
Category:Portal
Category:Level Design
Category:Tutorials
Creating an activity

==Declaration==
The first step to creating an activity for your NPC is to create a name for it and add it to the enum. Here's an example name for an activity: ACT_COMBINE_BUGBAIT.
Once the activity is added, you must use the DECLARE_ACTIVITY macro in the AI_BEGIN_CUSTOM_NPC section.
Here's an example of the DECLARE_ACTIVITY code:
	DECLARE_ACTIVITY( ACT_NEWNPC_ACTIVITY )
==Implementation==
Activities are used in schedules and utilize one of these 2 tasks:
* TASK_PLAY_SEQUENCE
* TASK_SET_ACTIVITY
===Examples===
 	DEFINE_SCHEDULE
 	(
 		SCHED_COMBINE_BUGBAIT_DISTRACTION,
 
 		"	Tasks"
 		"		TASK_STOP_MOVING		0"
 		"		TASK_RESET_ACTIVITY		0"
 		"		TASK_PLAY_SEQUENCE		ACTIVITY:ACT_COMBINE_BUGBAIT"
 		""
 		"	Interrupts"
 		""
 	)
 	DEFINE_SCHEDULE
 	(
 		SCHED_COMBINE_BURNING_STAND,
 
 		"	Tasks"
 		"		TASK_WAIT_RANDOM		0.3"
 		"		TASK_SET_ACTIVITY		ACTIVITY:ACT_COMBINE_BUGBAIT"
 		"		TASK_WAIT			2"
 		"		TASK_WAIT_RANDOM		3"
 		"		TASK_COMBINE_DIE_INSTANTLY	DMG_BURN"
 		"		TASK_WAIT			1.0"
 		""
 		"	Interrupts"
 		""
 	)
===TASK_PLAY_SEQUENCE===
This task does not reset the activity, but it does factor in AutoMovement capabilities.
===TASK_SET_ACTIVITY===
This task resets the activity, but it does not factor in AutoMovement capabilities.
Category:AI Programming
Creating an animated Goldsrc Menu

=Creating an animated title manually=
In , the logo images are split into TGA tiles. 
== Creating the tiles ==
Since the 25th Aniversary Update, the engine uses TGA files to generate an animated title if liblist.gam has . The tile files are located under .
=== Specifications ===
==== Logo ====
* Dimensions: 800x86px
* Origin: Bottom-left
* RTE Compression: Supported for 24-bit images.
==== Large Blurred Logo ====
* Dimensions: 1800x270px
* Origin: Bottom-left
* RTE Compression: Supported for 24-bit images.
== Creating the tiles ==
The following files are required to have an animated title:
* logo.tga
* logo_blip.tga
* logo_blip2.tga
* logo_big_blurred_0.tga
* logo_big_blurred_1.tga
* logo_big_blurred_2.tga
* logo_big_blurred_3.tga
* logo_big_blurred_blip_0.tga
* logo_big_blurred_blip_1.tga
* logo_big_blurred_blip_2.tga
* logo_big_blurred_blip_3.tga
= Utilities =
;
:Creating an animated title for a mod requires creating the logo image, blurring it, and spliting the image into multiple TGAs. This process is streamlined in using an intuitive interface, that creates all the required files based on the title you choose. See more.Category:GoldSrc_ModdingCategory:GoldSrc
Creating an animevent

==Declaration==
Animevents are useful for adding mid-animation functionality.
The first step to creating an animevent for your NPC is to create a name for it and add it to "Private animevents" section. Here's an example name for an animevent: COMBINE_AE_ALTFIRE.
Once the activity is added to the enum, you must use the DECLARE_ANIMEVENT macro in the AI_BEGIN_CUSTOM_NPC section.
Here's an example of the DECLARE_ANIMEVENT code:
	DECLARE_ANIMEVENT( NEWNPC_AE_ANIMEVENT )
==Implementation==
All event code is handled in void CNPC_New::HandleAnimEvent( animevent_t *pEvent ). If pEvent doesn't contain anything that needs to be caught and dealt with, BaseClass::HandleAnimEvent should be called.
Category:AI Programming
Creating an interaction

Interactions are messages that are transmitted between NPCs, such as allowing one NPC to dodge an attack, or to fly in a specific direction and set a certain state when kicked.
== Declaration ==
The first step to creating an interaction for your NPC is to create a name for it and add it to the "Interactions" section as well as adding it to src\dlls\hl2_dll\AI_Interactions.h. Here's an example name for an activity: g_interactionVortigauntKick.
Once the activity is added, you must use the DECLARE_INTERACTION macro in the AI_BEGIN_CUSTOM_NPC section.
Here's an example of the DECLARE_INTERACTION code:
DECLARE_INTERACTION( g_interactionExample )
== Implementation ==
Category:AI Programming
Creating custom gibs

Category:Modeling
By default, a model whose propdata allows it to break when its health reaches zero, will spawn a bunch of generic gibs according to its base_type material. Whilst this saves a bit of work, it not nearly as satisfying as using a set of custom gibs that actually look like parts of your breakable model.
==Modeling==
* Use the original model as a reference, and place gibs over it.
* Export each gib separately
==Compiling==
===Each gib===
 $scale 1.0
 $modelname trashcan\trashcan_piece_a.mdl
 $keyvalues { "prop_data" { "base" "Wooden.Small" "health" "0" } }
 //Health 0 makes it invulnerable. Not having this or setting it to another value allows the gib to be busted into more gibs. Small wood bits, in this case. 
 $body studio "trashcan_piece_a"
 $cdmaterials models\trashcan
 $staticprop
 $surfaceprop "wood"
 //Important! Make sure the $surfaceprop type matches the "base" in $keyvalues, or you get nothing.
 $sequence idle "trashcan_piece_a" loop fps 15
 $origin -24.043 -24.066 2.166 0
 // values are X Y Z rotationZ, without they will spawn in one large heap if their origins are the same. If the objects are exported at non-origin values they would spawn there, unless this is called.
 $collisionmodel "trashcan_piece_a_collision.SMD"
 {
 $automass
 }
===Breakable model===
* Add $collisiontext section to the .QC file
 $scale 1.0
 $modelname trashcan\trashcan_breakable.mdl
 $body "Body" "trashcan.smd"
 $cdmaterials models\trashcan
 $surfaceprop "wood"
 //Important! Make sure the $surfaceprop type matches the "base" in $keyvalues, or you get nothing.
 $sequence idle "trashcan" loop fps 15
 $keyvalues { "prop_data" { "base" "Wooden.Medium" "health" "10"} }
 //Health is the damage required to break the item, 0 will make it invincible.
 $collisiontext
 {
 break
 {
 "model" "trashcan/trashcan_piece_a.mdl" "fadetime" "15"
 }
 break
 {
 "model" "trashcan/trashcan_piece_b.mdl" "fadetime" "15"
 }
 }
 $collisionmodel "trashcan_collision.SMD" {
 $concave
 $mass 100.000
 }
* break options
**model
**ragdoll
**offset
**health
**fadetime
**fademindist
**fademaxdist
**debris
**burst
**placementbone
**placementattachment
**motiondisabled (new with l4d2?)
-used to spawn the non-moving chips of glass around the edges of the window panes in dead-center's hotel after they were broken
*break { "model" "props_windows\hotel_glass_frame002.mdl" "health" "0" "fadetime" "0" "motiondisabled" "1" "multiplayer_break" "both"}
==See also==
*Physics and Ragdolls
*Physics Entities on Server & Client
*Modeling props with Blender
Creating multiple buttons for one door

This tutorial will detail the basics of getting a door to open only when two (or more) buttons are activated.
==Door, buttons and triggers==
Create your doorway and two buttons by following the tutorials Floor button and Test Chamber Door.
==Setting the buttons to open the door==
Create a math_counter entity, and put it near your door. Set the following properties:
::
Property Name 	Value
Name 	door_counter
Maximum Legal Value	2
For the Maximum Legal Value key value, you can enter whatever number you need.
Now go to the Outputs tab and set the following outputs:
::
	My Output	Target Entity	Target Input	Parameter	Delay	Only Once
	OnHitMax 	door_left 	Open 	<none> 	0.00 	No
	OnHitMax 	door_right 	Open 	<none> 	0.00 	No
Now go to each of your floor_button_door brush entities and set these outputs:
::
	My Output	Target Entity	Target Input	Parameter	Delay	Only Once
	OnOpen 	door_counter 	Add 	1 	0.00 	No
	OnClose 	door_counter 	Subtract 	1 	0.00 	No
	OnClose 	door_left 	Close 	<none> 	0.00 	No
	OnClose 	door_right 	Close 	<none> 	0.00 	No
==See also==
* Portal Level Creation
Category:Portal
Category:Level Design
Category:Tutorials
Creating poison water

This is a tutorial for creating the Hazard Liquid seen in Portal.
==Summary==
# Create a non-entity brush with nodraw on five sides and nature/hazardliquid on the top
# Add info_particle_systems to create gaseous effect
# Use trigger_hurt to damage player if he/she touches water
== Construction ==
To add a water volume to your level, follow these steps:
# Create a brush the size of the water volume using the Block Tool.
# Open the Texture Browser by clicking the Browse button on the Texture Bar.
# Find and select the tools/toolsnodraw material in the Texture Browser.
# With your water brush selected, click the Apply Current Texture button to assign the tools/toolsnodraw material to the whole brush.
# Select the Texture Application tool, which opens the Face Edit mode.
# Left-Click the top face of the water brush in the 3D view to select it.
# Click Browse to bring up the Texture Browser again.
# Select nature/hazard_liquid. 
# Click the Apply button on the Face Edit panel.
Now you will need to add the gas particle effect that floats above the surface of the water.
#Select the Entity Tool.
#In the Entities selection box, make sure the Category is set to Entities and choose the Object info_particle_system.
#In the 3D view, click on the center of the top of your water brush to place the info_particle_system entity there. 
#Go into the Properties window for the particle system by selecting it and pressing Alt-Enter.
#Set the Particle System Name parameter to one of these:
* water_mist_1024_512
This particle covers up 1024*512 units in it's area.
* water_mist_256
This particle covers up 256 units in it's area.
* water_mist_384_128
This particle covers up 384*128 units in it's area.
* water_mist_512
This particle covers up 512 units in it's area.
* water_mist_128
This particle covers up 128 units in it's area.
==Making the water deadly==
You will need to add a trigger_hurt to make the water hurt the player. This is a simple process
#Open the Texture Browser and select the tools\toolstrigger texture.
#Create a new brush that fills approximately the same space as the water brush (you might want to extend or retract the edges slightly so it is easier to distinguish from the water brush) 
#Right-click the new brush and choose "Tie To Entity". Select trigger_hurt.
#Open the trigger_hurt's Properties window with Alt-Enter
#Set up the properties using these values:
::
Property Name 	Value
Damage 	100
Damage Type 	CHEMICAL
Damage Model 	Normal
Zero Damage Force	YES
That's it! You now have a body of Hazard Liquid that emits a gas effect and will kill the player on contact. Don't forget to add water_lod_control entity!
==See also==
* Portal Level Creation
* Water
* info_particle_system
* trigger_hurt
== External links ==
* Example map Example map using this tutorial. VMF included.
Category:Portal
Category:Level Design
Category:Tutorials