Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Comment:
Migrated to Confluence 5.3
Warning | ||
---|---|---|
| ||
|
...
Excerpt |
---|
Get an object based on it's object ID and player ID... |
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
var gameObj = droidFromId( id, player ); |
Parameters
Parameter | Type | Mandatory | Notes | Game version |
---|---|---|---|---|
id | Number | The ID of the object to retrieve | 3.1 Beta 1 ONLY | |
player | Number | The ID of the player to which the object belongs. | 3.1 Beta 1 ONLY |
Return values
Value | Type | Notes | Game version |
---|---|---|---|
<gameObj> | Game object | If the object is found, it's associated game object is returned. Despite the name of the function, droidFromId() was capable of getting any type of game object, including structures and features. | 3.1 Beta 1 ONLY |
<error> | Error | If the object is not found, an error is thrown. | 3.1 Beta 1 ONLY |
Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
var obj;
try {
obj = droidFromId( 63, me );
// do stuff with obj that was found
} catch(e) {
// object not found
} |
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
Availability
Requires:
|
...
Replaced by:
|
...
See also
...
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|
Div | ||
---|---|---|
| ||
See alsoRelated articles:
|