Source 2/Docs/Level Design/Mesh Entities: Difference between revisions
m (-autolang collapse) |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
{{Note|This article (and its subpages) was originally written for {{Dota2|4}}, but they also applies to all other {{src2|4}} games.}} | {{Note|This article (and its subpages) was originally written for {{Dota2|4}}, but they also applies to all other {{src2|4}} games.}} | ||
A mesh entity is a mesh that's been turned into an entity. These are commonly used to make things like trigger regions. | A [[mesh entity]] is a mesh that's been turned into an entity. These are commonly used to make things like trigger regions. | ||
== Mesh Entity Tutorial == | == Mesh Entity Tutorial == | ||
This tutorial assumes you've already created a map, if not, follow the [[Dota 2 Workshop Tools/Level Design/Tile Editor Basics|tile editor introduction]] to set up a map. | This tutorial assumes you've already created a map, if not, follow the [[Dota 2 Workshop Tools/Level Design/Tile Editor Basics|tile editor introduction]] to set up a map. | ||
To make a mesh entity, create a block using the ''Block Tool'' and then go to ''Tools > Tie To Entity'', or use {{Key|Ctrl}}+{{Key|T}}. This will convert the mesh into an entity. | To make a mesh entity, create a block using the ''Block Tool'' and then go to ''Tools > Tie To Entity'', or use {{Key|Ctrl}}+{{Key|T}}. This will convert the mesh into an entity. The default entity will be {{code|trigger_multiple}}. | ||
[[File:Mesh_entities_tie_to_entity.png|200px|thumb|center|After selecting a mesh, use Tie To Entity to make it an entity.]] | [[File:Mesh_entities_tie_to_entity.png|200px|thumb|center|After selecting a mesh, use Tie To Entity to make it an entity.]] | ||
Line 20: | Line 20: | ||
Since your mesh is a trigger, you should apply a trigger material to it, because you want the mesh to be invisible and not collide with anything. In the Active Material pane, click Browse and type "trigger" in the filter field at the top. The material you're looking for is called toolstrigger. Double-click to make it your active material, then apply it to your selected mesh with {{Key|Shift}}+{{Key|T}}. | Since your mesh is a trigger, you should apply a trigger material to it, because you want the mesh to be invisible and not collide with anything. In the Active Material pane, click Browse and type "trigger" in the filter field at the top. The material you're looking for is called {{code|[[Tool_textures_(Source_2)#toolsteleportclip|toolstrigger]]}}. Double-click to make it your active material, then apply it to your selected mesh with {{Key|Shift}}+{{Key|T}}.<!--workaround: page will lead to S2 tool texture then scroll down to toolsteleportclip instead of toolstrigger (which is near toolstrigger anyway) to avoid the table header covering up the toolstrigger info. --> | ||
Switch to Translate mode with {{Key|T}} and drag your {{Ent|trigger_shop}} mesh to the location that your player spawns in -- if you haven't manually added an {{Ent|info_playerstart_goodguys}} entity, the playerstart location will simply be the location of your ''basic_entities'' prefab (which contains playerstart entities for both the Radiant and Dire). Build your map with {{Key|F9}} and then run it in-game. When you select a hero and spawn in, you'll be in the radius of the invisible secret shop trigger you created. Pressing the shop key will allow you to buy secret shop items. | Switch to Translate mode with {{Key|T}} and drag your {{Ent|trigger_shop}} mesh to the location that your player spawns in -- if you haven't manually added an {{Ent|info_playerstart_goodguys}} entity, the playerstart location will simply be the location of your ''basic_entities'' prefab (which contains playerstart entities for both the Radiant and Dire). Build your map with {{Key|F9}} and then run it in-game. When you select a hero and spawn in, you'll be in the radius of the invisible secret shop trigger you created. Pressing the shop key will allow you to buy secret shop items. |
Latest revision as of 06:26, 16 February 2025



A mesh entity is a mesh that's been turned into an entity. These are commonly used to make things like trigger regions.
Mesh Entity Tutorial
This tutorial assumes you've already created a map, if not, follow the tile editor introduction to set up a map.
To make a mesh entity, create a block using the Block Tool and then go to Tools > Tie To Entity, or use Ctrl+T. This will convert the mesh into an entity. The default entity will be trigger_multiple.
With the new mesh entity selected, the Object Properties pane now shows an entity class has been assigned to it. It will default to whichever entity class is set to default in your options, but you can change the class type at any time.
Change it to a secret shop region. To this, change the entity class to trigger_shop and hit ↵ Enter to confirm the entity class change. Next scroll to the bottom of the entity's property fields and change its Shop Type to "Secret" using the drop-down menu.
Since your mesh is a trigger, you should apply a trigger material to it, because you want the mesh to be invisible and not collide with anything. In the Active Material pane, click Browse and type "trigger" in the filter field at the top. The material you're looking for is called toolstrigger. Double-click to make it your active material, then apply it to your selected mesh with ⇧ Shift+T.
Switch to Translate mode with T and drag your trigger_shop mesh to the location that your player spawns in -- if you haven't manually added an info_playerstart_goodguys entity, the playerstart location will simply be the location of your basic_entities prefab (which contains playerstart entities for both the Radiant and Dire). Build your map with F9 and then run it in-game. When you select a hero and spawn in, you'll be in the radius of the invisible secret shop trigger you created. Pressing the shop key will allow you to buy secret shop items.
