get_enum_max
read-only$type.get_enum_max(enum_name: string) -> intGet the maximum value of an enum.
| Parameter | Type | Meaning |
|---|---|---|
enum_name | string | The name of the enum type to check. |
Returns int: The maximum value of the enum.
14 natives. Read-only natives only look things up; the rest change something. Parameter types use the language's names (Types).
$type.get_enum_max(enum_name: string) -> intGet the maximum value of an enum.
| Parameter | Type | Meaning |
|---|---|---|
enum_name | string | The name of the enum type to check. |
Returns int: The maximum value of the enum.
$type.get_enum_min(enum_name: string) -> intGet the minimum value of an enum.
| Parameter | Type | Meaning |
|---|---|---|
enum_name | string | The name of the enum type to check. |
Returns int: The minimum value of the enum.
$type.get_enum_string(value: int, type: string, remove_prefix: string) -> stringGet the string representation of an enum value, optionally omitting the enum type prefix 'k_enum_type_'.
| Parameter | Type | Meaning |
|---|---|---|
value | int | The integer value e.g. k_enum_type_foo |
type | string | The enum type e.g. '_vgame_enum_type_t' |
remove_prefix | string | Optional prefix to remove e.g. specify 'k_enum_type_' if you want 'foo' returned instead of 'k_enum_type_foo'. |
Returns string: The enum value as a string e.g. 'k_enum_type_foo'.
$type.get_field_attribute(field: string, attribute: string, default_value: var) -> varGet the specified field's value for the specified attribute.
| Parameter | Type | Meaning |
|---|---|---|
field | string | Field name. |
attribute | string | Attribute name. |
default_value | var | (Optional) Default value to return if attribute not found. If not specified, will warn of missing attribute. |
Returns var: The value of the specified attribute for the field; otherwise NULL in the event of an error.
$type.set_components_per_job(value: int)The maximum number of components of this type can that be batched into a single job. Components that read from other components of the same type, either directly or indirectly, should use 1 component per job.
| Parameter | Type | Meaning |
|---|---|---|
value | int | Number for components that can be run in a single job. |
$type.set_dependency(dependency: string)Define a component dependency for the current script. A dependency is another component that this component requires in order to function. The editor will automatically add any missing dependencies to an entity when created.
| Parameter | Type | Meaning |
|---|---|---|
dependency | string | File path |
$type.set_deterministic(value: bool)Declare whether this component type is deterministic. Components are assumed to be deterministic by default. Disable determinism with extreme care.
| Parameter | Type | Meaning |
|---|---|---|
value | bool | Whether this component is deterministic. |
$type.set_field_attribute(field: string, attribute: string, value: var)Set an attribute on a constant field.
| Parameter | Type | Meaning |
|---|---|---|
field | string | Field name (const in script). |
attribute | string | Attribute name. |
value | var | Attribute value. |
$type.set_field_edit_visible(field_name: string, value: bool)True by default. Set to false if a given field should not appear in editor.
| Parameter | Type | Meaning |
|---|---|---|
field_name | string | Field name (const in script). |
value | bool | True if the field should be visible in editor, false otherwise. |
$type.set_job_sort_order(locked: bool, value: int)Determines if job sort order is mostly fixed (exception being waiting on physics). If the order is fixed, sets the order value (lower values sort earlier). By default jobs have a dynamic sort order.
| Parameter | Type | Meaning |
|---|---|---|
locked | bool | If true, the sort order is largely fixed. |
value | int | The sort order value for this type. |
$type.set_job_stack_large(enable: bool)Enable or disable large stack size for jobs that run this component.
| Parameter | Type | Meaning |
|---|---|---|
enable | bool | If true uses large stack, else uses normal stack. |
$type.set_priority(priority: int)Set the priority for all components of the current script's type. Scripts with lower priority numbers go first in the event of a dependency cycle.
| Parameter | Type | Meaning |
|---|---|---|
priority | int | Script priority. Lowest breaks cycles. |
$type.set_tick_physics(value: bool)Declare whether this component type updates physics.
| Parameter | Type | Meaning |
|---|---|---|
value | bool | Whether this component updates physics. |
$type.setup_job_self_sort(group: string)Allows components of a specified group to be sorted among themselves. In cases of well defined intra-type dependencies, this can improve performance and reduce waits. See component.set_job_self_sort_order.
| Parameter | Type | Meaning |
|---|---|---|
group | string | Name of the group of which all types in the same group will sort against each other. |