Cleanup is going to take awhile, so the site is back up but editing has been disabled.

Spawn Stuff

From HalfLife 2 Knowledge Base

Jump to: navigation, search

Contents


Spawn Objects

First make a simple room (912x912x320, walls 16).

Then create an entity to spawn, like a physics_cannister, and name it Canister_01, then change the world model to canister01a.mdl from props_c17 folder. Remember to check the Starts Asleep flag for the canister. That will prevent the canister from moving until it is touched by something.

Next we need the entity that will actually be doing the spawning, a point_template. Create one near Canister_01 and name it Spawn_01. In the Template 1 field of the point_template, enter the name of the entity that will be spawned, in this case the canister, so type Canister_01. So when the point_template is triggered with the "ForceSpawn" input, a new canister spawns with the same properties as the original.

image:Spawn_Stuff_01.JPG


Now the point_template needs to be triggered. One way to do this is with a trigger multiple. Name the trigger_multiple Spawn_Trigger_01 and set the delay to 4 seconds. Go to outputs, click add and select: OnTrigger, Spawn_01, ForceSpawn. Now the trigger will do a ForceSpawn every 4 seconds.

Env_Entity_Maker

The second method for spawning objects is to use a env_entity_maker entity. Create it near the canister and in the Point_template to Spawn field enter Spawn_01. Go into the flags and tick Enable AutoSpawn. Now whenever a player isn't looking and there is room, the entity will be spawned.

image:Spawn_Stuff_02.JPG Note: If Starts Asleep isn’t set the env_entity_maker will infinite spawn because there will always be room.

Moving Objects

Now how does one spawn something in something that is moving? Easy, just parent the physics_cannister you say? No can do, the physics_cannister doesn’t have a parent field! Even if it did, things wouldn’t turn out well...

To do this, instead create something moveable like a info_vehicle_jeep and an info_teleport_destination. Name the teleport destination Destination_01 then parent it to the jeep. Then create a small sealed section around an trigger_teleport like this:

image:Spawn_Stuff_03.JPG

Set the trigger_teleport to pushables and the remote destination as Destination_01. Then create a canister inside the trigger_teleport and name it Canister_02. Create a point_template, name it Spawn_02 and put Canister_02 in the Template 1 field.

Go to the jeeps output tab, and add a new output and select PressedAttack, Spawn_02, ForceSpawn. Now whenever a player uses his primary fire button to fire the jeep's weapon, a new canister will be spawned.


Downloads

dm_Spawnstuff.vmf

The original example vmf by TAz00 can be found here: http://taz00.ansiibomber.ch/HL2/Spawning/
Note: To make the trigger teleport spawn in the original map work, checkmark Pushables instead of Clients for the trigger_teleport, and uncheck Starts Asleep in the canister flags.

--Written by TAz00 01:00, 15 Nov 2004 (EST)
--Rewritten by SilverBlade 9:30, 29 Mar 2005

Personal tools