Counter-Strike 2 Workshop Tools/BreakableWindows: Difference between revisions
Jump to navigation
Jump to search
Note:This tutorial assumes a basic familiarity with ModelDoc Editor.
Bug:func_breakable does not spawn gibs on break in
Counter-Strike 2. It's recommended to use prop_dynamic instead [todo tested in ?]
Important:Glass material should have dynamic expressions configured, otherwise there would be no break pieces.
Tip:it is not needed to have custom model file since primitive shapes are created inside of ModelDoc
Important:Model should be facing forward in X+ direction.
No edit summary |
No edit summary |
||
Line 23: | Line 23: | ||
#add '''Mesh Operation Stack''' node as parent of '''RenderMeshFile''' | #add '''Mesh Operation Stack''' node as parent of '''RenderMeshFile''' | ||
#add [[Box Primitive]] as child of [[Mesh Operation Stack]] , set desired `Box dimensions` (x-thickness,y-width,z-height), but keep `Position` at [0,0,0], for this example, use {{path|workshop/content_examples/breakable_glass/breakable_glass_01|vmat}} material | #add [[Box Primitive]] as child of [[Mesh Operation Stack]] , set desired `Box dimensions` (x-thickness,y-width,z-height), but keep `Position` at [0,0,0], for this example, use {{path|workshop/content_examples/breakable_glass/breakable_glass_01|vmat}} material | ||
{{important| | {{important|Model should be facing forward in {{code|X+}} direction.}} | ||
#add [[UV map planar custom]] stretch it so only single part of window texture fills model (you need to unselect this node and compile to preview how uv will look) | #add [[UV map planar custom]] stretch it so only single part of window texture fills model (you need to unselect this node and compile to preview how uv will look) | ||
Revision as of 09:38, 3 October 2024




example model can be found in Counter-Strike Global Offensive\content\csgo\workshop\content_examples\breakable_glass\breakable_glass_01.vmdl
Making base window model

Adding a root node
- add RenderMeshFile to model, cancel the file selection and press Keep on popup , It should appear as empty node, change RenderMeshFile Name to something like "window". This would be used as root node to add modifiers as child later. It should have the following parameters in inspector:
RenderMeshFile
- Name (name) <string>
- Name of the node = "window"
- Source file (filename) <string>
- Model to render = <empty>
Adding box primitive
- add Mesh Operation Stack node as parent of RenderMeshFile
- add Box Primitive as child of Mesh Operation Stack , set desired `Box dimensions` (x-thickness,y-width,z-height), but keep `Position` at [0,0,0], for this example, use
workshop/content_examples/breakable_glass/breakable_glass_01.vmat
material

- add UV map planar custom stretch it so only single part of window texture fills model (you need to unselect this node and compile to preview how uv will look)
Adding physic properties
- add PhysicsHullFromRender with following properties:
- Surface Property (surface_prop) <string>
- Surface Property = "glass"
- Collision Property (collision_prop) <list>
- Collision Property = window
- add prop_data with following properties:
- Base Prop: Glass.Window
- Allow as static prop: true
- Health: 1
Adding Break pieces to model
todo