What I love about this game is that everytime I play the same mission (even small missions), different events occur, even with normal "MOVE' waypoints. Few day ago I got into scripting just to learn enough to be able to incorporate some random elements into my missions.
WOW , WOW, what I discovered will give my major missions totally different dimension now. A new world has opened in OFP !!!!!!!!
I do have a question, but first let me show you what I did. The result is very cool:
Let have a mission with only a single soldier(Bob) standing in the middle of a equilateral triangle. Bob has only two waypoints, one right in front of him(10 meters away) with ‘select type' = MOVE and the second one right behind him with ‘select type' = CYCLE. Now add three new markers on each corner of the triangle with names "Corner_1"; "Corner_2", and "Corner_3".
I put the following script on Bob's first Waypoint's(the one with Waypoint order = 0) Activation field:
[Bob, 1] setWPPos getMarkerPos (["Corner_1", "Corner_2", " Corner_3"] select (random 3))
The idea is that when the game starts, Bob will randomly go between three corners forever. I was so excited when it worked specially being my first scripting work. The other amazing thing that I discovered was that, every time I restart the mission Bob will go through different patterns.
Now think of the possibilities !!!!!!!!!!
Now here is my problem:
I want to expand this even furture by replacing the markers by random positions coordinates on the map: ( I have not tried this, there maybe syntax errors)
[Bob, 1] setWPPos [(random 10000), (random 10000), 1] Assuming map is 10000 by 10000 meters.
but I am afraid the position may land on water. How can I detect if a coordinate is on land or water?