Quote: "Just a code example would be great so I have something to work off.."
Well, this might help, thought.
I've attached script to the barrel.
You might have to improve it, and of course most likely there is a most complex way to get it, but I prefer start with the easier for you.
Using 6 neutral and 2 combat mutant soldiers.
Script is well commented, so it can help you as start point, at least I hope so.
local num_spawning = 0
local facing_angle = {}
local index = 0
local factor = 0
local ai_speed = 0
function spawn_random_init(e)
facing_angle[1] = 18
facing_angle[2] = 36
facing_angle[3] = 54
facing_angle[4] = 72
facing_angle[5] = 90
facing_angle[6] = 108
facing_angle[7] = 126
facing_angle[8] = 144
facing_angle[9] = 162
facing_angle[10] = 180
end
function spawn_random_main(e)
math.randomseed(os.clock()) -- the seed
num_spawning = math.random(3,10) -- my enemies are numbered 3 thru 10 . you might have to change it to fit yours needs --
for i = 3,num_spawning,1 do
math.randomseed(os.clock())
index = math.random(1,10) -- getting random facing_angle
factor = math.random(2,8) -- you can play with those values
ai_speed = math.random(1,3.5)-- ditto
pos_x = g_Entity[i]['x'] -- getting current posx
pos_z = g_Entity[i]['z'] -- getting current posz
new_pos_x = pos_x*factor -- getting random posx
new_pos_z = pos_z*factor-- ditto
Spawn(i) -- 1- I need a script to spawn a group of random(value) of enemies in a radius around a entity
AIEntityGoToPosition(i,new_pos_x,new_pos_z) -- 3- position
RotateToCamera(i,facing_angle[index]) -- 2- with each enemy having random facings
SetAnimationSpeedModulation(i,ai_speed) -- 4- random patrol speeds
end
Destroy(e)
end
3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz
OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4