• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] randomly generating tower maze question

Status
Not open for further replies.
Level 3
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
 
Level 3
Joined
Jul 28, 2014
Messages
29
I have it set up so player 1's area is vertical, spawns come from the bottom and end at the top. However player 2's area is horizontal, spawns come from the right and end at the left..
So I had to do some math to get the created towers in the proper spot for player 2.
 
Status
Not open for further replies.
Top