Dialog/Unit Help and Explanation

N2o)

Retired.
Reaction score
51
I was thinking about doing a Final Fantasy Style Game with different units and w/e. So i made a dialog that could show infinate units and give me a maximum of 6 units per side. well thats the idea. For some reason however if i press next on my dialog to show more units then it goes onto player 2. and i can choose 6 units. If i do not press next and choose my first unit from my first dialog then when i try to choose my 2nd unit the dialog buttons go blank, this is hard to explain so i will show you a screenshot.
http://img166.imageshack.us/img166/3773/dialogzu9.jpg
Here are my codes:
Code:
Melee Initialization
    Events
        Map initialization
    Conditions
    Actions
        Melee Game - Use melee time of day (for all players)
        Set Chooses[0] = Footman
        Set Chooses[1] = Knight
        Set Chooses[2] = Rifleman
        Set Chooses[3] = Mortar Team
        Set Chooses[4] = Flying Machine
        Set Chooses[5] = Gryphon Rider
        Set Chooses[6] = Priest
        Set Chooses[7] = Sorceress
        Set Chooses[8] = Siege Engine
        Set Chooses[9] = Spell Breaker
        Set Chooses[10] = Dragonhawk Rider
        Set Chooses[11] = Paladin
        Set Chooses[12] = Archmage
        Set Chooses[13] = Peasant
        Set Chooses[14] = Archmage
        Set Chooses[15] = Mountain King
        Set Chooses[16] = Blood Mage
        Set Chooses[17] = Peon
        Wait 1.00 seconds
        Trigger - Run Pick <gen> (ignoring conditions)
        Custom script:   call DestroyTrigger (GetTriggeringTrigger())
Code:
Pick
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                UnitNumber Less than 6
            Then - Actions
                Dialog - Clear Dialog
                Dialog - Change the title of Dialog to ((Choose your Unit  + (String((UnitNumber + 1)))) + !)
                For each (Integer A) from 0 to 7, do (Actions)
                    Loop - Actions
                        Dialog - Create a dialog button for Dialog labelled (String(Chooses[((Integer A) + Plusser)]))
                        Set DialogButton[(Integer A)] = (Last created dialog Button)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Plusser Less than 100
                    Then - Actions
                        Dialog - Create a dialog button for Dialog labelled Next
                        Set DialogButton[8] = (Last created dialog Button)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Plusser Greater than 0
                    Then - Actions
                        Dialog - Create a dialog button for Dialog labelled Back
                        Set DialogButton[9] = (Last created dialog Button)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        UnitNumber Greater than 0
                    Then - Actions
                        Dialog - Create a dialog button for Dialog labelled Finish
                        Set DialogButton[10] = (Last created dialog Button)
                    Else - Actions
                Dialog - Show Dialog for Player 1 (Red)
            Else - Actions
                Dialog - Clear Dialog
                Dialog - Create a dialog button for Dialog labelled Finish
                Set DialogButton[10] = (Last created dialog Button)
                Dialog - Show Dialog for Player 1 (Red)
Code:
Picked
    Events
        Dialog - A dialog button is clicked for Dialog
    Conditions
    Actions
        For each (Integer A) from 0 to 7, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Clicked dialog button) Equal to DialogButton[(Integer A)]
                    Then - Actions
                        Set UnitNumber = (UnitNumber + 1)
                        Set MaxUnits[Player] = UnitNumber
                        Unit - Create 1 Chooses[((Integer A) + Plusser)] for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
                        If (Player Equal to 1) then do (Set P1Units[UnitNumber] = (Last created unit)) else do (Set P2Units[UnitNumber] = (Last created unit))
                        Trigger - Run Pick <gen> (ignoring conditions)
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButton[8]
            Then - Actions
                Set Plusser = (Plusser + 8)
                Trigger - Run Pick <gen> (ignoring conditions)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButton[9]
            Then - Actions
                Set Plusser = (Plusser - 8)
                Trigger - Run Pick <gen> (ignoring conditions)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButton[10]
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Player Equal to 1
                    Then - Actions
                        Game - Display to (All players) the text: Test
                        Set Player = (Player + 1)
                        Set UnitNumber = 0
                        Trigger - Run Pick <gen> (ignoring conditions)
                    Else - Actions
            Else - Actions
Variables: Chooses - Unit Type Array
UnitNumber - Integer
Player - Integer
Dialog - Dialog
DialogButton - Dialog Button Array
P1Units - Unit Array
P2Units - Unit Array
Can anybody help?
 
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