Glass that starts out broken: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(added alternative method, minor change to original method to avoid potential confusion)
Line 1: Line 1:
[[Category:Level Design]] [[Category:Tutorials]]
This tutorial assumes you already know how to [[Creating Breakable Glass|create breakable glass]], if not then follow that tutorial first.
This tutorial assumes you already know how to [[Creating Breakable Glass|create breakable glass]], if not then follow that tutorial first.
*Open one of your maps or make a new one.
*Open one of your maps or make a new one.
Line 5: Line 4:
*Set up an [[env_explosion]] in the middle of the window, then change the options of the env_explosions as follows:
*Set up an [[env_explosion]] in the middle of the window, then change the options of the env_explosions as follows:
{{entity-kvalue-start|[[env_explosion]]}}
{{entity-kvalue-start|[[env_explosion]]}}
{{entity-kvalue|Name||..anything you want as long as you know what it is}}
{{entity-kvalue|Name|<name>|<name> is whatever name you wish to give to this entity}}
{{entity-kvalue|Magnitude|1|}}
{{entity-kvalue|Magnitude|1|}}
{{entity-kvalue-end}}
{{entity-kvalue-end}}
Line 22: Line 21:
*Change the entity outputs for the logic_auto as follows:
*Change the entity outputs for the logic_auto as follows:
{{entity-output-start}}
{{entity-output-start}}
{{entity-output|OnMapSpawn|env_explosion|Explode|||Yes|env_explosion is the name you typed for that entity}}
{{entity-output|OnMapSpawn|<name>|Explode|||Yes|<name> is the name you gave the entity in the third step above}}
{{entity-output|||||||}}
{{entity-output|||||||}}
{{entity-output-end}}
{{entity-output-end}}
Line 30: Line 29:
{{entity-flag-end}}
{{entity-flag-end}}
*Test your map! When it loads the env_explosion will break the glass leaving the jagged glass edges on the side of the frame.
*Test your map! When it loads the env_explosion will break the glass leaving the jagged glass edges on the side of the frame.
[[Image:Brokenglasstutorial0000.jpg|thumb|300px|right|Broken glass that breaks when the map starts]]
[[Image:Brokenglasstutorial0000.jpg|thumb|300px|right|Broken glass that breaks when the map starts]]<br style="clear:both">
 
===Alternative method===
 
*Name the func_breakable_surf you created in step 2 above.
*Don't create the env_explosion entity in step 3 above.
*Do create the logic_auto entity in step 5 above.
*Change the entity outputs for the logic_auto as follows:
{{entity-output-start}}
{{entity-output|OnMapSpawn|<name>|Shatter|0.5 0.5 128||Yes|<name> is the name you gave the func_breakable_surf entity}}
{{entity-output|||||||}}
{{entity-output-end}}
*Adjust the parameter above as desired. Changing the size of the third number (128) will change how much of the window is broken.
 
[[Category:Level Design]] [[Category:Tutorials]]

Revision as of 10:59, 13 March 2006

This tutorial assumes you already know how to create breakable glass, if not then follow that tutorial first.

  • Open one of your maps or make a new one.
  • Make a func_breakable_surf with a frame around it (as if you are making a normal breakable window).
  • Set up an env_explosion in the middle of the window, then change the options of the env_explosions as follows:
Class: env_explosion
Keyvalues Comments
Name <name> <name> is whatever name you wish to give to this entity
Magnitude 1
  • Then in the flags tab, change the flags as follows:
Flag
Checkbox-on.png No fireball
Checkbox-on.png No smoke
Checkbox-on.png No decal
Checkbox-on.png No sparks
Checkbox-on.png No sound
Checkbox-on.png No fireball smoke
Checkbox-on.png No particles
Checkbox-on.png No Dlights
  • Set up a logic_auto near the env_explosion (it doesn't matter where you put it, but I recommend that you put it in a convenient place)
  • Change the entity outputs for the logic_auto as follows:
My output Target entity Target input Parameter Delay Only once Comments
File:Entity-output-iconOnMapSpawn.png <name> Explode Yes <name> is the name you gave the entity in the third step above {{{8}}}
Entity-output-icon.png {{{8}}}
  • Then in the flags tab, change the flags as follows:
Flag
Checkbox-on.png Remove on fire
  • Test your map! When it loads the env_explosion will break the glass leaving the jagged glass edges on the side of the frame.
Broken glass that breaks when the map starts


Alternative method

  • Name the func_breakable_surf you created in step 2 above.
  • Don't create the env_explosion entity in step 3 above.
  • Do create the logic_auto entity in step 5 above.
  • Change the entity outputs for the logic_auto as follows:
My output Target entity Target input Parameter Delay Only once Comments
File:Entity-output-iconOnMapSpawn.png <name> Shatter 0.5 0.5 128 Yes <name> is the name you gave the func_breakable_surf entity {{{8}}}
Entity-output-icon.png {{{8}}}
  • Adjust the parameter above as desired. Changing the size of the third number (128) will change how much of the window is broken.