You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/manuals/addressing.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,7 @@ Relative addressing works by automatically prepending the current naming context
111
111
112
112
### Shorthands
113
113
114
-
Defold provides two handy shorthands that you can use to send message without specifying a complete URL:
114
+
Defold provides two handy shorthands that you can use to send messages without specifying a complete URL:
115
115
116
116
:[Shorthands](../shared/url-shorthands.md)
117
117
@@ -155,7 +155,7 @@ The absolute address of the manager script is `"/manager#controller"` and this a
155
155
156
156
## Hashed identifiers
157
157
158
-
The engine stores all identifiers as hashed values. All functions that take as argument a component or a game object accepts a string, hash or an URL object. We have seen how to use strings for addressing above.
158
+
The engine stores all identifiers as hashed values. All functions that take as argument a component or a game object accepts a string, hash or a URL object. We have seen how to use strings for addressing above.
159
159
160
160
When you get the identifier of a game object, the engine will always return an absolute path identifier that is hashed:
The content of this example lives in two separate files. There is one file for the main bootstrap collection and one for the collection with the id "level". However, file names _do not matter_ in Defold. The identity you assign instances does.
23
+
The content of this example lives in two separate files. There is one file for the main bootstrap collection and one for the collection with the id "level". However, file names _do not matter_ in Defold. The identity you assign to instances does.
24
24
:::
25
25
26
26
The game contains a few simple mechanics that require communication between the objects:
@@ -110,7 +110,7 @@ The game contains a few simple mechanics that require communication between the
110
110
111
111
## Sending messages
112
112
113
-
The mechanics of sending a message is, as we have seen above, very simple. You call the function `msg.post()` which posts your message to the message queue. Then, each frame, the engine runs through the queue and delivers each message to its target address. For some system messages (like `"enable"`, `"disable"`, `"set_parent"` etc) the engine code handles the message. The engine also produces some system messages (like `"collision_response"` on physics collisions) that are delivered to your objects. For user messages sent to script components, the engine simply calls a special Defold Lua function named `on_message()`.
113
+
The mechanics of sending a message are, as we have seen above, very simple. You call the function `msg.post()` which posts your message to the message queue. Then, each frame, the engine runs through the queue and delivers each message to its target address. For some system messages (like `"enable"`, `"disable"`, `"set_parent"` etc) the engine code handles the message. The engine also produces some system messages (like `"collision_response"` on physics collisions) that are delivered to your objects. For user messages sent to script components, the engine simply calls a special Defold Lua function named `on_message()`.
114
114
115
115
You can send arbitrary messages to any existing object or component and it is up to the code on the recipient side to respond to the message. If you send a message to a script component and the script code ignores the message, that is fine. The responsibility of dealing with messages is fully on the receiving end.
116
116
@@ -151,7 +151,7 @@ There is a hard limit to the `message` parameter table size. This limit is set t
151
151
152
152
### Shorthands
153
153
154
-
Defold provides two handy shorthands that you can use to send message without specifying a complete URL:
154
+
Defold provides two handy shorthands that you can use to send messages without specifying a complete URL:
155
155
156
156
:[Shorthands](../shared/url-shorthands.md)
157
157
@@ -203,7 +203,7 @@ A more in depth description on how proxies work can be found in the [Collection
203
203
204
204
## Message chains
205
205
206
-
When a message that has been posted is eventually dispatched the recipients’ `on_message()` is called. It is quite common that the reaction code post new messages, which are added to the message queue.
206
+
When a message that has been posted is eventually dispatched, the recipients’ `on_message()` is called. It is quite common that the reaction code posts new messages, which are added to the message queue.
207
207
208
208
When the engine starts dispatching it will work through the message queue and call each message recipient's `on_message()` function and go on until the message queue is empty. If the dispatching pass adds new messages to the queue, it will do another pass. There is, however, a hard limit to how many times the engine tries to empty the queue, which effectively puts a limit to how long message chains you can expect to be fully dispatched within a frame. You can easily test how many dispatch passes the engine performs between each `update()` with the following script:
The property values provided via `factory.create()` and `collectionfactory.create()` will override any value set in the prototype file as well as the default values in the script.
119
119
120
-
If several script components attached to a game object defines the same property, each component will get initialized with the value provided to `factory.create()` or `collectionfactory.create()`.
120
+
If several script components attached to a game object define the same property, each component will get initialized with the value provided to `factory.create()` or `collectionfactory.create()`.
0 commit comments