The waitUntil is just a precaution, it isn't essential. Edited July 16, 2010 by Muzzleflash Ok, thanx man. If search for suitable position failed, defaultPos position will be used. Use it and don't miss the precizePos parameter. Used hint to look at what the array containd, but it was blank.
I'm trying to redo the logic behind the mission systems, so if there is a better way to get the center of the map, I'd rather use it. It wouldn't be useful to place unit or waypoint near the center of the island just for a sake of placing it. Yes I can see the dilemma too. It's right now sitting next to the initPlayerLocal. If it fails then the patrol will head towards the center of the island, making this worthless in high density areas like the jungle. By default there is the center marker and also spawn position for players are different markers I think. So apparantly my script dont find the roads.
It's quick, it's dirty, but it'll run and should work. I want the missions to still work on every map, so I can't use static coordinates. Any chance you could share this? I'd suggest just writing your own function for your needs. I though it is something like that. This script itself is not very cpu-intensive; it makes a maximum of 1000 point checks with a square and some rectangles that blacklist and a few checks. Somehow it's in a continious loop and never stops.
A good idea in this example might actually be, to not use equal distribution since you get more positions in the center. The blacklist seems to be coordinates which form a rectangle that defines an area you do not wish to get a position from. Ryko did a quick hack to stop everyone moaning; well, at least he was trying to. That can be helpful sometimes. Actually it appears in can find a position in the corner of that square where the distance is larger than maxdist. If the position is farther away than minDist and some other checks pass eg. If anyone could help that would be great.
Changed the names a bit to make it easier for me. Example 3: Works much the same as example 2 but spawns groups of troops instead. I'll be honest, I have not tested this, but the theory is about right. I could do something similar in my function but I'd like to try what I attempted originally. The file was easy enough with the. I pulled it apart, but you can take it from here.
If not simply do not use the foreach. Somewhat new to scripting so sorry if I don't understand how to get it to work. Shore mode The point of that function is to find a safe position near a point and not all over the map. Then you just make that number of attempts. I have Plot for Life, Plot Management, Door Management, etc installed.
When I get home I will shoot it off to you if you still want it. I'd like to somehow make them spawn at sea level or not on top of mountains. There are cookies for logged in users and for commenters. Instead of having the officer spawn in the same place every playthrough, I want him to spawn randomly in certain buildings that I designate. Spawn a minimum of 4,000 meters away from Center Spawn a maximum of 20,000 meters away from Center Spawn at least 10 meters from the nearest object Not spawn in water Terrain i don't quite understand, can it be an altitude? I have got vehicles spawning fine on my server but can not work out why boats wont spawn. Additionally, generated position could be checked against the list of blacklisted positions blacklistPos. The function can additionally be instructed to generate position specifically on water or land waterMode or on a shoreline shoreMode.