Class KUID
From TrainzOnline
(Difference between revisions)
m (clarify) |
|||
(One intermediate revision by one user not shown) | |||
Line 1: | Line 1: | ||
+ | |||
+ | __FORCETOC__ | ||
+ | |||
*[[TrainzScript Language Reference|API Hierarchy]] | *[[TrainzScript Language Reference|API Hierarchy]] | ||
**[[Class GSObject|GSObject]] | **[[Class GSObject|GSObject]] | ||
Line 5: | Line 8: | ||
*A class providing access to an asset by reference to its [[KUID]] identification. This class works with data which is common to all ''instances'' of the asset and cannot be used to reference an individual object placed in the game. | *A class providing access to an asset by reference to its [[KUID]] identification. This class works with data which is common to all ''instances'' of the asset and cannot be used to reference an individual object placed in the game. | ||
− | *A [[KUID]] contains data fields representing the creator of the asset, the asset's unique identification and a version identifier which is incremented with each published revision. | + | *A [[KUID]] contains data fields representing the creator of the asset, the asset's unique identification and when an asset has been updated, obsoleting an older asset implementation, a version identifier which is incremented with each published revision (See [[KUID#KUID2_Encoding|kuid2 Encoding/format]]). |
− | + | ||
− | + | ||
==GetHTMLString== | ==GetHTMLString== | ||
Line 15: | Line 16: | ||
;Returned Value | ;Returned Value | ||
*A string representing the KUID of the asset formatted for use as a parameter in browser HTML code. | *A string representing the KUID of the asset formatted for use as a parameter in browser HTML code. | ||
− | |||
− | |||
<br> | <br> | ||
Line 28: | Line 27: | ||
KUID kuid = FindAsset("coalman"); | KUID kuid = FindAsset("coalman"); | ||
Interface.Print("Coalman's KUID is: " + kuid.GetLogString()); | Interface.Print("Coalman's KUID is: " + kuid.GetLogString()); | ||
− | |||
− | |||
<br> | <br> | ||
Latest revision as of 21:34, 7 June 2013
- API Hierarchy
- GSObject
- KUID
- GSObject
- A class providing access to an asset by reference to its KUID identification. This class works with data which is common to all instances of the asset and cannot be used to reference an individual object placed in the game.
- A KUID contains data fields representing the creator of the asset, the asset's unique identification and when an asset has been updated, obsoleting an older asset implementation, a version identifier which is incremented with each published revision (See kuid2 Encoding/format).
Contents |
[edit] GetHTMLString
public native string GetHTMLString(void)
- Parameters
- None
- Returned Value
- A string representing the KUID of the asset formatted for use as a parameter in browser HTML code.
[edit] GetLogString
public native string GetLogString(void)
- Parameters
- None
- Returned Value
- A string representing the KUID of the asset formatted for use in error logs and the like.
- Syntax
KUID kuid = FindAsset("coalman"); Interface.Print("Coalman's KUID is: " + kuid.GetLogString());
[edit] GetName
public native string GetName(void)
- Parameters
- None
- Returned Value
- A string representing the name of the asset.
- Syntax
KUID kuid = FindAsset("coalman"); Interface.Print("Coalman's username is: " + kuid.GetName());
- Notes
[edit] Related Methods
Asset.GetKUID()
Asset.LookupKUIDTable()
Asset.FindAsset()
Soup.GetNamedTagAsKUID()
World.FindAsset()