Skip to content

Commit 8258559

Browse files
Cube behavior patch (#176)
* Update constants.md Removed obsolete Cube Type, added Cube Shape and Cube Behavior. * Update vscript.json Some changes include Cube Shape/Behavior and some methods' descriptions * Formatting * Reverts an internal oopsie
1 parent 9b9e957 commit 8258559

2 files changed

Lines changed: 41 additions & 19 deletions

File tree

docs/vscript/other/constants.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,25 @@ Trace masks are used with the extended trace API to filter entities by category.
142142
| `NO_POWER` | 4 |
143143
| `STICK_POWER` | 5 |
144144

145-
## Cube Types
146-
147-
| Name | Value |
148-
| ------------------ | ----- |
149-
| `CUBE_STANDARD` | 0 |
150-
| `CUBE_COMPANION` | 1 |
151-
| `CUBE_REFLECTIVE` | 2 |
152-
| `CUBE_SPHERE` | 3 |
153-
| `CUBE_ANTIQUE` | 4 |
154-
| `CUBE_SCHRODINGER` | 5 |
145+
## Cube Shape
146+
147+
Cube shape is used by the Shape/Behavior system for weighted cubes. A cube's shape indicates which buttons it can press. Note that other values are permitted for custom cubes.
148+
149+
| Name | Value |
150+
| ---------------------- | ----- |
151+
| `CUBE_SHAPE_CUBIC` | 1 |
152+
| `CUBE_SHAPE_SPHERICAL` | 2 |
153+
154+
## Cube Behavior
155+
156+
Cube behavior is used by the Shape/Behavior system for weighted cubes. A cube's behavior indicates the functionality of the cube.
157+
158+
| Name | Value |
159+
| --------------------------- | ----- |
160+
| `CUBE_BEHAVIOR_REGULAR` | 1 |
161+
| `CUBE_BEHAVIOR_REFLECTIVE` | 2 |
162+
| `CUBE_BEHAVIOR_SCHRODINGER` | 3 |
163+
155164

156165
## Misc. Constants
157166

dumps/vscript.json

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
{"method": "Time", "signature": "float Time()", "doc": "Get the current server time" },
6666
{"method": "TraceHull", "signature": "handle TraceHull(Vector, Vector, Vector, Vector, int, handle, int)", "doc": "Sweeps a hull along the specified line. Returns a CGameTrace with the trace result" },
6767
{"method": "TraceLine", "signature": "float TraceLine(Vector, Vector, handle)", "doc": "given 2 points & ent to ignore, return fraction along line that hits world or models" },
68-
{"method": "TraceLineEx", "signature": "handle TraceLineEx(Vector, Vector, int, handle, int)", "doc": "Given 2 points, ent to ignore, collision group and trace mask, returns a CGameTrace with the result" },
68+
{"method": "TraceLineEx", "signature": "handle TraceLineEx(Vector, Vector, int, handle, int)", "doc": "Given 2 points, ent to ignore (or array of ents to ignore), collision group and trace mask, returns a CGameTrace with the result" },
6969
{"method": "TraceLinePlayersIncluded", "signature": "float TraceLinePlayersIncluded(Vector, Vector, handle)", "doc": "given 2 points & ent to ignore, return fraction along line that hits world, models, players or npcs" },
7070
{"method": "TracePortalLine", "signature": "handle TracePortalLine(Vector, Vector, int, handle, int, bool)", "doc": "Same as TraceLineEx, but will transform the trace based on any portals it passes through. If the last bool is true, it will transform based on the first portal it went though." },
7171
{"method": "TryDLC1InstalledOrCatch", "signature": "bool TryDLC1InstalledOrCatch()", "doc": "Tests if the DLC1 is installed for Try/Catch blocks." },
@@ -190,6 +190,15 @@
190190
"methods": [ { "method": "ScriptStorageMgr::CreateScope", "signature": "handle ScriptStorageMgr::CreateScope(string)", "doc": "Creates a new named storage scope" }
191191
]
192192
},
193+
{
194+
"class": "CPortal_Player",
195+
"extends": "CBaseMultiplayerPlayer",
196+
"methods": [ { "method": "CPortal_Player::GetWheatleyMonitorDestructionCount", "signature": "int CPortal_Player::GetWheatleyMonitorDestructionCount()", "doc": "Get number of wheatley monitors destroyed by the player." },
197+
{ "method": "CPortal_Player::IncWheatleyMonitorDestructionCount", "signature": "void CPortal_Player::IncWheatleyMonitorDestructionCount()", "doc": "Set number of wheatley monitors destroyed by the player." },
198+
{ "method": "CPortal_Player::TurnOffPotatos", "signature": "void CPortal_Player::TurnOffPotatos()", "doc": "Turns Off the Potatos material light" },
199+
{ "method": "CPortal_Player::TurnOnPotatos", "signature": "void CPortal_Player::TurnOnPotatos()", "doc": "Turns On the Potatos material light" }
200+
]
201+
},
193202
{
194203
"class": "CWeaponPaintGun",
195204
"extends": "CBaseCombatWeapon",
@@ -205,12 +214,11 @@
205214
]
206215
},
207216
{
208-
"class": "CPortal_Player",
209-
"extends": "CBaseMultiplayerPlayer",
210-
"methods": [ { "method": "CPortal_Player::GetWheatleyMonitorDestructionCount", "signature": "int CPortal_Player::GetWheatleyMonitorDestructionCount()", "doc": "Get number of wheatley monitors destroyed by the player." },
211-
{ "method": "CPortal_Player::IncWheatleyMonitorDestructionCount", "signature": "void CPortal_Player::IncWheatleyMonitorDestructionCount()", "doc": "Set number of wheatley monitors destroyed by the player." },
212-
{ "method": "CPortal_Player::TurnOffPotatos", "signature": "void CPortal_Player::TurnOffPotatos()", "doc": "Turns Off the Potatos material light" },
213-
{ "method": "CPortal_Player::TurnOnPotatos", "signature": "void CPortal_Player::TurnOnPotatos()", "doc": "Turns On the Potatos material light" }
217+
"class": "CPropPhysicsPaintable",
218+
"extends": "CBaseAnimating",
219+
"methods": [ { "method": "CPropPhysicsPaintable::GetPaint", "signature": "int CPropPhysicsPaintable::GetPaint()", "doc": "Get the current paint type applied to the prop. Returns a value from the *_POWER enum" },
220+
{ "method": "CPropPhysicsPaintable::GetPaintedSkin", "signature": "int CPropPhysicsPaintable::GetPaintedSkin()", "doc": "Get the skin used when the prop is painted." },
221+
{ "method": "CPropPhysicsPaintable::GetUnPaintedSkin", "signature": "int CPropPhysicsPaintable::GetUnPaintedSkin()", "doc": "Get the skin used when the prop is not painted." }
214222
]
215223
},
216224
{
@@ -375,8 +383,13 @@
375383
{
376384
"class": "CPropWeightedCube",
377385
"extends": "CBaseAnimating",
378-
"methods": [ { "method": "CPropWeightedCube::GetCubeType", "signature": "int CPropWeightedCube::GetCubeType()", "doc": "Get the type of the cube. Returns a value from the CUBE_* enum" },
379-
{ "method": "CPropWeightedCube::GetPartner", "signature": "handle CPropWeightedCube::GetPartner()", "doc": "Get the instance handle of the schrodinger's partner" }
386+
"methods": [ { "method": "CPropWeightedCube::GetCubeBehavior", "signature": "int CPropWeightedCube::GetCubeBehavior()", "doc": "Get the behavior type of the cube. Returns a value from the CUBE_BEHAVIOR_* enum" },
387+
{ "method": "CPropWeightedCube::GetCubeShape", "signature": "int CPropWeightedCube::GetCubeShape()", "doc": "Get the shape of the cube (IE what buttons it presses). This is a number which matches the CUBE_SHAPE_* enum, or other values if a custom shape was set." },
388+
{ "method": "CPropWeightedCube::GetLaser", "signature": "handle CPropWeightedCube::GetLaser()", "doc": "Get the instance handle of the invisible env_portal_laser outputting from this cube, or null if not emitting" },
389+
{ "method": "CPropWeightedCube::GetPaint", "signature": "int CPropWeightedCube::GetPaint()", "doc": "Get the current paint type applied to the cube. Returns a value from the *_POWER enum" },
390+
{ "method": "CPropWeightedCube::GetPartner", "signature": "handle CPropWeightedCube::GetPartner()", "doc": "Get the instance handle of the schrodinger's partner" },
391+
{ "method": "CPropWeightedCube::IsEmissionLocked", "signature": "bool CPropWeightedCube::IsEmissionLocked()", "doc": "Check whether the laser output is locked on" },
392+
{ "method": "CPropWeightedCube::IsPressingButton", "signature": "bool CPropWeightedCube::IsPressingButton()", "doc": "Check whether the cube is 'activated', pressing a button." }
380393
]
381394
},
382395
{

0 commit comments

Comments
 (0)