Spawn stuff Button
Spawn stuff Button. (Simplifyed Reading)
Ok, lets say you want to build a little house made of barrels or whatever, BUT WAIT, not enough barrels in the map? well make them (on your new map).
This is a tutorial for how to spawn objects with a press of a button.
1. Make the shape of what you want to spawn with the block tool
(for this tutorial I will use a barrel.)
2. Right click on your thing and click tie to entity
3. Pick "func_physbox" and name it whatever you want (barrel)
You can put other stuff on it if you like.
4. Pick the entity thing on the sidebar above the block tool, make "env_entity_maker" and put it inside your object, just stick it in. Name it something (Barrel_maker) Then click the "Point Template to Spawn" below "pitch yaw row". Put in a name. (barrel_ temp)
5. Pick entity button again, make a "Point_template" also inside your object. Put in the name of your env_entity_maker's "Point template to spawn". (barrel_temp) Go down and pick "template 1". Type in the name of your "func_physbox" (barrel)
6. Now make a button, which is a little box with "func_button" tied to it, with tie to entity. Name your button if you want, It doesn't matter for this tutorial (barrel_button).
Click the "outputs" tab by "class info". Click add...
1) For "My output name" Pick onpress
2) For "Target entities named" type in the name of your "env_entity_maker" (barrel_maker)
3)For "Via this input" Pick forcespawn
Now go to Flags tab and check "use activates".
Now go in game and spawn the things like crazy if you want.
How this works:
1.Every time you press that button, the button sends a message to the "env_entity_maker" (barrel_maker)
2.Then the "env_entity_maker" reads your "Point_template to spawn" and sees, oh <name of point_template> (barrel_temp) and sends a message to your "Point_template"
3. Then you "Point_template" reads your "template 1" and it sees <name of object> (barrel) So it finds your object, and makes one.
And all that happens in like... 1 second or less.