Difference between revisions of "GetBlobByNetworkId"
From King Arthur's Gold Wiki
Shadlington (Talk | contribs) (Created page with "<onlyinclude> Returns a reference to the CBlob with the given Network ID. </onlyinclude> <syntaxhighlight lang="cpp">CBlob@ getBlobByNetworkId(u16 netid)</syntaxhighlight...") |
Shadlington (Talk | contribs) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
Returns a reference to the [[CBlob]] with the given Network ID. | Returns a reference to the [[CBlob]] with the given Network ID. | ||
</onlyinclude> | </onlyinclude> | ||
− | <syntaxhighlight lang="cpp"> | + | |
+ | <syntaxhighlight lang="cpp">CBlob@ getBlobByNetworkId(u16 netid)</syntaxhighlight> | ||
This will be used where a [[CBlob]]'s Network ID has been passed around scripts to identify it. | This will be used where a [[CBlob]]'s Network ID has been passed around scripts to identify it. | ||
− | This is commonly done in a script's onCommand function. | + | This is commonly done in a script's [[onCommand]] function. |
− | Example from Entities/Workshops/WorkshopTasks.as, in the onCommand function, where the calling [[CBlob]]'s Network ID was passed in via the params parameter: | + | Example from Entities/Workshops/WorkshopTasks.as, in the [[onCommand]] function, where the calling [[CBlob]]'s Network ID was passed in via the params parameter: |
− | <syntaxhighlight lang="cpp"> | + | <syntaxhighlight lang="cpp">CBlob@ caller = getBlobByNetworkId( params.read_u16() );</syntaxhighlight> |
[[Category:Scripting]] | [[Category:Scripting]] | ||
[[Category:Global Functions]] | [[Category:Global Functions]] |
Latest revision as of 21:03, 19 August 2012
Returns a reference to the CBlob with the given Network ID.
CBlob@ getBlobByNetworkId(u16 netid)
This will be used where a CBlob's Network ID has been passed around scripts to identify it. This is commonly done in a script's onCommand function.
Example from Entities/Workshops/WorkshopTasks.as, in the onCommand function, where the calling CBlob's Network ID was passed in via the params parameter:
CBlob@ caller = getBlobByNetworkId( params.read_u16() );