Skip to content

Commit

Permalink
Add note about hashes (#481)
Browse files Browse the repository at this point in the history
* add note about hashes

* fix text
  • Loading branch information
AGulev authored Oct 11, 2024
1 parent f170fbd commit 63846bd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/en/manuals/script-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ Common use cases are to set the health or speed of a specific enemy AI, the tint

## Defining a script property

Script properties are added to a script component by defining them with the `go.property()` special function. The function has to be used at the top level---outside any callback-functions like `init()` and `update()`. The default value provided for the property governs the type of the property: number, boolean, hash, `msg.url`, `vmath.vector3`, `vmath.vector4`, `vmath.quaternion` and `resource` (see below).
Script properties are added to a script component by defining them with the `go.property()` special function. The function has to be used at the top level---outside any lifecycle functions like `init()` and `update()`. The default value provided for the property governs the type of the property: `number`, `boolean`, `hash`, `msg.url`, `vmath.vector3`, `vmath.vector4`, `vmath.quaternion` and `resource` (see below).

::: important
Note that the reversal of the hash value works only in the Debug build to facilitate debugging. In the Release build, the reversed string value does not exist, so using `tostring()` on a `hash` value to extract the string from it is meaningless.
:::


```lua
-- can.script
Expand Down

0 comments on commit 63846bd

Please sign in to comment.