Dialog Stat System Help

wilze

Active Member
Reaction score
3
Im makeing a stat system where the player can add there own stats to thier hero...

PHP:
Add BTNS
    Events
        Unit - A unit Gains a level
    Conditions
    Actions
        Dialog - Change the title of Dialog to Input 2 New Stats t...
        Dialog - Create a dialog button for Dialog labelled |c0000FF00ACR
        Set DialogButtonACR[1] = (Last created dialog Button)
        Wait 0.05 seconds
        Dialog - Create a dialog button for Dialog labelled |c00FF0000STR
        Set DialogButtonMID[1] = (Last created dialog Button)
        Wait 0.05 seconds
        Dialog - Create a dialog button for Dialog labelled |c000000FFMID
        Set DialogButtonSTR[1] = (Last created dialog Button)
        Wait 0.05 seconds
        Trigger - Turn off (This trigger)

PHP:
Open Stat Dialog
    Events
        Unit - A unit Gains a level
    Conditions
        ((Leveling Hero) is A Hero) Equal to True
    Actions
        Dialog - Show Dialog for (Owner of (Leaving unit))

PHP:
Click Dialog Buttons
    Events
        Dialog - A dialog button is clicked for Dialog
    Conditions
        (Clicked dialog button) Equal to DialogButtonACR[1]
    Actions
        Hero - Modify Agility of (Random unit from CameraP1): Add 2

PHP:
Click Dialog Buttons Copy
    Events
        Dialog - A dialog button is clicked for Dialog
    Conditions
        (Clicked dialog button) Equal to DialogButtonMID[1]
    Actions
        Hero - Modify Intelligence of (Random unit from CameraP1): Add 2

PHP:
Click Dialog Buttons Copy 2
    Events
        Dialog - A dialog button is clicked for Dialog
    Conditions
        (Clicked dialog button) Equal to DialogButtonSTR[1]
    Actions
        Hero - Modify Strength of (Random unit from CameraP1): Add 2

Heres the problem: When I click a button the dialog closes but it dosent add stats... any suggestions?

thx for help.

wilze.
 

Frozenwind

System maker
Reaction score
99
Use
Code:
-tags!

These things I found don't really fit:
[SPOILER][CODE]Open Stat Dialog
    Events
        Unit - A unit Gains a level
    Conditions
        ((Leveling Hero) is A Hero) Equal to True
    Actions
        Dialog - Show Dialog for (Owner of ([B]Leaving unit[/B]))
You don't got a leaving unit at all.
Code:
Add BTNS
    Events
        Unit - A unit Gains a level
    Conditions
    Actions
        Dialog - Change the title of Dialog to Input 2 New Stats t...
        Dialog - Create a dialog button for Dialog labelled |c0000FF00ACR
        Set DialogButtonACR[1] = (Last created dialog Button)
        [B]Wait 0.05 seconds[/B]
        Dialog - Create a dialog button for Dialog labelled |c00FF0000STR
        Set DialogButtonMID[1] = (Last created dialog Button)
        [B]Wait 0.05 seconds[/B]
        Dialog - Create a dialog button for Dialog labelled |c000000FFMID
        Set DialogButtonSTR[1] = (Last created dialog Button)
        [B]Wait 0.05 seconds[/B]
        Trigger - Turn off (This trigger)
It seems like you want to show the dialog be4 finishing making all buttons?

Code:
Click Dialog Buttons
    Events
        Dialog - A dialog button is clicked for Dialog
    Conditions
        (Clicked dialog button) Equal to DialogButtonACR[1]
    Actions
        Hero - Modify Agility of (Random unit from [B]CameraP1[/B]): Add 2
Are you sure CameraP1 contains only 1 unit? --> your hero.[/SPOILER]
I'd do it like this:
Code:
Add BTNS
    Events
        Unit - A unit Gains a level
    Conditions
    Actions
        Dialog - Clear Dialog
        Dialog - Change the title of Dialog to Input 2 New Stats t...
        Dialog - Create a dialog button for Dialog labelled |c0000FF00ACR
        Set DialogButtonACR[1] = (Last created dialog Button)
        Dialog - Create a dialog button for Dialog labelled |c00FF0000STR
        Set DialogButtonMID[1] = (Last created dialog Button)
        Dialog - Create a dialog button for Dialog labelled |c000000FFMID
        Set DialogButtonSTR[1] = (Last created dialog Button)
        Dialog - Show Dialog for (Owner of (Leveling Hero))

frozenwind.

[size=+1]PS
You can merge your last 3 triggers into one...
Use "if then else".
[/size]
 

N2o)

Retired.
Reaction score
51
The way you've made this is not very sensible, i'll fix it up for you:
Code:
Dialog
    Events
        Unit - A unit Gains a level
    Conditions
    Actions
        Dialog - Clear Dailog
        Dialog - Change the title of Dialog to Input 2 New Stats t...
        Dialog - Create a dialog button for Dialog labelled |c0000FF00ACR|r
        Set DialogButton[0] = (Last created dialog Button)
        Dialog - Create a dialog button for Dialog labelled |c00FF0000STR|r
        Set DialogButton[1] = (Last created dialog Button)
        Dialog - Create a dialog button for Dialog labelled |c000000FFMID|r
        Set DialogButton[2] = (Last created dialog Button)
        Dialog - Show Dialog for (Owner of (Leveling Hero)
Code:
DialogPress
    Events
        Dialog - A dialog button is clicked for Dialog
    Conditions
    Actions
        If (Clicked Dialog Button) is equal to DialogButton[0]
        Then
           Hero - Modify Agility of Hero[Player number of (Triggering Player): Add 2
        Else
        If (Clicked Dialog Button) is equal to DialogButton[1]
        Then
           Hero - Modify Strength of Hero[Player number of (Triggering Player): Add 2
        Else
        If (Clicked Dialog Button) is equal to DialogButton[2]
        Then
           Hero - Modify Intelligence of Hero[Player number of (Triggering Player): Add 2
        Else
This will work for 1 hero a player you need to create a unit array variable and set each player's hero to it.
 
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