This error is generated due to my "StartNodeCircle" region having a negative area. Its rare this error occurs but really I would prefer that it not fail. I believe the find random point in region does its own random loop till it finds a point that isnt in the negative area. Unfortunately the negative area is about 90% of the circle's area.
To get around this problem I have made a bunch of smaller regions that dont use negative areas. But I really would perfer this to work by using one big circle region with a large negative area.
Are you using several primitives (several circles or rectangles) for
StartNodeCircle?
"StartNodeCircle" is a region I have created from the terrain module. It is 240 width. It has a negative area that is 230 width that is centered on the region.
I get this error several times in a row because my code then verifies that the randomed point is valid for what I want to use it for. But when I recieve this error my code tends to fail handling it because the temp point wasnt set to a new random point due to the random point procedure failing.
Well, to circumvent the message you can deactivate trigger error messages when saving :p
Or start a loop of random points in the area without negatives and check them with the negative area. Let the loop continue, until a valid random point was found. Same method as the trigger currently uses, but you would not be limited to 32 tries and wouldn't get an error message.
Or store all valid cordinate ranges and determine the point by picking random numbers of those coordinates.
€ hardly possible for a circle, though
Well, to circumvent the message you can deactivate trigger error
messages when saving :p
Or start a loop of random points in the area without negatives and check
them with the negative area. Let the loop continue, until a valid random
point was found. Same method as the trigger currently uses, but you
would not be limited to 32 tries and wouldn't get an error message.
Or store all valid cordinate ranges and determine the point by picking
random numbers of those coordinates.
€ hardly possible for a circle, though
Well yes how I currently do it is with smaller areas with no negative areas. Basically I want all the points in the other area of the circle region to be possible.
It seems that when this random point function fails it causes problems with the rest of my code. It seems to set the TempPoint variable to = 0.0 rather then keep its current value of "No Point", which is what I think is causing a bit of trouble.
Im gonna keep debugging it and adding to this topic.
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
Having negative areas or several different regions is the problem here. The point function surrenders after x unsucessful tries.
Well, let's start with what you actually want to achieve.. maybe we can figure out a better way, because there isn't any really good way to get rid of this problem.
On first glance it sounds like you want to find a point within a certain distance of the center point of the region?
Kinda yeah S3rius. Im shooting for something that can be really random. Unfortunatly the built in random point function seems to random the points in the negative areas, and then it verifies if they are in a negative area or not. If after 32 tries it doesnt find a value in the negative error it returns a point value of 0,0.
Ive found that i can check to see if the temppoint = 0,0 so it keeps randoming for a new points. So I figured that out. I guess to handle the error spam from the failing function I could disable the error messages. But generally I perfer to leave error messages on and just fix them. Looks like there isnt much I can do about this error message through. Unless someone wants to write a better Random point function in script that returns a value of "no point" after so many tries with out an error message?
This error is generated due to my "StartNodeCircle" region having a negative area. Its rare this error occurs but really I would prefer that it not fail. I believe the find random point in region does its own random loop till it finds a point that isnt in the negative area. Unfortunately the negative area is about 90% of the circle's area.
To get around this problem I have made a bunch of smaller regions that dont use negative areas. But I really would perfer this to work by using one big circle region with a large negative area.
"StartNodeCircle" is a region I have created from the terrain module. It is 240 width. It has a negative area that is 230 width that is centered on the region.
I get this error several times in a row because my code then verifies that the randomed point is valid for what I want to use it for. But when I recieve this error my code tends to fail handling it because the temp point wasnt set to a new random point due to the random point procedure failing.
Are you using several primitives (several circles or rectangles) for StartNodeCircle?
Well, to circumvent the message you can deactivate trigger error messages when saving :p
Or start a loop of random points in the area without negatives and check them with the negative area. Let the loop continue, until a valid random point was found. Same method as the trigger currently uses, but you would not be limited to 32 tries and wouldn't get an error message.
Or store all valid cordinate ranges and determine the point by picking random numbers of those coordinates.
€ hardly possible for a circle, though
Well yes how I currently do it is with smaller areas with no negative areas. Basically I want all the points in the other area of the circle region to be possible.
It seems that when this random point function fails it causes problems with the rest of my code. It seems to set the TempPoint variable to = 0.0 rather then keep its current value of "No Point", which is what I think is causing a bit of trouble.
Im gonna keep debugging it and adding to this topic.
Having negative areas or several different regions is the problem here. The point function surrenders after x unsucessful tries.
Well, let's start with what you actually want to achieve.. maybe we can figure out a better way, because there isn't any really good way to get rid of this problem.
On first glance it sounds like you want to find a point within a certain distance of the center point of the region?
Kinda yeah S3rius. Im shooting for something that can be really random. Unfortunatly the built in random point function seems to random the points in the negative areas, and then it verifies if they are in a negative area or not. If after 32 tries it doesnt find a value in the negative error it returns a point value of 0,0.
Ive found that i can check to see if the temppoint = 0,0 so it keeps randoming for a new points. So I figured that out. I guess to handle the error spam from the failing function I could disable the error messages. But generally I perfer to leave error messages on and just fix them. Looks like there isnt much I can do about this error message through. Unless someone wants to write a better Random point function in script that returns a value of "no point" after so many tries with out an error message?
@SouLCarveRR: Go
Can be done much easier:
This selects a random point around the originPoint in a distance between 15 and 20. (the function is called Point With Polar Offset)
@s3rius: Go
Yeah that would avoid the point failure Im having.
Prolly would speed up the process too. Its funny how the random point from region doesnt handle the negative areas very well. Oh well.
Yeah this way is much simpler and faster.