• Check out the results of the Techtree Contest #19!
  • 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 void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Solved] [Trigger] Dice Movement

Status
Not open for further replies.
Level 3
Joined
Oct 13, 2014
Messages
14
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!
 
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
 
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?
 
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

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
 
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

Last edited:
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:
 

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