User Tools

Site Tools


modding:function:typdynamicunid

This is an old revision of the document!


Talk Page

typDynamicUNID

Syntax (typDynamicUNID uniqueName) → UNID
Arguments uniqueName: A string that represents the UNID to return. Must be at least one character long.
Returns A UNID between 0xF0000000 and 0xFFFFFFFF. If the string has not been bound to any UNID, then the function will return a new UNID and bind the string to it. Otherwise, it will return the UNID that was bound to the name.
Category type_functions, unid_functions
Description Binds a string to a UNID in the 0xF0000000 range. The UNID can then be bound to a dynamic type. UNIDs start at 0xF0000000 and increment up whenever a new name is assigned. Use this function with typCreate to handle UNID assignment and prevent conflicts with existing types.

Example

Assume that a new game has just started

(enum (list "type1" "type2" "type3" "type2" "type2" "type4" "type5") theName
	(print (typDynamicUNID theName))
	)
-268435456
-268435455
-268435454
-268435455
-268435455
-268435453
-268435452

Return to type functions list

Return to Functions list

modding/function/typdynamicunid.1497215103.txt.gz · Last modified: 2017/06/11 21:05 by 0xabcdef