Page 1 of 1

randomally spawning ai

Posted: Tue May 18, 2004 9:46 pm
by Smeghead
Guys you have been a great source of info for me , thank you 1 and all. Now for my next question is it possible to have an ai bot spawn in a random position but stay there. So rather than it stay where i place it on the the map, is it possible for it to spawn in a certain radius of its start point. In real terms i place the spawn point behind the wall but give it a radius of 20m in which to actually spawn, is this possible?

origin

Posted: Tue May 18, 2004 10:35 pm
by tltrude
I guess you could move the origin of it around randomly.

Posted: Wed May 19, 2004 3:35 pm
by lizardkid
i know there's a rand(om) function somewhere in MOHScript, it's been used before. i've just never used it myself.

Posted: Wed May 19, 2004 5:10 pm
by blue60007
I think its

Code: Select all

randint (5)

It picks a random integer from 0 to 5.

Say you wanted a number between 2 and 7

Code: Select all


randint (5) + 2
I believe that was it.

Posted: Wed May 19, 2004 5:12 pm
by lizardkid
starts at 0 like C++ rand function right?

Posted: Wed May 19, 2004 10:34 pm
by blue60007
lizardkid wrote:starts at 0 like C++ rand function right?
Yep, just add on the minimum number you want it to be. Like and random number between 2 - 7 you would need to add 2 onto it so a zero would be a 2 and a 5 would be a 7.

Posted: Thu May 20, 2004 9:00 am
by jv_map
Yep, but it's 'randomint' or 'randomfloat' :wink: and you don't even need the parens () 8-)