Getting a random datablock
by Dave D · in Torque Game Engine · 09/26/2005 (1:32 pm) · 2 replies
I tried searching the forums for some chunk of code that will allow me to pick a random datablock. What I am trying to do is have one spawn marker for a vehicle, but have it spawn a random vehicle. Any snipplets of code that show hw to get a random datablock would be helpful.
Torque 3D Owner Tom Ogburn
Starlit Sky Games
vehicle[1] = datablock_car
vehicle[2] = datablock_truck
....
vehicle[5] = datablock_motorcycle
spawn vehicle[getRandom(5)]