- Joined
- Jun 10, 2008
- Messages
- 1,399
I'm making a custom inventory system for my map and I've run into a roadblock.
When I try to update the dialog I use a script which deals with a dialog item variable.
The error I get is Trigger Error in 'gt_Debug4_Func': Could not get 'triggerControl' from parameter in 'DialogControlGetPropertyAsText' (value: 0) (This is for a debug trigger.)
Most of the code is in 4 enormous function/triggers but This is the main part of the code:
The lines marked with stars are the ones causing the trouble.
This is the entire error log for the above script:
Even if I use a custom 'test' variable that isn't used anywhere else it will still throw this error.
The dialog is never destroyed.
Any help would be greatly appreciated.
When I try to update the dialog I use a script which deals with a dialog item variable.
The error I get is Trigger Error in 'gt_Debug4_Func': Could not get 'triggerControl' from parameter in 'DialogControlGetPropertyAsText' (value: 0) (This is for a debug trigger.)
Most of the code is in 4 enormous function/triggers but This is the main part of the code:
Code:
Dialog - Create a Button for dialog (Last created dialog)
Variable - Set Buttons[Size] = (Last created dialog item)
Variable - Set CurrentItem = (GetItemFromInt((Integer((Custom value (loop + CUSTOM_VALUE_OFFSET) of (Triggering unit))))))
Dialog - Set (Last created dialog item) size to (CUSTOM_ITEM_BORDER_SIZE, CUSTOM_ITEM_BORDER_SIZE) for (All players)
Dialog - Set (Last created dialog item) Click On Down flag to True for (All players)
Variable - Set xOffset = (DIALOG_SIZE_SIDES + (((loop mod SizeX) * (CUSTOM_ITEM_BORDER_SIZE + ITEM_BORDER_OFFSET_X)) - 1))
Variable - Set yOffset = (DIALOG_SIZE_TOP + (((loop / SizeX) * (CUSTOM_ITEM_BORDER_SIZE + ITEM_BORDER_OFFSET_Y)) - 1))
Dialog - Move (Last created dialog item) to (xOffset, yOffset) relative to Top Left of dialog for (All players)
General - If (Conditions) then do (Actions) else do (Actions)
If
CurrentItem == ""
Then
Dialog - Set (Last created dialog item) image to Assets\InventoryBorderEmpty.dds for (All players)
Dialog - Set (Last created dialog item) hover image to Assets\InventoryBorderEmpty.dds for (All players)
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
(Get Type of Item(CurrentItem)) == Active
Then
Dialog - Set (Last created dialog item) image to Assets\InventoryBorderActive.dds for (All players)
Dialog - Set (Last created dialog item) hover image to Assets\InventoryBorderActiveHighlight.dds for (All players)
Else
Dialog - Set (Last created dialog item) image to Assets\InventoryBorderPassive.dds for (All players)
Dialog - Set (Last created dialog item) hover image to Assets\InventoryBorderPassive.dds for (All players)
Dialog - Set (Last created dialog item) tooltip to (Format Tooltip(CurrentItem)) for (Player group((Triggering player)))
* Variable - Set ItemBorders[loop][(Owner of (Triggering unit))] = (Last created dialog item)
* Dialog - Create a Image for dialog (Last created dialog)
Dialog - Set (Last created dialog item) image to (Get Item Icon(CurrentItem)) for (Player group((Triggering player)))
Dialog - Set (Last created dialog item) size to (CUSTOM_ITEM_SIZE, CUSTOM_ITEM_SIZE) for (All players)
Dialog - Move (Last created dialog item) to ((xOffset + ITEM_ICON_OFFSET_X), (yOffset + ITEM_ICON_OFFSET_Y)) relative to Top Left of dialog for (All players)
* Variable - Set ItemIcons[loop][(Owner of (Triggering unit))] = (Last created dialog item)
Code:
General - For each integer loop from CUSTOM_VALUE_OFFSET to (CUSTOM_VALUE_OFFSET + Size) with increment 1, do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Custom value loop of (Triggering unit)) < 1.0
Then
Unit - Set Unit custom value loop to (Real((GetIntFromItem(Item Type))))
Variable - Set val = (loop - CUSTOM_VALUE_OFFSET)
UI - Display (Combine ("val: ", (Text(val)), ", player:", (Text(Player)))) for (All players) to Subtitle area
UI - Display (Tooltip of ItemBorders[loop][Player] for Player) for (All players) to Subtitle area
General - If (Conditions) then do (Actions) else do (Actions)
If
Item Type == ""
Then
Dialog - Set ItemBorders[val][Player] image to Assets\InventoryBorderEmpty.dds for (All players)
Dialog - Set ItemBorders[val][Player] hover image to Assets\InventoryBorderEmpty.dds for (All players)
Else
* Dialog - Set ItemBorders[val][Player] tooltip to (Format Tooltip(Item Type)) for (All players)
* Dialog - Set ItemIcons[val][Player] image to (Get Item Icon(Item Type)) for (All players)
* Dialog - Set ItemBorders[val][Player] image to Assets\InventoryBorderActive.dds for (All players)
* Dialog - Set ItemBorders[val][Player] hover image to Assets\InventoryBorderActiveHighlight.dds for (All players)
Else
The lines marked with stars are the ones causing the trouble.
This is the entire error log for the above script:
Code:
Trigger Error in 'gt_UpdateInventory_Func': Could not get 'triggerControl' from parameter in 'DialogControlGetPropertyAsText' (value: 0)
Trigger Error in 'gt_UpdateInventory_Func': Could not get 'text' from parameter in 'UIDisplayMessage' (value: 65535)
Trigger Error in 'gt_UpdateInventory_Func': Could not get 'triggerControl' from parameter in 'DialogControlSetPropertyAsString' (value: 0)
Trigger Error in 'gt_UpdateInventory_Func': Could not get 'triggerControl' from parameter in 'DialogControlSetPropertyAsString' (value: 0)
Trigger Error in 'gt_UpdateInventory_Func': Could not get 'triggerControl' from parameter in 'DialogControlSetPropertyAsText' (value: 0)
Trigger Error in 'gt_UpdateInventory_Func': Could not get 'triggerControl' from parameter in 'DialogControlSetPropertyAsString' (value: 0)
Even if I use a custom 'test' variable that isn't used anywhere else it will still throw this error.
The dialog is never destroyed.
Any help would be greatly appreciated.