I am utterly clueless as to how I would go about coding this. Is there a way to test if a vector is in a valid location (I.E. three yards into the blackspace of a wall?)
Testing Validity of a Vector
#1
Posté 01 février 2016 - 11:51
#2
Posté 02 février 2016 - 12:45
well... option 1 is to create an invisible creature on those coords and then get her location and compare it - if it differs the vector is in nonwalkable spot.
option2 is nwnx it has GetSurfaceMaterial function which can be used to test this
#3
Posté 04 février 2016 - 04:47
I use option 1 for my Rift System in my PW.
At random intervals, a random area is chosen (above ground, outdoors)
Then a random location is selected -
I spawn an invisible creature, get its location then destroy the creature.
If the location's X and Y do not match the vector I targetted, then I know that the location was not valid.
The thing to remember about Z axes is that even a little bit of debris or change in elevation on the ground can affect the Z axes of the creatures standing location.
So you might want to disregard the Z part of the vector, or at the very least append some buffer to the z axes if you are planning on spawning anything in the air at that location.
Eg: I do : Z = creatureLocation.Z+4; or something like that.
Result is a rift system that spawns at always 'valid' locations. (Note - it can still spawn in inaccessible areas though)
Below is an early POC I did (before it was refined) - I was planning on using tilemagic to turn water in the area to lava when a fire rift spawned etc
#4
Posté 04 février 2016 - 07:26
Thanks guys, this was tremendously helpful. Option 2 was used, I believe.





Retour en haut







