Data Table Instance is not fully implemented

It appears datatable instance is only partially implemented.

  1. There’s total lack of GUI mappings for new API. I had to fetch them for the executable because API isn’t even defined in the natives.galaxy
D:\BnetGameLib\StarCraft II Public Test\Versions\Base80669
λ strings.exe SC2_x64.exe | rg -i datatableins
DataTableInstanceCreate
DataTableInstanceLastCreated
DataTableInstanceCopy
DataTableInstanceClear
DataTableInstanceValueCount
DataTableInstanceValueName
DataTableInstanceValueExists
DataTableInstanceValueType
DataTableInstanceValueRemove
DataTableInstanceSetAbilCmd
DataTableInstanceGetAbilCmd
DataTableInstanceSetActor
DataTableInstanceGetActor
DataTableInstanceSetActorScope
DataTableInstanceGetActorScope
DataTableInstanceSetAIFilter
DataTableInstanceGetAIFilter
DataTableInstanceSetBank
DataTableInstanceGetBank
DataTableInstanceSetBool
DataTableInstanceGetBool
DataTableInstanceSetByte
DataTableInstanceGetByte
DataTableInstanceSetCameraInfo
DataTableInstanceGetCameraInfo
DataTableInstanceSetCinematic
DataTableInstanceGetCinematic
DataTableInstanceSetColor
DataTableInstanceGetColor
DataTableInstanceSetControl
DataTableInstanceGetControl
DataTableInstanceSetConversation
DataTableInstanceGetConversation
DataTableInstanceSetDialog
DataTableInstanceGetDialog
DataTableInstanceSetDoodad
DataTableInstanceGetDoodad
DataTableInstanceSetFixed
DataTableInstanceGetFixed
DataTableInstanceSetGenericHandle
DataTableInstanceGetGenericHandle
DataTableInstanceSetInt
DataTableInstanceGetInt
DataTableInstanceSetMarker
DataTableInstanceGetMarker
DataTableInstanceSetObjective
DataTableInstanceGetObjective
DataTableInstanceSetOrder
DataTableInstanceGetOrder
DataTableInstanceSetPing
DataTableInstanceGetPing
DataTableInstanceSetPlanet
DataTableInstanceGetPlanet
DataTableInstanceSetPlayerGroup
DataTableInstanceGetPlayerGroup
DataTableInstanceSetPoint
DataTableInstanceGetPoint
DataTableInstanceSetPortrait
DataTableInstanceGetPortrait
DataTableInstanceSetRegion
DataTableInstanceGetRegion
DataTableInstanceSetReply
DataTableInstanceGetReply
DataTableInstanceSetRevealer
DataTableInstanceGetRevealer
DataTableInstanceSetSound
DataTableInstanceGetSound
DataTableInstanceSetSoundLink
DataTableInstanceGetSoundLink
DataTableInstanceSetString
DataTableInstanceGetString
DataTableInstanceSetText
DataTableInstanceGetText
DataTableInstanceSetTimer
DataTableInstanceGetTimer
DataTableInstanceSetTransmission
DataTableInstanceGetTransmission
DataTableInstanceSetTransmissionSource
DataTableInstanceGetTransmissionSource
DataTableInstanceSetTrigger
DataTableInstanceGetTrigger
DataTableInstanceSetUnit
DataTableInstanceGetUnit
DataTableInstanceSetUnitFilter
DataTableInstanceGetUnitFilter
DataTableInstanceSetUnitGroup
DataTableInstanceGetUnitGroup
DataTableInstanceSetUnitRef
DataTableInstanceGetUnitRef
DataTableInstanceSetWave
DataTableInstanceGetWave
DataTableInstanceSetWaveInfo
DataTableInstanceGetWaveInfo
DataTableInstanceSetWaveTarget
DataTableInstanceGetWaveTarget
DataTableInstanceSetValue
  1. datatableinstance type is unknown to the Galaxy VM. Following code won’t compile:
datatableinstance foo;

https://i.imgur.com/1FwKfi4.png

  1. Data Table Instance is unknown to the SC2 Editor - it doesn’t appear as a valid choice on the list.

https://i.imgur.com/eMj0tez.png

I think the datatable instances are referred by index, so they would basically be a integer. Instead of some new type like ‘datatableinstance’

Oh, that hasn’t crossed my mind. Even though it makes sense. And it does appear to be the case. Following code works:

int foo;
void asd()
{
DataTableInstanceCreate();
foo = DataTableInstanceLastCreated();
DataTableInstanceSetString(foo, "k", "v");
TriggerDebugOutput(1, StringToText(DataTableInstanceGetString(foo, "k")), true);
}

So point 2. and 3. are invalid. Only 1. is still an issue. Not a critical one though.

btw. I’d expect DataTableInstanceCreate to return an int, just like the dialog control API does, and pretty much all other APIs which create a resource, but it appears it returns void :confused: .
It’d make it more convenient to use from the script. Since *LastCreated is meant for GUI use.

Hmm… how does one destroy a data table instance though? I don’t see a function for that (like DataTableInstanceDestroy). Unless the dump I’ve posted is incomplete.
If they’re not using own datatype it means they’re not garbage collected, so there should be an explicit way to destroy them.