From 63846bd9f015feae51675a03efdb12df7a8a9998 Mon Sep 17 00:00:00 2001 From: Alexey Gulev Date: Fri, 11 Oct 2024 08:38:40 +0200 Subject: [PATCH] Add note about hashes (#481) * add note about hashes * fix text --- docs/en/manuals/script-properties.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/en/manuals/script-properties.md b/docs/en/manuals/script-properties.md index a3eedfb3..91fb0945 100644 --- a/docs/en/manuals/script-properties.md +++ b/docs/en/manuals/script-properties.md @@ -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