[Solved] [Trigger] Dice Movement

Status
Not open for further replies.
Level 3
Joined
Oct 13, 2014
Messages
15
Hello!

For the last few hours I've been working on making a sorta fun little drinking game, that you play in single player mode.

So, I'm trying to work something out where when a player hits the dices (activated by an ability), a random number (2-12) is rolled,
the unit moves that amount of fields forward on the "board".

Dicesg-AME.png


Here's a preview of the map so far:

Dicesg-AME2.jpg


Each color represents a different type of event (white is random).

What would be the way to approach this?
Thanks!
 
Level 14
Joined
Nov 4, 2006
Messages
1,241
first thing that comes to mind is to give each circle an integer variable number and then order your unit to move to the next one

you can store the dice number in a variable and reduce it by 1 each time a circle is reached, so your unit moves along the path one by one until the counter reaches zero

you also need to track where the unit currently is at
 
Level 3
Joined
Oct 13, 2014
Messages
15
first thing that comes to mind is to give each circle an integer variable number and then order your unit to move to the next one

you can store the dice number in a variable and reduce it by 1 each time a circle is reached, so your unit moves along the path one by one until the counter reaches zero

you also need to track where the unit currently is at

Hi! Thanks for the quick response!
Could you perhaps give an example on how to store the units in an integer?
I have 142 circles.
Do i make a unit varible for each circle and bind them to an integer or how?
 
Level 14
Joined
Nov 4, 2006
Messages
1,241
here you go, i know the setup will be a little tedious with 142 circles, but i don't have a better approach for now, i hope most things are self explanatory, obviously you have to adjust some numbers to fit your game
the reset cooldown is to prevent people from rolling the dice while the unit is still walking

hope this helps.

PS: i kinda like the idea, i may even go for a boardgame type game like this myself at some point :)
 

Attachments

  • board game.w3x
    18.9 KB · Views: 6
Level 3
Joined
Oct 13, 2014
Messages
15
here you go, i know the setup will be a little tedious with 142 circles, but i don't have a better approach for now, i hope most things are self explanatory, obviously you have to adjust some numbers to fit your game
the reset cooldown is to prevent people from rolling the dice while the unit is still walking

hope this helps.

PS: i kinda like the idea, i may even go for a boardgame type game like this myself at some point :)

That's so awesome! :wgrin: And just what i needed, thanks a bunch!

I do have a problem which I'm unable to figure out how to solve.
For some reason my peon stops at the first circle every time.

aaa.JPG

AAAAA.JPG
 

Uncle

Warcraft Moderator
Level 71
Joined
Aug 10, 2018
Messages
7,640
Here's a more advanced example map going off of what UreDe4D was kind enough to get started. It'll definitely be a bit more confusing than his map, especially if you're still learning, but I figured I would provide a more advanced option that could serve useful down the line. (Also, it was a lot of fun to make)

I recommend some of the techniques here, particularly using an Ability to control movement. It gives you far greater control, for example you now have an Event for detecting when a unit reaches a new position.
 

Attachments

  • Board Game Example 2.w3x
    23.8 KB · Views: 5
Last edited:
Level 3
Joined
Oct 13, 2014
Messages
15
Here's a more advanced example map going off of what UreDe4D was kind enough to get started. It'll definitely be a bit more confusing than his map, especially if you're still learning, but I figured I would provide a more advanced option that could serve useful down the line. (Also, it was a lot of fun to make)

I recommend some of the techniques here, particularly using an Ability to control movement. It gives you far greater control and an Event for detecting when a unit reaches a new position.
Thank you, it is working now thanks to @UreDe4D, but I'm always up for learning some more, I'll take a look :wthumbsup:
 
Level 3
Joined
Oct 13, 2014
Messages
15

:fp: Here's the map for anyone interested
Thanks for the help!
 
Status
Not open for further replies.
Top