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

[Solved] How to replace a unit with a random unit?

Status
Not open for further replies.
Level 14
Joined
May 9, 2021
Messages
263
Hello.

Basically my problem is that I've got a group of units already placed on my map that act as random spawn points for the Player's unit. Currently, the RSP (Random Spawn Point) is replaced with a specific unit.

However, I want the RSP to be replaced with a random unit instead.

I understand that there's variables involved, but I've yet to find a good tutorial. If anyone can help, I'll really appreciate it :)
 
Level 30
Joined
Aug 29, 2012
Messages
1,382
You setup an unit-type variable with an array at initialization like this

1699627286489.png


And then you replace your unit with a random pick

1699627353952.png
 
Status
Not open for further replies.
Top