SC2Mapster Forums

Development > Triggers

[Trigger] [solved]Choices

  • 6 posts
    #1 Nov 22, 2012 at 23:31 UTC - 0 likes

    Hello, My name is Joe and I am very new to the map editor and have a question with the triggers for my map.

    I am making a TD/Survival map but i cannot figure out how to make an option box. I want to make a  box that pops up with two[2] clickable options. option 1 would run trigger 1 for the TD and option 2 would run trigger 1 for the survival part of the map. I know it is possible and probably very easy i am just missing it and any help would be awesome. I am taking a class in college where this map is part of my final project (we got to pick which game we could make a custom in).

    #2 Nov 23, 2012 at 01:14 UTC - 0 likes

    @KillerJoe1273: Go

    In the starcraft 2 map editor these are called dialogs (the background for menus) and dialog items which you attach to dialogs (which include buttons, images, text boxes etcetc).

    Happy googling -> http://lmgtfy.com/?q=starcraft+2+galaxy+editor+dialog+tutorial

    :)

    #3 Nov 23, 2012 at 13:02 UTC - 0 likes

    @KillerJoe1273: Go

    I'd suggest you to read this tutorial :) http://www.thehelper.net/threads/triggers-a-beginners-guide-to-dialogs.149621/

    #4 Nov 23, 2012 at 20:44 UTC - 0 likes

    Awesome thanks guys it helped a ton but i am getting a trigger error that i cannot seem to solve. When i use the action hide dialog box for all players i get the following error...

    "Set trigger error in 'gt_selection_func': could not get triggerDialog from parameter in DialogsetimageVisible (value:0) near line 97 in gt_selection_func() in mapScript_galaxy"

    Ive tried 2 different ways to hide the dialog box, Ive hidden the buttons then the box. Ive tried hiding the background for the box but that didn't seem to work either. Any suggestions/ideas???

    #5 Nov 24, 2012 at 00:51 UTC - 0 likes

    Welcome to sc2mapster! Feel free to send me a PM if you have any questions or concerns :)

    This error means that you're trying to hide the dialog box, but it can't find the dialog that you're asking it to hide. My guess is that you used "Triggering Dialog" or "Last Created Dialog" here, which would cause this error.

    If that's the case, you'll need to assign your dialog to a global variable, and then reference that variable later. For example:

    // Dialog Creation Trigger
    Create Dialog with offsets (whatever) anchored to (whatever) with size (whatever) // You already did this part
    Set Variable (My Dialog Variable) to Dialog (Last Created Dialog) // This is the line you need to add, so sc2 can remember which dialog is which for later
    
    // Now when you need to hide the dialog... 
    (Hide) Dialog (My Dialog Varaible) for players (All Players) // We tell it to hide the dialog we saved in the variable earlier
    

    If you can't figure it out, please post a screenshot of your trigger. It's a bit tricky to diagnose the problem without seeing the trigger itself.

    Last edited Nov 24, 2012 by zeldarules28
    Send me a PM with any questions or comments.

    Learn about HotS mods, publishing, and regions here

    #6 Nov 24, 2012 at 18:20 UTC - 0 likes

    Thank you very much that solved my error. I had referenced the dialog before but when i was trying to hide it I forgot to select the variable, i just had it at last created.

    Thanks again.

  • 6 posts

You must login to post a comment. Don't have an account? Register to get one!