1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Weave light to take you to your highest hopes - the 6th Special Effect Contest is here!
    Dismiss Notice
  4. Lead your forces to battle in the 15th Techtree Contest. The call is yours, commander!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Dialog button help

Discussion in 'World Editor Help Zone' started by S11, May 11, 2012.

  1. S11

    S11

    Joined:
    Apr 29, 2012
    Messages:
    41
    Resources:
    0
    Resources:
    0
    Need help fixing .omg's Moded stat system, +Rep will be given

    So i asked .omg if i could mod his stat system to fix my liking and he had said yes so what i did was I Created this Dialog, with 4 options, str, int, agi, cancel.

    What i need Help with is

    -When you hit ESC it shows how many stat points you have in dialog box
    -When you spend a point it deducts it from the dialog and shows the new available stat points
    -Does not glitch out rapidly clicking esc
    -Does not glitch out dieing while putting stats in


    Problems with this Dialog button

    -Rapidly press ESC, stat system breaks
    -Die while doing stat points, Stat system yet again breaks

    Here are the codes

    • Stats Ini
      • Events
        • Map intialization
      • Conditions
        • none
      • Actions
        • Set MaxPlayersCount = 10
        • Set Stats_UnitType=____
        • -----count of unspent points when lvlup------
        • For each (Integer Index)from 1 to MaxPlayersCount, do (actions)
        • Loop - Actions
          • Set UnsuspentSP[index] = UP_Number
          • Set HeroLevel[index] = 1
        • Set Stats_Text[1] = |c00FF0000Strength|r :
        • Set Stats_Text[2] = |c0017CB33Agility|r :
        • Set Stats_Text[3] = |c001407A6intelligence|r :


    • Selection Clearing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • UnsuspentSP[(Player number of (Triggering player))] Greater than 0
        • Stats_Hero[(Player number of (Triggering player))] Not equal to No unit
        • (Stats_Hero[(Player number of (Triggering player))] is alive) Equal to True
      • Then - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Clicked dialog button) Equal to DialogButton[1]
          • Then - Actions
            • Set HeroStr[(Player number of (Triggering player))] = ((Strength of Stats_Hero[(Player number of (Triggering player))] (Exclude bonuses)) + 1)
            • Floating Text - Change text of Str_Floating_Text[(Player number of (Triggering player))] to (String(HeroStr[(Player number of (Triggering player))])) using font size Stats_Size
            • -------- - --------
            • Hero - Modify Strength of Stats_Hero[(Player number of (Triggering player))]: Add 1
            • Special Effect - Create a special effect attached to the PointSP of Stats_Hero[(Player number of (Triggering player))] using StrSP
            • Special Effect - Destroy (Last created special effect)
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Clicked dialog button) Equal to DialogButton[2]
          • Then - Actions
            • Set HeroAg[(Player number of (Triggering player))] = ((Agility of Stats_Hero[(Player number of (Triggering player))] (Exclude bonuses)) + 1)
            • Floating Text - Change text of Ag_Floating_Text[(Player number of (Triggering player))] to (String(HeroAg[(Player number of (Triggering player))])) using font size Stats_Size
            • -------- - --------
            • Hero - Modify Agility of Stats_Hero[(Player number of (Triggering player))]: Add 1
            • Special Effect - Create a special effect attached to the PointSP of Stats_Hero[(Player number of (Triggering player))] using AgSP
            • Special Effect - Destroy (Last created special effect)
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Clicked dialog button) Equal to DialogButton[3]
          • Then - Actions
            • Set HeroInt[(Player number of (Triggering player))] = ((Intelligence of Stats_Hero[(Player number of (Triggering player))] (Exclude bonuses)) + 1)
            • Floating Text - Change text of Int_Floating_Text[(Player number of (Triggering player))] to (String(HeroInt[(Player number of (Triggering player))])) using font size Stats_Size
            • -------- - --------
            • Hero - Modify Intelligence of Stats_Hero[(Player number of (Triggering player))]: Add 1
            • Special Effect - Create a special effect attached to the PointSP of Stats_Hero[(Player number of (Triggering player))] using IntSP
            • Special Effect - Destroy (Last created special effect)
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Clicked dialog button) Equal to DialogButton[4]
          • Then - Actions
            • Dialog - Hide MyDialog for (Triggering player)
          • Else - Actions
        • Set UnsuspentSP[(Player number of (Triggering player))] = (UnsuspentSP[(Player number of (Triggering player))] - 1)
        • Floating Text - Change text of Floating_Text_Array_Unsuspent[(Player number of (Triggering player))] to (String(UnsuspentSP[(Player number of (Triggering player))])) using font size UnspentSize
        • -------- - --------
        • Skip remaining actions
      • Else - Actions


    • ESC Selection
      • Events
        • Player - Player 1 (Red) skips a cinematic sequence
        • Player - Player 2 (Blue) skips a cinematic sequence
        • Player - Player 3 (Teal) skips a cinematic sequence
        • Player - Player 4 (Purple) skips a cinematic sequence
        • Player - Player 5 (Yellow) skips a cinematic sequence
        • Player - Player 6 (Orange) skips a cinematic sequence
        • Player - Player 7 (Green) skips a cinematic sequence
        • Player - Player 8 (Pink) skips a cinematic sequence
        • Player - Player 9 (Gray) skips a cinematic sequence
        • Player - Player 10 (Light Blue) skips a cinematic sequence
      • Conditions
      • Actions
        • Wait 0.03 seconds
        • Dialog - Clear MyDialog
        • Dialog - Change the title of MyDialog to Upgrade Stats
        • Dialog - Create a dialog button for MyDialog labelled Str
        • Set DialogButton[1] = (Last created dialog Button)
        • Dialog - Create a dialog button for MyDialog labelled Agi
        • Set DialogButton[2] = (Last created dialog Button)
        • Dialog - Create a dialog button for MyDialog labelled Int
        • Set DialogButton[3] = (Last created dialog Button)
        • Dialog - Create a dialog button for MyDialog labelled Cancel
        • Set DialogButton[4] = (Last created dialog Button)
        • Dialog - Show MyDialog for (Triggering player)
     
    Last edited: May 12, 2012
  2. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,174
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    To prevent ESC bugging, use a boolean array. In ESC selection, check if boolean[plr number] == false. If it is false then do the actions and set the boolean to true. If the boolean was true, don't do any actions. When a player exits the dialog, set the boolean to false.
     
  3. S11

    S11

    Joined:
    Apr 29, 2012
    Messages:
    41
    Resources:
    0
    Resources:
    0
    Thank you for that, but do you know how to make the number apear in the dialog box?

    -edit-

    i added in the boolean to esc selection and selection clearing and now when i click on a ablitly point to spend my ablity points it doesnt change my stats, and nor can i hit esc again ill show you the triggers

    -edit-

    i can spend the first 5 points and get my stats changed but once i spend all the points i can't hit essc anymore, even if i lvl, esc wont open dialog box

    • Selection Clearing Copy
      • Events
        • Dialog - A dialog button is clicked for MyDialog
      • Conditions
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • UnsuspentSP[(Player number of (Triggering player))] Greater than 0
            • Stats_Hero[(Player number of (Triggering player))] Not equal to No unit
            • (Stats_Hero[(Player number of (Triggering player))] is alive) Equal to True
          • Then - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Clicked dialog button) Equal to DialogButton[1]
              • Then - Actions
                • Set Boolean[(Player number of (Triggering player))] = False
                • Set HeroStr[(Player number of (Triggering player))] = ((Strength of Stats_Hero[(Player number of (Triggering player))] (Exclude bonuses)) + 1)
                • Floating Text - Change text of Str_Floating_Text[(Player number of (Triggering player))] to (String(HeroStr[(Player number of (Triggering player))])) using font size Stats_Size
                • -------- - --------
                • Hero - Modify Strength of Stats_Hero[(Player number of (Triggering player))]: Add 1
                • Special Effect - Create a special effect attached to the PointSP of Stats_Hero[(Player number of (Triggering player))] using StrSP
                • Special Effect - Destroy (Last created special effect)
              • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Clicked dialog button) Equal to DialogButton[2]
              • Then - Actions
                • Set Boolean[(Player number of (Triggering player))] = False
                • Set HeroAg[(Player number of (Triggering player))] = ((Agility of Stats_Hero[(Player number of (Triggering player))] (Exclude bonuses)) + 1)
                • Floating Text - Change text of Ag_Floating_Text[(Player number of (Triggering player))] to (String(HeroAg[(Player number of (Triggering player))])) using font size Stats_Size
                • -------- - --------
                • Hero - Modify Agility of Stats_Hero[(Player number of (Triggering player))]: Add 1
                • Special Effect - Create a special effect attached to the PointSP of Stats_Hero[(Player number of (Triggering player))] using AgSP
                • Special Effect - Destroy (Last created special effect)
              • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Clicked dialog button) Equal to DialogButton[3]
              • Then - Actions
                • Set Boolean[(Player number of (Triggering player))] = False
                • Set HeroInt[(Player number of (Triggering player))] = ((Intelligence of Stats_Hero[(Player number of (Triggering player))] (Exclude bonuses)) + 1)
                • Floating Text - Change text of Int_Floating_Text[(Player number of (Triggering player))] to (String(HeroInt[(Player number of (Triggering player))])) using font size Stats_Size
                • -------- - --------
                • Hero - Modify Intelligence of Stats_Hero[(Player number of (Triggering player))]: Add 1
                • Special Effect - Create a special effect attached to the PointSP of Stats_Hero[(Player number of (Triggering player))] using IntSP
                • Special Effect - Destroy (Last created special effect)
              • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Clicked dialog button) Equal to DialogButton[4]
              • Then - Actions
                • Set Boolean[(Player number of (Triggering player))] = False
                • Dialog - Hide MyDialog for (Triggering player)
              • Else - Actions
            • Set UnsuspentSP[(Player number of (Triggering player))] = (UnsuspentSP[(Player number of (Triggering player))] - 1)
            • Floating Text - Change text of Floating_Text_Array_Unsuspent[(Player number of (Triggering player))] to (String(UnsuspentSP[(Player number of (Triggering player))])) using font size UnspentSize
            • -------- - --------
            • Skip remaining actions
          • Else - Actions
        • Selection - Select Stats_Hero[(Player number of (Triggering player))] for (Triggering player)


    • ESC Selection Copy
      • Events
        • Player - Player 1 (Red) skips a cinematic sequence
        • Player - Player 2 (Blue) skips a cinematic sequence
        • Player - Player 3 (Teal) skips a cinematic sequence
        • Player - Player 4 (Purple) skips a cinematic sequence
        • Player - Player 5 (Yellow) skips a cinematic sequence
        • Player - Player 6 (Orange) skips a cinematic sequence
        • Player - Player 7 (Green) skips a cinematic sequence
        • Player - Player 8 (Pink) skips a cinematic sequence
        • Player - Player 9 (Gray) skips a cinematic sequence
        • Player - Player 10 (Light Blue) skips a cinematic sequence
      • Conditions
        • Boolean[(Player number of (Triggering player))] Equal to False
      • Actions
        • Set Boolean[(Player number of (Triggering player))] = True
        • Wait 0.03 seconds
        • Dialog - Clear MyDialog
        • Dialog - Change the title of MyDialog to Upgrade Stats
        • Dialog - Create a dialog button for MyDialog labelled Str
        • Set DialogButton[1] = (Last created dialog Button)
        • Dialog - Create a dialog button for MyDialog labelled Agi
        • Set DialogButton[2] = (Last created dialog Button)
        • Dialog - Create a dialog button for MyDialog labelled Int
        • Set DialogButton[3] = (Last created dialog Button)
        • Dialog - Create a dialog button for MyDialog labelled Cancel
        • Set DialogButton[4] = (Last created dialog Button)
        • Dialog - Show MyDialog for (Triggering player)
     
    Last edited: May 12, 2012
  4. water_Knight

    water_Knight

    Joined:
    Mar 22, 2008
    Messages:
    421
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Also take into note sometimes when you keep using dialogues they can freeze up the players game making them unable to control units.
     
  5. S11

    S11

    Joined:
    Apr 29, 2012
    Messages:
    41
    Resources:
    0
    Resources:
    0
    i realized that when i kept hitting esc, but thanks for the heads up
     
  6. MortAr

    MortAr

    Joined:
    Feb 25, 2009
    Messages:
    1,765
    Resources:
    7
    Icons:
    6
    Packs:
    1
    Resources:
    7
    Why do you re-create the dialog everytime you run it?
    You need to make it only once, even in initialization trigger, for better.

    Waits below 0.27 do not work, so you can remove that too.

    • Set HeroStr[(Player number of (Triggering player))] = ((Strength of Stats_Hero[(Player number of (Triggering player))] (Exclude bonuses)) + 1)


    Put that after all actions for Strenght and change it to:

    • Set HeroStr[(Player number of (Triggering player))] = (Strength of Stats_Hero[(Player number of (Triggering player)])


    You can do it for all others as well.

    Put an "Or - Any Conditions are True" here:
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Clicked dialog button) Equal to DialogButton[4]
    • Then - Actions
    • Set Boolean[(Player number of (Triggering player))] = False
    • Dialog - Hide MyDialog for (Triggering player)
    • Else - Actions


    And check when the player points are 0, this should fix the bug.
     
  7. S11

    S11

    Joined:
    Apr 29, 2012
    Messages:
    41
    Resources:
    0
    Resources:
    0
    What exactly do you mean check when player points are 0, oh do you know how i would put in player points into the dialog box?, and how would i make the diaglog box run only once
     
  8. MortAr

    MortAr

    Joined:
    Feb 25, 2009
    Messages:
    1,765
    Resources:
    7
    Icons:
    6
    Packs:
    1
    Resources:
    7
    You could check if the player has any points, so if there are no one left, close the dialog, instead of forcing the player to press the 'Cancel' button everytime.
     
  9. water_Knight

    water_Knight

    Joined:
    Mar 22, 2008
    Messages:
    421
    Resources:
    1
    Maps:
    1
    Resources:
    1
    A even easier way to say what MortAr said is

    It will check if you have 0 points and not give stats if you do
     
  10. S11

    S11

    Joined:
    Apr 29, 2012
    Messages:
    41
    Resources:
    0
    Resources:
    0
    hmm ill see what i can do with that , not exactly sure how to do that but ill try