diff --git a/docs/entities/guides/meta.json b/docs/entities/guides/meta.json new file mode 100644 index 00000000..7d6aa7ac --- /dev/null +++ b/docs/entities/guides/meta.json @@ -0,0 +1 @@ +{ "title": "Guides" } diff --git a/docs/entities/guides/portal-floor-button-triggers.md b/docs/entities/guides/portal-floor-button-triggers.md new file mode 100644 index 00000000..f2b13fe4 --- /dev/null +++ b/docs/entities/guides/portal-floor-button-triggers.md @@ -0,0 +1,36 @@ +--- +title: Portal Floor Button Triggers +weight: 5 +features: + - MOD_PORTAL2 +--- + +# Portal Floor Button Triggers + +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. +Each entity uses a different bounding size to match the default model, but custom models may need their own size. +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: + +```php +$hboxset "default" +$hbox 0 "portal_button_root" -62.46 -7.36 -62.46 62.46 13.64 62.46 +$hbox 0 "portal_button_top" -31.81 -4.91 -31.81 31.80 0.00 31.77 + +$hboxset "trigger" +$hbox 0 "portal_button_root" -20 -20 0 20 20 14 +``` + +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. + +The trigger is always created with the same orientation as the button entity, so +the specific bone does not matter. + +## Default sizes +For reference, the default sizes are as follows. All are square, and start at z=0: + +| Classname | Half-Size | Height | +| ------------------------- | -- | ---| +| `prop_floor_button` | 20 | 14 | +| `prop_floor_cube_button` | 20 | 14 | +| `prop_floor_ball_button` | 5 | 14 | +| `prop_under_floor_button` | 30 | 17 | diff --git a/docs/entities/meta.json b/docs/entities/meta.json index 2685f91e..3ee09908 100644 --- a/docs/entities/meta.json +++ b/docs/entities/meta.json @@ -1 +1 @@ -{ "title": "Entities" } +{ "title": "Entities", "weight": 100 }