HaloScript Data Types
Description of the different data types used in HaloScript
V last updated 5 months ago on 2020/02/19
This document is approximately 70% complete.
HaloScript like most programming languages includes a number of data types, data types are just a way for the code to tell what sort of data it is working with (e.g. whatever it a sound tag or a string).
These can be broken into 3 main groups: internal, basic and complex.
Internal
There are 4 types that are mostly used internally by the system: unparsed
, special form
, function name
and passthrough
.
Out of these the only one of note for us is passthrough
as it can be "cast" or converted to any other type. See Type Casting for more.
Basic
These are the basic types you would expect in a scripting language and are used by a lot of different functions.
Name | Description |
---|---|
void | Special type used to mean nothing, only as a function return type. |
boolean | True or false |
real | A float point number (1500.2, -1.53, 3.14159, etc) |
short | A whole number between -32767 and 32767 |
long | A whole number between -2147483647 and 2147483647 |
string | Text ("hello", "test", "120") |
string_id | Another way to reference a string-like value, sometimes used for localization |
script | Name of another script (cinematic_fade_from_black, welcome, etc) |
Complex
Most HaloScript types belong in this category, these are mostly types added for use in a specific function. It can be further broken into multiple subsets: tags, enums, objects, object names and misc.
Tags
These reference a specific tag, the compiler gets the tag datum and adds the tag to the References block in the scenario.
The HaloScript compiler should check the tag type is correct, but this check appears to be disabled by specifying the full path with extension
(sound\ui\shield_hit.sound
, instead of sound\ui\shield_hit
)
The following types are tags/tag refs:
sound
effect
damage
looping_sound
animation_graph
damage_effect
object_defintion
bitmap
shader
render model
structure definition
lightmap definition
style
Style is only a tag ref in H2Codez, it's non-functional in the release HEK and wasn't quite a tag ref in the Bungie HEK.
Enums
Enums short for enumerated are used for named values.
Name | Description | Value List |
---|---|---|
game_difficulty | How hard the game is | Easy, Normal, Heroic, Legendary |
team | What team an AI or player is on, used in campaign | default, player, human, covenant, flood, sentinel, heretic, prophet, unused8, unused9, ... unused15 |
actor_type | unknown (code removed) | N/A |
hud_corner | Related to old HUD | N/A |
model_state | TODO | TODO |
network_event | unknown (code removed) | N/A |
Objects / Object Names
Objects and Object names are the same with one minor difference, objects can be set to NONE
meaning no object and object names can't. So you can use sound_impulse_start
without an object but not object_create
The full list of object/object name types is:
- object
- unit
- vehicle
- weapon
- device
- scenery
Miscellaneous
The remaining types that don't easily fit into any of the above.
Name | Description | Example |
---|---|---|
object_list | A list of objects, one with only one object can be created the same way as object_name | |
unit_seat_mapping | ||
trigger_volume | ||
cutscene_flag | ||
cutscene_camera_point | ||
cutscene_title | ||
cutscene_recording | ||
device_group | ||
ai | Reference to an AI starting location, squad or squad group. | squad1, squadgroup, squad_alpha/4 |
ai_command_list | Obsolete | N/A |
ai_command_script | ||
ai_behavior | AI behaviour | engage, fight, shoot_corpse |
ai_orders | ||
starting_profile | ||
conversation | Element of the AI Conversations tag block in scenario | |
structure_bsp | ||
navpoint | ||
point_reference | Point set and point in Scripting data in scenario | point_set/point_b |
hud_message | Obsolete, used to be a message in the hud_message_text tag, commands that supported it are no longer functional. |