I need to find the nearest valid location to a given location if that location is not valid. I checked the lexicon and the function library and couldn't find one. Surely this function exists.
Thanks for help.
Matt
Is there a function that finds nearest valid location.
Débuté par
M. Rieder
, août 22 2010 02:48
#1
Posté 22 août 2010 - 02:48
#2
Posté 22 août 2010 - 03:11
Nevermind.
#3
Posté 22 août 2010 - 11:20
In the future, if you come up with an answer yourself, please post what that was. This is just so that others with the same question can come here and find out too.
I believe the function you were looking for is CalcSafeLocation()?
I believe the function you were looking for is CalcSafeLocation()?
#4
Posté 22 août 2010 - 01:11
I actually didn't find the function, I just scripted around the need for the function. Since my needs are pretty particular, I doubt they will be useful, but here it is:
I wanted a creature to move to a certain location or the nearest location to the intended location. The problem was that if the location was not valid, the creature would just stay put and not move at all.
So I used the #include position functions to set up a loop that incrementally deleted 0.1 from the distance to move until the location was valid, and it worked.
I don't have the code here in front of me and it is too complex for me to remember, but if anyone wants it, just send me a message.
I wanted a creature to move to a certain location or the nearest location to the intended location. The problem was that if the location was not valid, the creature would just stay put and not move at all.
So I used the #include position functions to set up a loop that incrementally deleted 0.1 from the distance to move until the location was valid, and it worked.
I don't have the code here in front of me and it is too complex for me to remember, but if anyone wants it, just send me a message.
#5
Posté 22 août 2010 - 01:12
Yeah, CalcSafeLocation() sounds about right. I always get hung up looking for functions that start with "get" when I want information returned to me. Thanks Knightmare.
#6
Posté 22 août 2010 - 01:34
NP. And yeah, when using the Script Assist filter, do like you might when trying to Google a subject, try different word/search terms using the "best" words first. In your example above searching for "location" will give you all the functions that deal with that sort of thing.
#7
Posté 22 août 2010 - 04:37
Good advice. Thanks.





Retour en haut






