| 08-18-2004, 03:27 AM | #1 |
I'm making a map where units come out of one of four regions. I want them to come out randomly between these regions, which are made in a + pattern, where the ends of the plus sign signify the regions. The units, once created, have the sole objective of going to the middle of the plus sign. I know how to do that, but getting them to come out randomly from four different places has got me stumped. |
| 08-18-2004, 04:09 AM | #2 |
I'm doing this off the top of my head so work with me. First u need to make a region variable and call it RandomSpawn and turn on array. Code:
Set variables
Events-Map Intialization
conditions-none
actions- set RandomSpawn[0] to your region1
actions- set RandomSpawn[1] to your region2
actions- set RandomSpawn[2] to your region3
actions- set RandomSpawn[3] to your region4
Spawn
Events- Periodic timer (or wutever uwant it to be) every 1 second of the game
conditions-none (or wutever u want here)
Actions-Spawn 1 (your unit) at RandomSpawn[Random integer between 0 and 3] |
