• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Board Game Help

Status
Not open for further replies.
Level 17
Joined
Feb 11, 2011
Messages
1,860
How would i make a unit move a certain number of spaces depending on what it rolled?

You would probably need to set each space as a region variable:

  • Map Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Space[1] = Space 1 <gen>
      • Set Space[2] = Space 2 <gen>
      • Set Space[3] = Space 3 <gen>
      • Set Space[4] = Space 4 <gen>
      • Set Space[5] = Space 5 <gen>
      • do this for all your spaces........
Then, when they roll the dice you issue the unit to move to another region. For example:

  • Roll Dice
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Roll Dice
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 6) Equal to 1
        • Then - Actions
          • Set Temp_Integer = 1
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 5) Equal to 1
            • Then - Actions
              • Set Temp_Integer = 2
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 4) Equal to 1
                • Then - Actions
                  • Set Temp_Integer = 3
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Random integer number between 1 and 3) Equal to 1
                    • Then - Actions
                      • Set Temp_Integer = 4
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Random integer number between 1 and 2) Equal to 1
                        • Then - Actions
                          • Set Temp_Integer = 5
                        • Else - Actions
                          • Set Temp_Integer = 6
      • Set Temp_Point = (Center of Space[Current_Space[(Player number of (Owner of (Triggering unit)))]])
      • Set Current_Space[(Player number of (Owner of (Triggering unit)))] = (Current_Space[(Player number of (Owner of (Triggering unit)))] + Temp_Integer)
      • Unit - Order <your_unit> to Move To Temp_Point
      • Custom script: call RemoveLocation(udg_Temp_Point)

Note: The trigger is considering you can roll a number from 1 to 6.
Let me know if you need more help.

- Mr_Bean

EDIT: Fixed the Roll Dice trigger.
 
Last edited:
Status
Not open for further replies.
Top