What is wrong with this trigger, it gives me an error

X-maul

AKA: Demtrod
Reaction score
201
I keep getting this error when my trigger is run:
Error:
Code:
Trigger Error in 'gt_PreviewKarass_Func': Could not get 'triggerControl' from parameter in 'DialogControlSetPropertyAsBool' (value: 0)
Trigger:
  • Preview Karass
    • Events
    • Local Variables
      • x = 0 <Integer>
    • Conditions
    • Actions
      • Dialog - Hide Current Image[Player] for (Player group(Player))
      • Dialog - Hide Current Selection Button[Player] for (Player group(Player))
      • Dialog - Hide Current Text[Player] for (Player group(Player))
      • ------- Show
      • Dialog - Show Karass Select for (Player group(Player))
      • Variable - Set Current Selection Button[Player] = Karass Select
      • Dialog - Show Karass Dialog Text for (Player group(Player))
      • Variable - Set Current Text[0] = Karass Dialog Text
      • Dialog - Show Karass Image for (Player group(Player))
      • Variable - Set Current Image[Player] = Karass Image
      • General - For each integer x from 0 to 4 with increment 1, do (Actions)
        • Actions
          • Dialog - Hide Current Ability[x][Player] for (Player group(Player))
          • Dialog - Show Karass A[x] for (Player group(Player))
          • Variable - Set Current Ability[x][Player] = Karass A[x]
The "Player" integer is set in a previos trigger and that should not be the problem.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
It's complaining that you're using an invalid "triggercontrol"(which is just another word for "Dialog item").

In this case, I'd say it's because you're trying to do something to a dialog item variable that doesn't really refer to an actual dialog item. Imagine you created a "dialog item" variable called TestTriggerControl and tried to show it with the "Show/Hide Dialog Item" action. Since you haven't set it yet, it doesn't refer to a dialog item yet so it will give an error very similar to the one you got.

Now, why does this happen? It's hard to say without seeing all the triggers but you should check that all the variables actually refer to dialog items. You could start with printing out debug messages between each row so you can see which row it comes to before crashing. When you know which row it crashes on, print out the array indices you're using("Player" and possibly "x") before the row. Finally, check in your other triggers that you actually set the variable with those array indices to a dialog item.
 

X-maul

AKA: Demtrod
Reaction score
201
How do I print debug messages? I checked all variables used in the trigger, and they are all set before the trigger is used.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
There's an action called "Debug Message". Even if the variables you're using for the array indices are set it doesn't mean the dialog item at that slot is set.

Let's say you have a dialog item array with the size 3 called "Foo". If you set Foo[0] to a dialog item, it doesn't mean you can do stuff to Foo[1] since it doesn't refer to something.
 

Dave312

Censored for your safe viewing
Reaction score
269
Just an FYI - you can also use the debug window to determine the current value of variables. However currently this window does not display the values of arrays.
 

X-maul

AKA: Demtrod
Reaction score
201
Okay, I know it's not the same trigger, but it's more to make you show me how it should be done:
I got this trigger and it gives me 4 of those errors on map start (It is run on map start by another trigger)
Trigger:
  • Init Ability Icon
    • Events
    • Local Variables
      • x = 0 <Integer>
    • Conditions
    • Actions
      • Dialog - Create a label for dialog SelectionDialog with the dimensions (50, 50) anchored to Bottom Right with an offset of (65, 230) with the text "[R]" color set to White text writeout set to False with a writeout duration of 2.0
      • Dialog - Create a label for dialog SelectionDialog with the dimensions (50, 50) anchored to Bottom Right with an offset of (175, 230) with the text "[E]" color set to White text writeout set to False with a writeout duration of 2.0
      • Dialog - Create a label for dialog SelectionDialog with the dimensions (50, 50) anchored to Bottom Right with an offset of (290, 230) with the text "[W]" color set to White text writeout set to False with a writeout duration of 2.0
      • Dialog - Create a label for dialog SelectionDialog with the dimensions (50, 50) anchored to Bottom Right with an offset of (395, 230) with the text "[Q]" color set to White text writeout set to False with a writeout duration of 2.0
      • Dialog - Create a label for dialog SelectionDialog with the dimensions (100, 50) anchored to Bottom Right with an offset of (485, 230) with the text "Passive" color set to White text writeout set to False with a writeout duration of 2.0
      • ------- Karass
      • General - For each integer x from 0 to 4 with increment 1, do (Actions)
        • Actions
          • Dialog - Create an image for dialog SelectionDialog with the dimensions (100, 100) anchored to Bottom Right with an offset of ((50 + (110 * x)), 160) setting the tooltip to Karass D[x] using the image Assets\Textures\icon-energy-protoss.dds as a Normal type with tiled set to False tint color White and blend mode Normal
          • Dialog - Hide (Last created dialog item) for (All players)
          • Variable - Set Karass A[x] = (Last created dialog item)
          • Dialog - Create an image for dialog SelectionDialog with the dimensions (100, 100) anchored to Bottom Right with an offset of ((50 + (110 * x)), 160) setting the tooltip to Schlar D[x] using the image Assets\Textures\icon-energy-protoss.dds as a Normal type with tiled set to False tint color White and blend mode Normal
          • Dialog - Hide (Last created dialog item) for (All players)
          • Variable - Set Schlar A[x] = (Last created dialog item)
          • Dialog - Create an image for dialog SelectionDialog with the dimensions (100, 100) anchored to Bottom Right with an offset of ((50 + (110 * x)), 160) setting the tooltip to Hrun D[x] using the image Assets\Textures\icon-energy-protoss.dds as a Normal type with tiled set to False tint color White and blend mode Normal
          • Dialog - Hide (Last created dialog item) for (All players)
          • Variable - Set Hrun A[x] = (Last created dialog item)
          • Dialog - Create an image for dialog SelectionDialog with the dimensions (100, 100) anchored to Bottom Right with an offset of ((50 + (110 * x)), 160) setting the tooltip to Tinker D[x] using the image Assets\Textures\icon-energy-protoss.dds as a Normal type with tiled set to False tint color White and blend mode Normal
          • Dialog - Hide (Last created dialog item) for (All players)
          • Variable - Set Tinker A[x] = (Last created dialog item)
          • Dialog - Create an image for dialog SelectionDialog with the dimensions (100, 100) anchored to Bottom Right with an offset of ((50 + (110 * x)), 160) setting the tooltip to Malqi D[x] using the image Assets\Textures\icon-energy-protoss.dds as a Normal type with tiled set to False tint color White and blend mode Normal
          • Dialog - Hide (Last created dialog item) for (All players)
          • Variable - Set Malqi A[x] = (Last created dialog item)
          • Dialog - Create an image for dialog SelectionDialog with the dimensions (100, 100) anchored to Bottom Right with an offset of ((50 + (110 * x)), 160) setting the tooltip to Tinker D[x] using the image Assets\Textures\icon-energy-protoss.dds as a Normal type with tiled set to False tint color White and blend mode Normal
          • Dialog - Hide (Last created dialog item) for (All players)
          • Variable - Set Tinker A[x] = (Last created dialog item)
          • Dialog - Create an image for dialog SelectionDialog with the dimensions (100, 100) anchored to Bottom Right with an offset of ((50 + (110 * x)), 160) setting the tooltip to Malqi D[x] using the image Assets\Textures\icon-energy-protoss.dds as a Normal type with tiled set to False tint color White and blend mode Normal
          • Dialog - Hide (Last created dialog item) for (All players)
          • Variable - Set Malqi A[x] = (Last created dialog item)
          • Dialog - Create an image for dialog SelectionDialog with the dimensions (100, 100) anchored to Bottom Right with an offset of ((50 + (110 * x)), 160) setting the tooltip to Gunnar D[x] using the image Assets\Textures\icon-energy-protoss.dds as a Normal type with tiled set to False tint color White and blend mode Normal
          • Dialog - Hide (Last created dialog item) for (All players)
          • Variable - Set Gunnar A[x] = (Last created dialog item)
          • Dialog - Create an image for dialog SelectionDialog with the dimensions (100, 100) anchored to Bottom Right with an offset of ((50 + (110 * x)), 160) setting the tooltip to Xenon D[x] using the image Assets\Textures\icon-energy-protoss.dds as a Normal type with tiled set to False tint color White and blend mode Normal
          • Dialog - Hide (Last created dialog item) for (All players)
          • Variable - Set Xenon A[x] = (Last created dialog item)
          • Dialog - Create an image for dialog SelectionDialog with the dimensions (100, 100) anchored to Bottom Right with an offset of ((50 + (110 * x)), 160) setting the tooltip to Enzi D[x] using the image Assets\Textures\icon-energy-protoss.dds as a Normal type with tiled set to False tint color White and blend mode Normal
          • Dialog - Hide (Last created dialog item) for (All players)
          • Variable - Set Enzi A[x] = (Last created dialog item)
          • Dialog - Create an image for dialog SelectionDialog with the dimensions (100, 100) anchored to Bottom Right with an offset of ((50 + (110 * x)), 160) setting the tooltip to Zetax D[x] using the image Assets\Textures\icon-energy-protoss.dds as a Normal type with tiled set to False tint color White and blend mode Normal
          • Dialog - Hide (Last created dialog item) for (All players)
          • Variable - Set Zetax A[x] = (Last created dialog item)
          • Dialog - Create an image for dialog SelectionDialog with the dimensions (100, 100) anchored to Bottom Right with an offset of ((50 + (110 * x)), 160) setting the tooltip to Helios D[x] using the image Assets\Textures\icon-energy-protoss.dds as a Normal type with tiled set to False tint color White and blend mode Normal
          • Dialog - Hide (Last created dialog item) for (All players)
          • Variable - Set Helios A[x] = (Last created dialog item)
          • Dialog - Create an image for dialog SelectionDialog with the dimensions (100, 100) anchored to Bottom Right with an offset of ((50 + (110 * x)), 160) setting the tooltip to Balthu D[x] using the image Assets\Textures\icon-energy-protoss.dds as a Normal type with tiled set to False tint color White and blend mode Normal
          • Dialog - Hide (Last created dialog item) for (All players)
          • Variable - Set Balthu A[x] = (Last created dialog item)
      • Dialog - Set Karass A[4] image to Assets\Textures\btn-tips-ripfield.dds for (All players)
      • Dialog - Set Karass A[3] image to Assets\Textures\btn-tips-ripfield.dds for (All players)
      • Dialog - Set Karass A[2] image to Assets\Textures\btn-tips-ripfield.dds for (All players)
      • Dialog - Set Karass A[1] image to Assets\Textures\btn-tips-ripfield.dds for (All players)
      • Dialog - Set Karass A[0] image to Assets\Textures\btn-tips-ripfield.dds for (All players)
      • Dialog - Set Schlar A[4] image to Assets\Textures\btn-upgrade-zerg-metabolicboost.dds for (All players)
      • Dialog - Set Schlar A[3] image to Assets\Textures\btn-ability-zerg-banelingspooge.dds for (All players)
      • Dialog - Set Schlar A[2] image to Assets\Textures\btn-ability-zerg-banelingspooge.dds for (All players)
      • Dialog - Set Schlar A[1] image to Assets\Textures\btn-upgrade-zerg-seismicspines.dds for (All players)
      • Dialog - Set Schlar A[0] image to Assets\Textures\btn-upgrade-zerg-pathogenglands.dds for (All players)
      • Dialog - Set Hrun A[4] image to Assets\Textures\btn-upgrade-zerg-meleeattacks-leve3.dds for (All players)
      • Dialog - Set Hrun A[3] image to Assets\Textures\btn-ability-zerg-frenzied-color.dds for (All players)
      • Dialog - Set Hrun A[2] image to Assets\Textures\btn-unit-zerg-baneling.dds for (All players)
      • Dialog - Set Hrun A[1] image to Assets\Textures\btn-unit-zerg-baneling.dds for (All players)
      • Dialog - Set Hrun A[0] image to Assets\Textures\btn-unit-zerg-ultralisk.dds for (All players)
      • Dialog - Set Tinker A[4] image to Assets\Textures\btn-upgrade-terran-reapernitropacks.dds for (All players)
      • Dialog - Set Tinker A[3] image to Assets\Textures\btn-ability-terran-spidermine.dds for (All players)
      • Dialog - Set Tinker A[2] image to Assets\Textures\btn-lostvinking-bomb.dds for (All players)
      • Dialog - Set Tinker A[1] image to Assets\Textures\btn-lostvinking-bomb.dds for (All players)
      • Dialog - Set Tinker A[0] image to Assets\Textures\btn-ability-terran-nuclearstrike-color.dds for (All players)
      • Dialog - Set Malqi A[4] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Malqi A[3] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Malqi A[2] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Malqi A[1] image to Assets\Textures\btn-ability-zerg-transfusion-color.dds for (All players)
      • Dialog - Set Malqi A[0] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Gunnar A[4] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Gunnar A[3] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Gunnar A[2] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Gunnar A[1] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Gunnar A[0] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Xenon A[4] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Xenon A[3] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Xenon A[2] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Xenon A[1] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Xenon A[0] image to Assets\Textures\btn-ability-protoss-wormholetransit-color.dds for (All players)
      • Dialog - Set Enzi A[4] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Enzi A[3] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Enzi A[2] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Enzi A[1] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Enzi A[0] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Zetax A[4] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Zetax A[3] image to Assets\Textures\btn-ability-zerg-rapidregeneration-color.dds for (All players)
      • Dialog - Set Zetax A[2] image to Assets\Textures\btn-upgrade-protoss-shieldslevel3.dds for (All players)
      • Dialog - Set Zetax A[1] image to Assets\Textures\btn-upgrade-protoss-shieldslevel3.dds for (All players)
      • Dialog - Set Zetax A[0] image to Assets\Textures\btn-upgrade-protoss-shieldslevel3.dds for (All players)
      • Dialog - Set Helios A[4] image to Assets\Textures\btn-upgrade-terran-shipplatinglevel3.dds for (All players)
      • Dialog - Set Helios A[3] image to Assets\Textures\btn-tips-walloffire.dds for (All players)
      • Dialog - Set Helios A[2] image to Assets\Textures\btn-upgrade-terran-shipplatinglevel3.dds for (All players)
      • Dialog - Set Helios A[1] image to Assets\Textures\btn-upgrade-terran-shipplatinglevel3.dds for (All players)
      • Dialog - Set Helios A[0] image to Assets\Textures\btn-upgrade-terran-shipplatinglevel3.dds for (All players)
      • Dialog - Set Krain A[4] image to Assets\Textures\btn-upgrade-terran-shipplatinglevel3.dds for (All players)
      • Dialog - Set Krain A[3] image to Assets\Textures\btn-upgrade-terran-shipplatinglevel3.dds for (All players)
      • Dialog - Set Krain A[2] image to Assets\Textures\btn-upgrade-terran-shipplatinglevel3.dds for (All players)
      • Dialog - Set Krain A[1] image to Assets\Textures\btn-upgrade-terran-shipplatinglevel3.dds for (All players)
      • Dialog - Set Krain A[0] image to Assets\Textures\btn-upgrade-terran-shipplatinglevel3.dds for (All players)
      • Dialog - Set Balthu A[4] image to Assets\Textures\btn-upgrade-terran-shipplatinglevel3.dds for (All players)
      • Dialog - Set Balthu A[3] image to Assets\Textures\btn-unit-zerg-infestedmarine.dds for (All players)
      • Dialog - Set Balthu A[2] image to Assets\Textures\btn-ability-zerg-neuralparasite-color.dds for (All players)
      • Dialog - Set Balthu A[1] image to Assets\Textures\btn-ability-zerg-neuralparasite-color.dds for (All players)
      • Dialog - Set Balthu A[0] image to Assets\Textures\btn-ability-zerg-neuralparasite-color.dds for (All players)
How would you put those Debug messages and how should they look? they need some text and I dont know what to put there:eek:

NOTE: All the variables in here got array size of 5

EDIT:
Figured what was wrong with the trigger, but I'd still like to know how to use the debug action.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
Basically just enter any text in the debug message action and it'll write it out for you when it reaches that row.

If you have a trigger that's crashing but you don't know where, you can create debug messages between each row that looks something like: "Mark 1", "Mark 2", "Mark 3" and so on. Then when you run the trigger it'll spam you with those messages until it reaches the row that crashes the trigger and then you wont get any more messages.

So if it printed out all messages including "Mark 5", you know the error is after the debug message that prints "Mark 5".
 

X-maul

AKA: Demtrod
Reaction score
201
Well, as far as i know it does not crash? it just... well gives me an error and keeps on functioning?
 

X-maul

AKA: Demtrod
Reaction score
201
right now the trigger giving me errors looks like this:
Trigger:
  • Preview Karass
    • Events
    • Local Variables
      • x = 0 <Integer>
    • Conditions
    • Actions
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • Current Image[Player] == No Dialog Item
        • Then
        • Else
          • Dialog - Hide Current Image[Player] for (Player group(Player))
          • Dialog - Hide Current Selection Button[Player] for (Player group(Player))
          • Dialog - Hide Current Text[Player] for (Player group(Player))
      • ------- Show
      • Dialog - Show Karass Select for (Player group(Player))
      • Variable - Set Current Selection Button[Player] = Karass Select
      • Dialog - Show Karass Dialog Text for (Player group(Player))
      • Variable - Set Current Text[Player] = Karass Dialog Text
      • Dialog - Show Karass Image for (Player group(Player))
      • Variable - Set Current Image[Player] = Karass Image
      • General - For each integer x from 0 to 4 with increment 1, do (Actions)
        • Actions
          • General - If (Conditions) then do (Actions) else do (Actions)
            • If
              • Current Ability[Player][x] == No Dialog Item
            • Then
            • Else
              • Dialog - Hide Current Ability[Player][x] for (Player group(Player))
          • Dialog - Show Karass A[x] for (Player group(Player))
          • Variable - Set Current Ability[Player][x] = Karass A[x]
And it shows all the "Karass A[x]" and sets the "Current Ability[x]"
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top