You may wonder what this shall be, so let me introduce first to my basic idea:
I wanted to be able to check what region a given party is into (for example if player is in snake land, or ashenborn etc..). Based on this i want to further improve my Unique Battlefields idea (region specific battlefields).
Now to implement this i wanted to put hidden partys at the regions border points and check if the player is inside the n-poly this forms.
The solution is to break this down further and make a check if the player is inside a given triangle.
Based on this article: http://www.blackpawn.com/texts/pointinpoly/default.html
i tried my own implementation into the module-system.
After some problems (ms dont let me use floating point variables) i finally have a working algorithm.
Now we could use this for a lot of stuff.
Basicly it just checks if a party A is inside the triangle formed from party B,C and D...
This can be either towns etc.. but also moving parties like lords.
Maybe this is usefull for other stuff too like AI-coding, rumors-coding (rumors based on the land you are in) etc...
Currently the code is still in development, but i wanted to share my first working version:
You pass 4 party id´s .. the first is the party which shall get tested.
reg0 will be 0 if its failed and 1 if its inside the triangle.
(gt, reg0, 0),
(display_message, "@Test passed..."),
(display_message, "@Test failed..."),