Okay so I want to display a units static portrait in a dialog window as a dialog item. I have a custom function to return the selected units portrait image. I can get the image to display on screen but not as a dialog item image.
Here is the debug message:
"00:00:01.50 Trigger Error in 'gt_SelectUnit_Func': Could not get 'triggerControl' from parameter in 'DialogControlSetPropertyAsString' (value: 0)"
Here are the triggers...
Select Unit
Events
Unit Selection - Any Unit is Selected by player Any Player
Local Variables
_unit = (Triggering unit) <Unit>
Conditions
Actions
Variable - Set TargetImage = (GetUnitPortraitImage(_unit))
Dialog - Set TargetDialogs[(Triggering player)].TargetPic image to TargetImage for (Player group((Triggering player)))
Dialog - Display image 1 of size (237, 360) with image TargetImage using blend mode Normal at Right with (400, 0)
GetUnitPortraitImage
Options: Function
Return Type: File - Image
Parameters
Unit = No Unit (Unit)
Grammar Text: GetUnitPortraitImage(Unit)
Hint Text: (None)
Custom Script Code
Local Variables
PortraitModel = (Value of Actors (String((Unit type of Unit))) "PortraitModel" for player (Owner of Unit)) <String>
PortraitImage = (Value of Models PortraitModel "Image" for player (Owner of Unit)) "<String>
Actions
General - Return lv_portraitImage
Okay so I want to display a units static portrait in a dialog window as a dialog item. I have a custom function to return the selected units portrait image. I can get the image to display on screen but not as a dialog item image.
Here is the debug message:
"00:00:01.50 Trigger Error in 'gt_SelectUnit_Func': Could not get 'triggerControl' from parameter in 'DialogControlSetPropertyAsString' (value: 0)"
Here are the triggers...
Select Unit
Events
Unit Selection - Any Unit is Selected by player Any Player
Local Variables
_unit = (Triggering unit) <Unit>
Conditions
Actions
Variable - Set TargetImage = (GetUnitPortraitImage(_unit))
Dialog - Set TargetDialogs[(Triggering player)].TargetPic image to TargetImage for (Player group((Triggering player)))
Dialog - Display image 1 of size (237, 360) with image TargetImage using blend mode Normal at Right with (400, 0)
GetUnitPortraitImage
Options: Function
Return Type: File - Image
Parameters
Unit = No Unit (Unit)
Grammar Text: GetUnitPortraitImage(Unit)
Hint Text: (None)
Custom Script Code
Local Variables
PortraitModel = (Value of Actors (String((Unit type of Unit))) "PortraitModel" for player (Owner of Unit)) <String>
PortraitImage = (Value of Models PortraitModel "Image" for player (Owner of Unit)) "<String>
Actions
General - Return lv_portraitImage
that error only appears if you are addressing a dialog or dialog item that does not exist. This includes trying to change the size or show/hide-ing a non-existent dialog or dialog item.
My suspicion would be, recheck if you've created "TargetDialogs" (thats a global variable right?).
Bingo Zolstice, the initialization was wrong. Led me to see a lot of errors in the way I am linking my triggers/a.d./functions together. The damn dialog didnt even exist. spent about 3 hours trying to solve this stupid problem too. Thanks! haha, alls well that ends well.
Bingo Zolstice, the initialization was wrong. Led me to see a lot of errors in the way I am linking my triggers/a.d./functions together. The damn dialog didnt even exist. spent about 3 hours trying to solve this stupid problem too. Thanks! haha, alls well that ends well.
alrighttt. I guess there was some use Blizz added those error messages in 1.4 when doing stuff to non-existent dialogs loll =P. In my case i purposely show-hide a bunch dialogs (i didnt care whether its created or not) without checking if it existed with if then else statements. Resulted in the error messages flooding my map when the patch hit lol.
anyhow, good that its helping your triggering :)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Okay so I want to display a units static portrait in a dialog window as a dialog item. I have a custom function to return the selected units portrait image. I can get the image to display on screen but not as a dialog item image.
Here is the debug message:
"00:00:01.50 Trigger Error in 'gt_SelectUnit_Func': Could not get 'triggerControl' from parameter in 'DialogControlSetPropertyAsString' (value: 0)"
Here are the triggers...
Select Unit
Events
Unit Selection - Any Unit is Selected by player Any Player
Local Variables
_unit = (Triggering unit) <Unit>
Conditions
Actions
Variable - Set TargetImage = (GetUnitPortraitImage(_unit))
Dialog - Set TargetDialogs[(Triggering player)].TargetPic image to TargetImage for (Player group((Triggering player)))
Dialog - Display image 1 of size (237, 360) with image TargetImage using blend mode Normal at Right with (400, 0)
GetUnitPortraitImage
Options: Function
Return Type: File - Image
Parameters
Unit = No Unit (Unit)
Grammar Text: GetUnitPortraitImage(Unit)
Hint Text: (None)
Custom Script Code
Local Variables
PortraitModel = (Value of Actors (String((Unit type of Unit))) "PortraitModel" for player (Owner of Unit)) <String>
PortraitImage = (Value of Models PortraitModel "Image" for player (Owner of Unit)) "<String>
Actions
General - Return lv_portraitImage
The variable target image is
TargetImage = No File <File - Image>
I thought i posted this.. must of hit preview instead... but I wanted to credit Tolkfan for the function. A link to an example map showing off his function working: http://www.sc2mapster.com/forums/development/triggers/24409-getting-portraits-models-from-unit-type/
that error only appears if you are addressing a dialog or dialog item that does not exist. This includes trying to change the size or show/hide-ing a non-existent dialog or dialog item.
My suspicion would be, recheck if you've created "TargetDialogs" (thats a global variable right?).
Bingo Zolstice, the initialization was wrong. Led me to see a lot of errors in the way I am linking my triggers/a.d./functions together. The damn dialog didnt even exist. spent about 3 hours trying to solve this stupid problem too. Thanks! haha, alls well that ends well.
alrighttt. I guess there was some use Blizz added those error messages in 1.4 when doing stuff to non-existent dialogs loll =P. In my case i purposely show-hide a bunch dialogs (i didnt care whether its created or not) without checking if it existed with if then else statements. Resulted in the error messages flooding my map when the patch hit lol.
anyhow, good that its helping your triggering :)