- Joined
- Jul 28, 2014
- Messages
- 29
Hey I'm working on a map Octagon TD, which randomly generates mazing towers similar to the map, mazing contest.
My question is I can't figure out a good way to generate the towers exactly the same way for each person, towers would be placed on top of other towers causing them to be placed next to each other in random spots that are different for each player, I was thinking some how one could save each coordinate using hashtables so that no two coordinates are used twice but I can't figure out how.
This what I have so far -
Set Zrocks = (Random integer number between 50 and 200)
For each (Integer A) from 1 to Zrocks, do (Actions)
Loop - Actions
Set X = (64.00 x (Random real number between 0.00 and 34.00))
Set Y = (-64.00 x (Random real number between 0.00 and 76.00))
Set Z = (Random integer number between 1 and 4)
Unit - Create 1 RandomRocks[Z] for Player 1 (Red) at ((Center of Red Random <gen>) offset by (X, Y)) facing Default building facing degrees
Unit - Create 1 RandomRocks[Z] for Player 2 (Blue) at ((Center of Blue Random <gen>) offset by ((-1.00 x Y), X)) facing Default building facing degrees
My question is I can't figure out a good way to generate the towers exactly the same way for each person, towers would be placed on top of other towers causing them to be placed next to each other in random spots that are different for each player, I was thinking some how one could save each coordinate using hashtables so that no two coordinates are used twice but I can't figure out how.
This what I have so far -
Set Zrocks = (Random integer number between 50 and 200)
For each (Integer A) from 1 to Zrocks, do (Actions)
Loop - Actions
Set X = (64.00 x (Random real number between 0.00 and 34.00))
Set Y = (-64.00 x (Random real number between 0.00 and 76.00))
Set Z = (Random integer number between 1 and 4)
Unit - Create 1 RandomRocks[Z] for Player 1 (Red) at ((Center of Red Random <gen>) offset by (X, Y)) facing Default building facing degrees
Unit - Create 1 RandomRocks[Z] for Player 2 (Blue) at ((Center of Blue Random <gen>) offset by ((-1.00 x Y), X)) facing Default building facing degrees