Home   Help Search Login Register  

Author Topic: Placement Radius  (Read 429 times)

0 Members and 2 Guests are viewing this topic.

Kammak

  • Guest
Placement Radius
« on: 14 Apr 2004, 09:10:04 »
Does this function properly?

I get far less than "random" results when I use it...the object only gets created at the maximum radius possible, and only along a small angle from the center point.

Just a fluke on my end, or is this  function not working properly? Or, is it only calculated once, and not each time the mission is run?

Ditto on waypoint timeouts - I seem to get very little variance despite large differences between the min and max.  What's up with these?


Offline SilentHunter

  • Members
  • *
  • frozen leg'o'lamb (every gamers most loved weapon)
Re:Placement Radius
« Reply #1 on: 14 Apr 2004, 10:07:57 »
Try putting this in the units init field,

this setpos [(getpos this select 0) + ((random 300) * sin (random 360)) , (getpos this select 1) + ((random 300) * cos (random 360)) , 0]

That will give you a random placement of 600 meters wide, (300 radius)
[size=4.5]NERDS HAVE FEELINGS TOO! [/size] [size=2.5]*adjusts glasses*[/size]

Offline SilentHunter

  • Members
  • *
  • frozen leg'o'lamb (every gamers most loved weapon)
Re:Placement Radius
« Reply #2 on: 14 Apr 2004, 10:11:02 »
Another thing, random numbers are generated in your cpu, to make sure its generating a wide range of random numbers,

make a script

#top
player groupchat format["%1", (random 300)]
~0.1
goto "top"

then see if it varies between 0 and 300
[size=4.5]NERDS HAVE FEELINGS TOO! [/size] [size=2.5]*adjusts glasses*[/size]