Skip to content

Commit f77c3fe

Browse files
authored
prop_floor_button trigger customisation (#154)
* Document how to change prop_floor_button trigger sizes * Remove comments
1 parent f5a32a7 commit f77c3fe

3 files changed

Lines changed: 38 additions & 1 deletion

File tree

docs/entities/guides/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "title": "Guides" }
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: Portal Floor Button Triggers
3+
weight: 5
4+
features:
5+
- MOD_PORTAL2
6+
---
7+
8+
# Portal Floor Button Triggers
9+
10+
The entities [`prop_floor_button`](../reference/prop_floor_button), [`prop_floor_cube_button`](../reference/prop_floor_button), [`prop_floor_ball_button`](../reference/prop_floor_ball_button) and [`prop_under_floor_button`](../reference/prop_under_floor_button) spawn a trigger volume to detect players and cubes.
11+
Each entity uses a different bounding size to match the default model, but custom models may need their own size.
12+
To allow this, these entities look for a hitbox group named `trigger`, and match the size of this. For example, this is the equivalent QC section for a standard modern button:
13+
14+
```php
15+
$hboxset "default"
16+
$hbox 0 "portal_button_root" -62.46 -7.36 -62.46 62.46 13.64 62.46
17+
$hbox 0 "portal_button_top" -31.81 -4.91 -31.81 31.80 0.00 31.77
18+
19+
$hboxset "trigger"
20+
$hbox 0 "portal_button_root" -20 -20 0 20 20 14
21+
```
22+
23+
The first hitbox set here is used for bullet collisions and other normal purposes. This is normally autogenerated. To get the first set, open your model in HLMV, uncheck "Autogenerate Hitboxes" on the lower-left of the "Bones" tab, then press "Generate QC" in the upper-right. You can also create/edit the trigger hitboxes here, especially handy for fine-tuning positioning.
24+
25+
The trigger is always created with the same orientation as the button entity, so
26+
the specific bone does not matter.
27+
28+
## Default sizes
29+
For reference, the default sizes are as follows. All are square, and start at z=0:
30+
31+
| Classname | Half-Size | Height |
32+
| ------------------------- | -- | ---|
33+
| `prop_floor_button` | 20 | 14 |
34+
| `prop_floor_cube_button` | 20 | 14 |
35+
| `prop_floor_ball_button` | 5 | 14 |
36+
| `prop_under_floor_button` | 30 | 17 |

docs/entities/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "title": "Entities" }
1+
{ "title": "Entities", "weight": 100 }

0 commit comments

Comments
 (0)