SC2Mapster Forums

Development > Triggers

[solved, for sure(i think)] Dialog not showing with more than 1 person.

  • 8 posts
    #1 Jan 01, 2013 at 17:00 UTC - 0 likes

    Like the title says my dialog won't show if there is more than 1 person in the game.

    This dialog is based on the Basic dialog part 1

    Variables

    User selection Dialog=no dialog<dialog>

    Function: User selection dialog-create

    Local Variables nRows = (Ceiling(((Real(nUnit Buttons)) / (Real(nCols))))) <Integer>

    Dialog Width = (+ (cDialog Extra, ((+ (cButton Size, cButton Gap)) * nCols))) <Integer>

    Dialog Height = (+ (cDialog Extra, ((+ (cButton Size, cButton Gap)) * nRows))) <Integer>

    x = cDialog Border <Integer>

    y = cDialog Border <Integer>

    iRow = 0 <Integer>

    iCol = 0 <Integer>

    iButton = 0 <Integer>

    Actions

    Dialog - Create a Modal dialog of size (Dialog Width, Dialog Height) at (0, 0) relative to Center of screen

    Variable - set user selection dialog = (last created dialog)

    General - For each integer iRow from 1 to nRows with increment 1, do (Actions)

    Actions

    Variable - Set x = cDialog Border

    General - For each integer iCol from 1 to nCols with increment 1, do (Actions)

    Actions

    General - If (Conditions) then do (Actions) else do (Actions)

    If

    iButton < nUnit Buttons

    Then

    Dialog - Create a button for dialog (Last created dialog) with the dimensions (cButton Size, cButton Size) anchored to Top Left with an offset of (x, y) setting the tooltip to Unit Buttons[iButton].Tooltip with button text "" and the hover image set to ""

    Dialog - Create an image for dialog (Last created dialog) with the dimensions (cIcon Size, cIcon Size) anchored to Top Left with an offset of ((+ (x, cButton Inlay)), (+ (y, cButton Inlay))) setting the tooltip to "" using the image Unit Buttons[iButton].Icon as a Normal type with tiled set to false tint color White and blend mode Normal

    Else

    Variable - Modify x: + (+ (cButton Size, cButton Gap))

    Variable - Modify iButton: + 1

    Variable - Modify y: + (+ (cButton Size, cButton Gap))

    End

    I then call it up in my own trigger

    Trigger: Start of game

    Event: Map initialization Actions:

    Initialize unit buttons () User selection dialog create () Dialog - show user selection dialog for (active players)

    End

    When i play by my self they show up, but when i add other people they don't show at all. Any ideas?

    Last edited Jan 02, 2013 by willuwontu
    • Dialog.jpg
    • Call.jpg
    #3 Jan 02, 2013 at 03:48 UTC - 0 likes

    Instead of showing the user selection dialog to active players try a loop and select each individual player. I don't know why this would work (but is worth a try) though.

    Current Project: SquadCraft 2
    Project Page
    Feedback Thread
    Latest Video
    Published Regions: SEA, NA, EU, KOR
    Status: Open Beta

    #4 Jan 02, 2013 at 05:56 UTC - 0 likes

    Thanks for the suggestion. After finding a good spot to place it, (wanted to nest it in a funtion i had already) it worked. (nope nvm now) IDK why don't ask me, but editor is weird about that for some reason. All my other dialog is shown 1 by 1 in my map so i never had problems with any others, but yeah 1 by 1 is the way.

    Last edited Jan 02, 2013 by willuwontu
    #5 Jan 02, 2013 at 06:10 UTC - 0 likes

    Nvm still not working, aaaargh

    I'll get back to working on this in the morning.

    Last edited Jan 02, 2013 by willuwontu
    #6 Jan 02, 2013 at 13:54 UTC - 0 likes

    Your variables are wrong. Your setting the variable "unit selection dialog" and then calling "user selection dialog" which do not match. If is this not it please post the actual text from the editor.

    Last edited Jan 02, 2013 by hobbidude

    When I want your opinion...I'll give it to you!

    http://www.sc2pod.com/achievement.php?id=13361

    #7 Jan 02, 2013 at 15:41 UTC - 0 likes

    Sorry bout that, it was supposed to be user selection dialog up there. Just wasn't thinking when I typed it I guess. Fixed it now though.

    #8 Jan 02, 2013 at 16:45 UTC - 0 likes

    Is the custom dialog function threaded, because that might make it show for only a few people (also trying putting the show action inside of the function at the end). Other than that i can only think of the use of active players instead of all players or a predefined group which tend to work better especially in editor testing.

    Last edited Jan 02, 2013 by hobbidude
    #9 Jan 02, 2013 at 18:30 UTC - 0 likes

    I was doing active players before T_T. But I"VE GOT IT FIXED NOW :). Trieva got me on the right path for fixing it. I had to do it individually, but the for player group loop didn't work, i had to do a for each integer from 1 to 15 inc 1. With an if then checking if the status of the player was that he was playing. Then show it to player x. I attached a picture to explain better.

    Last edited Jan 02, 2013 by willuwontu
    • Finished.jpg
  • 8 posts

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