Resource

EEex_Resource_Demand

Warning

This function is currently undocumented.

EEex_Resource_ExtToType

Warning

This function is currently undocumented.

EEex_Resource_ExtToUserType

Warning

This function is currently undocumented.

EEex_Resource_Fetch

Warning

This function is currently undocumented.

EEex_Resource_Find2DAColumnIndex

Instance Name: findColumnIndex

Summary

Searches the values of the row specified by rowIndex and returns the first column index that matches toSearchFor.

Parameters:

Name

Type

Default Value

Description

array

C2DArray

The .2DA file being operated on. This is usually the object returned by EEex_Resource_Load2DA().

rowIndex

number

The index of the row to be searched.

toSearchFor

string

The value to search for.

Return Values:

Type

Description

number

See summary.

EEex_Resource_Find2DAColumnLabel

Instance Name: findColumnLabel

Summary

Searches the .2DA’s column labels and returns the first column index that matches toSearchFor.

Parameters:

Name

Type

Default Value

Description

array

C2DArray

The .2DA file being operated on. This is usually the object returned by EEex_Resource_Load2DA().

toSearchFor

string

The label to search for.

Return Values:

Type

Description

number

See summary.

EEex_Resource_Find2DARowIndex

Instance Name: findRowIndex

Summary

Searches the values of the column specified by columnIndex and returns the first row index that matches toSearchFor.

Parameters:

Name

Type

Default Value

Description

array

C2DArray

The .2DA file being operated on. This is usually the object returned by EEex_Resource_Load2DA().

columnIndex

number

The index of the column to be searched.

toSearchFor

string

The value to search for.

Return Values:

Type

Description

number

See summary.

EEex_Resource_Find2DARowLabel

Instance Name: findRowLabel

Summary

Searches the .2DA’s row labels and returns the first row index that matches toSearchFor.

Parameters:

Name

Type

Default Value

Description

array

C2DArray

The .2DA file being operated on. This is usually the object returned by EEex_Resource_Load2DA().

toSearchFor

string

The label to search for.

Return Values:

Type

Description

number

See summary.

EEex_Resource_Free2DA

Instance Name: free

Summary

Frees the memory associated with array. Only use this if you know what you are doing!

Note

C2DArray objects returned by EEex_Resource_Load2DA() are subject to garbage-collection – meaning EEex_Resource_Free2DA() should not be called on these instances.

Parameters:

Name

Type

Default Value

Description

array

C2DArray

The .2DA file being operated on. This is usually the object returned by EEex_Resource_Load2DA().

EEex_Resource_FreeIDS

Instance Name: free

Summary

Frees the memory associated with ids. Only use this if you know what you are doing!

Note

CAIIdList objects returned by EEex_Resource_LoadIDS() are subject to garbage-collection – meaning EEex_Resource_FreeIDS() should not be called on these instances.

Parameters:

Name

Type

Default Value

Description

ids

CAIIdList

The .IDS file being operated on. This is usually the object returned by EEex_Resource_LoadIDS().

EEex_Resource_Get2DAColumnLabel

Instance Name: getColumnLabel

Summary

Returns the label of the column specified by columnIndex.

Parameters:

Name

Type

Default Value

Description

array

C2DArray

The .2DA file being operated on. This is usually the object returned by EEex_Resource_Load2DA().

columnIndex

number

The column index of the label to be fetched.

Return Values:

Type

Description

number

See summary.

EEex_Resource_Get2DADefault

Instance Name: getDefault

Summary

Returns the “default” value of the .2DA.

Note

A .2DA’s default value is defined by the line directly below the version header – it is usually an asterisk (‘*’).

Note

If the engine (or any EEex function) indexes a .2DA out-of-bounds, the default value is returned instead.

Parameters:

Name

Type

Default Value

Description

array

C2DArray

The .2DA file being operated on. This is usually the object returned by EEex_Resource_Load2DA().

Return Values:

Type

Description

string

See summary.

EEex_Resource_Get2DADimensions

Instance Name: getDimensions

Summary

Returns the x and y dimensions of the .2DA. That is the number of columns, and the number of rows respectively.

Note

  • The returned ‘x’ dimension includes the row labels, (that is to say, its value is 1 more than expected).

  • The returned ‘y’ dimension excludes the column labels.

When indexing a .2DA, column / row labels are always excluded.

Parameters:

Name

Type

Default Value

Description

array

C2DArray

The .2DA file being operated on. This is usually the object returned by EEex_Resource_Load2DA().

Return Values:

Type

Description

number

The .2DA’s ‘x’ dimension.

number

The .2DA’s ‘y’ dimension.

EEex_Resource_Get2DARowColumnsByLabelIterator

Warning

This function is currently undocumented.

EEex_Resource_Get2DARowColumnsIterator

Warning

This function is currently undocumented.

EEex_Resource_Get2DARowLabel

Instance Name: getRowLabel

Summary

Returns the label of the row specified by rowIndex.

Parameters:

Name

Type

Default Value

Description

array

C2DArray

The .2DA file being operated on. This is usually the object returned by EEex_Resource_Load2DA().

rowIndex

number

The row index of the label to be fetched.

Return Values:

Type

Description

string

See summary.

EEex_Resource_Get2DARowTableIterator

Warning

This function is currently undocumented.

EEex_Resource_Get2DARowValuesIterator

Warning

This function is currently undocumented.

EEex_Resource_GetAt2DALabels

Instance Name: getAtLabels

Summary

Returns the value at the intersection of columnLabel and rowLabel. If either label is missing, returns the .2DA’s default value, (see EEex_Resource_Get2DADefault()).

Parameters:

Name

Type

Default Value

Description

array

C2DArray

The .2DA file being operated on. This is usually the object returned by EEex_Resource_Load2DA().

columnLabel

string

The column label of the value to be fetched.

rowLabel

string

The row label of the value to be fetched.

Return Values:

Type

Description

string

See summary.

EEex_Resource_GetAt2DAPoint

Instance Name: getAtPoint

Summary

Returns the value at the intersection of columnIndex and rowIndex. If either index exceeds the .2DA’s dimensions, returns the .2DA’s default value, (see EEex_Resource_Get2DADefault()).

Parameters:

Name

Type

Default Value

Description

array

C2DArray

The .2DA file being operated on. This is usually the object returned by EEex_Resource_Load2DA().

columnIndex

number

The column index of the value to be fetched.

rowIndex

number

The row index of the value to be fetched.

Return Values:

Type

Description

string

See summary.

EEex_Resource_GetCItemAbility

Warning

This function is currently undocumented.

EEex_Resource_GetIDSCount

Instance Name: getCount

Summary

Returns the size of ids’s backing cache array.

Warning

This function is only valid if the .IDS was loaded with cacheAsArray=true.

Parameters:

Name

Type

Default Value

Description

ids

CAIIdList

The .IDS file being operated on. This is usually the object returned by EEex_Resource_LoadIDS().

Return Values:

Type

Description

number

See summary.

EEex_Resource_GetIDSEntry

Instance Name: getEntry

Summary

Returns the CAIId entry with the given id, or nil if id is not present in the .IDS.

Note

This function performs a linear search unless the .IDS was loaded with cacheAsArray=true.

Parameters:

Name

Type

Default Value

Description

ids

CAIIdList

The .IDS file being operated on. This is usually the object returned by EEex_Resource_LoadIDS().

id

number

The id of the entry to be fetched.

Return Values:

Type

Description

CAIId

See summary.

EEex_Resource_GetIDSLine

Instance Name: getLine

Summary

Returns the symbol associated with the given id, or nil if id is not present in the .IDS.

Note

This function performs a linear search unless the .IDS was loaded with cacheAsArray=true.

Parameters:

Name

Type

Default Value

Description

ids

CAIIdList

The .IDS file being operated on. This is usually the object returned by EEex_Resource_LoadIDS().

id

number

The id of the symbol to be fetched.

Return Values:

Type

Description

string

See summary.

EEex_Resource_GetIDSStart

Instance Name: getStart

Summary

Returns the symbol value associated with the given id up until (and not including) the first ‘(’ character, or nil if id is not present in the .IDS.

Note

This function performs a linear search unless the .IDS was loaded with cacheAsArray=true.

Parameters:

Name

Type

Default Value

Description

ids

CAIIdList

The .IDS file being operated on. This is usually the object returned by EEex_Resource_LoadIDS().

id

number

The id of the symbol to be fetched.

Return Values:

Type

Description

string

See summary.

EEex_Resource_GetItemAbility

Warning

This function is currently undocumented.

EEex_Resource_GetMax2DAIndices

Instance Name: getMaxIndices

Summary

Returns the maximum x and y indices of the .2DA. That is the maximum indexable column, and the maximum indexable row respectively.

Parameters:

Name

Type

Default Value

Description

array

C2DArray

The .2DA file being operated on. This is usually the object returned by EEex_Resource_Load2DA().

Return Values:

Type

Description

number

The .2DA’s maximum ‘x’ index.

number

The .2DA’s maximum ‘y’ index.

EEex_Resource_GetSpellAbility

Warning

This function is currently undocumented.

EEex_Resource_GetSpellAbilityForLevel

Warning

This function is currently undocumented.

EEex_Resource_GetValidSpellsIterator

Warning

This function is currently undocumented.

EEex_Resource_IDSHasID

Instance Name: hasID

Summary

Returns true if the given id is present in the .IDS.

Note

This function performs a linear search unless the .IDS was loaded with cacheAsArray=true.

Parameters:

Name

Type

Default Value

Description

ids

CAIIdList

The .IDS file being operated on. This is usually the object returned by EEex_Resource_LoadIDS().

id

number

The id to search for.

Return Values:

Type

Description

boolean

See summary.

EEex_Resource_ItemCategoryIDSToSymbol

Warning

This function is currently undocumented.

EEex_Resource_ItemCategorySymbolToIDS

Warning

This function is currently undocumented.

EEex_Resource_Iterate2DAColumnIndex

Instance Name: iterateColumnIndex

Summary

Calls func for every value in the column specified by columnIndex. If func returns true the iteration ends early.

Parameters:

Name

Type

Default Value

Description

array

C2DArray

The .2DA file being operated on. This is usually the object returned by EEex_Resource_Load2DA().

columnIndex

number

The index of the column whose values are to be iterated.

func

function(value: string) -> boolean

The function to be called.

EEex_Resource_Iterate2DAColumnLabel

Instance Name: iterateColumnLabel

Summary

Calls func for every value in the column specified by columnLabel. If func returns true the iteration ends early.

Parameters:

Name

Type

Default Value

Description

array

C2DArray

The .2DA file being operated on. This is usually the object returned by EEex_Resource_Load2DA().

columnLabel

string

The label of the column whose values are to be iterated.

func

function(value: string) -> boolean

The function to be called.

EEex_Resource_Iterate2DARowIndex

Instance Name: iterateRowIndex

Summary

Calls func for every value in the row specified by rowIndex. If func returns true the iteration ends early.

Parameters:

Name

Type

Default Value

Description

array

C2DArray

The .2DA file being operated on. This is usually the object returned by EEex_Resource_Load2DA().

rowIndex

number

The index of the row whose values are to be iterated.

func

function(value: string) -> boolean

The function to be called.

EEex_Resource_Iterate2DARowLabel

Instance Name: iterateRowLabel

Summary

Calls func for every value in the row specified by rowLabel. If func returns true the iteration ends early.

Parameters:

Name

Type

Default Value

Description

array

C2DArray

The .2DA file being operated on. This is usually the object returned by EEex_Resource_Load2DA().

rowLabel

string

The label of the row whose values are to be iterated.

func

function(value: string) -> boolean

The function to be called.

EEex_Resource_IterateIDSEntries

Instance Name: iterateEntries

Summary

Calls func for every CAIId entry of the .IDS. If func returns true the iteration ends early.

Parameters:

Name

Type

Default Value

Description

ids

CAIIdList

The .IDS file being operated on. This is usually the object returned by EEex_Resource_LoadIDS().

func

function(entry: CAIId) -> boolean

The function to be called.

EEex_Resource_IterateUnpackedIDSEntries

Instance Name: iterateUnpackedEntries

Summary

Calls func for every CAIId entry of the .IDS, unpacking the entry’s members for convenience. If func returns true the iteration ends early.

Parameters:

Name

Type

Default Value

Description

ids

CAIIdList

The .IDS file being operated on. This is usually the object returned by EEex_Resource_LoadIDS().

func

function(id: number, line: string, start: string) -> boolean

The function to be called.

id – the entry’s numerical value.
line – the entry’s complete symbol value.
start – the entry’s symbol value up until (and not including) the first ‘(’ character.

EEex_Resource_KitIDSToSymbol

Warning

This function is currently undocumented.

EEex_Resource_KitSymbolToIDS

Warning

This function is currently undocumented.

EEex_Resource_Load2DA

Summary

Returns a C2DArray instance that represents the .2DA with resref.

Parameters:

Name

Type

Default Value

Description

resref

string

The resref of the .2DA to be loaded – (should omit the file extension).

Return Values:

Type

Description

C2DArray

See summary.

EEex_Resource_LoadIDS

Summary

Returns a CAIIdList instance that represents the .IDS with resref.

Parameters:

Name

Type

Default Value

Description

resref

string

The resref of the .IDS to be loaded – (should omit the file extension).

cacheAsArray

boolean

false

If true, internally builds an array that maps every id of the .IDS to its corresponding CAIId entry in the
range [0, <max id in .IDS>].

Setting this parameter to true can speed up entry lookups for the returned CAIIdList instance – however,
care must be taken that the given .IDS does not have a large max id value.

For example, it would be a bad idea to load KIT.IDS with cacheAsArray=true, as the max id of KIT.IDS,
0x80000000, would cause the CAIIdList instance to attempt to allocate an array that has a size of
(0x80000000 + 1) * 8 bytes = ~16 gigabytes!

Return Values:

Type

Description

CAIIdList

See summary.