Home   Help Search Login Register  

Author Topic: Land or Sea  (Read 1562 times)

0 Members and 2 Guests are viewing this topic.

KEVIN_OFP

  • Guest
Land or Sea
« on: 20 Jan 2006, 15:45:50 »
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?

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Land or Sea
« Reply #1 on: 20 Jan 2006, 16:07:19 »
Take the random element out and use object IDs instead. Have Bob, go between different objects on the map. That's what I'd go for.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline rhysduk

  • Former Staff
  • ****
Re:Land or Sea
« Reply #2 on: 20 Jan 2006, 16:12:27 »
Congratulations on discovering this very useful feature in OFP, I myself have not tried it, but ill trust you on what you said. Im sure randomness is a great little extra for many missions.

Im not aware of any command or script that detects land or water. Im not sure, water can be "detected" as such in OFP (doesnt mean its not possible though), have you tried:

The Editors Depot?
ComRef?
Theres a very nice one that comes with CHOFPSE that I've found very useful.

Rhys
Reviewed Missions Board: Please Read the User's Guide before posting!

Pride and Joy 1 (HW100-T)

Uldics

  • Guest
Re:Land or Sea
« Reply #3 on: 20 Jan 2006, 16:26:21 »
As I know the land/sea is detectable, example: helodust script in some BAS addons gives white dust on water and brown on land.

If I remember there was something of placing a trigger or marker and setposing it to a 2D place (X,Y). The Z coordinate is added automatically and is allways at sea level. But ingame coordinate Z=0 at land level. So if land, Z<0.

I hope my memory is fine ...

KEVIN_OFP

  • Guest
Re:Land or Sea
« Reply #4 on: 20 Jan 2006, 16:31:32 »
Why didnt I think of it. Object ID.  Of course selecting objects that are on land.(thats why I am a llama)

I will check into CHOFPSE.  Thanks.


Kevin_ofp


Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Land or Sea
« Reply #5 on: 20 Jan 2006, 16:52:42 »
You can add a small random offset to the object ID as well, so that it doesn't look like he is going to the object.

Congratulations on discovering why this game is so exciting.   Yes, just think of the possibilities ....
Plenty of reviewed ArmA missions for you to play

Offline 456820

  • Contributing Member
  • **
Re:Land or Sea
« Reply #6 on: 20 Jan 2006, 17:37:26 »
couldnt you just use the Waypoint placement radius in the Waypoint box there should be a little option where you can fill in any number (not sure what the box is called) but if you put 100 in it and click okay
On the editor should be a normal waypoint with a circle around it that circle is the size you put in the box
This means that the soldier will move to anywhere randomly in that box

A hell lot easier if you ask me

Also this way you can see if the Waypoint is on water and change it until it isnt
Oh and correct me if im wrong but in my experience sodliers wont start running in the sea to get to their waypoint they will simply just say "Cant get there" and just stand there until instructed differently

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Land or Sea
« Reply #7 on: 20 Jan 2006, 19:37:42 »
I wrote a function that detects if a position is over water.  I am at work now and the function is on my computer at home, so I will give it to you as soon as I get home.

The function I wrote does not require the "precreation" of a game logic, also it detects tidal effects and therefore will works on beaches and near the shore line (with enough accuracy so that, at worst, a setPos man will get his feet wet - but never drown).  I have two versions of the function, one detects if an object is over/in water, the other detects if a position is over/in water.
« Last Edit: 20 Jan 2006, 21:03:58 by Raptorsaurus »

Offline Wadmann

  • OFPEC Patron
  • ****
  • I'm the next evolutionary step after a llama!
Re:Land or Sea
« Reply #8 on: 20 Jan 2006, 19:58:51 »
You could try this function by snYpir to determine if the unit/marker is over water.

Wadmann
Check out my Camouflage Collection! New items added 31 July 2005.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Land or Sea
« Reply #9 on: 21 Jan 2006, 20:55:47 »
And, if the waypoint is for men, they will not go into the water if even if you set 800 0000 0000 waypoints for them in the water, so no need for any 'in water' checks...

Only boats (obviously), amphibious land vehicles and air craft go positions that are in/over the water..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Land or Sea
« Reply #10 on: 22 Jan 2006, 19:44:46 »
I think that he wants to make sure the waypoint is placed in a spot that is not over water so that the units can go to the waypoint. If one of the waypoints is over water will the group "know" to skip to the next waypoint, or will they just hang up?  I have not tested this.

In any case, here is the function that detects if a unit or position is over water.  I have ziped it in with a simple demo mission.
« Last Edit: 22 Jan 2006, 19:45:10 by Raptorsaurus »

Offline XCess

  • Former Staff
  • ****
Re:Land or Sea
« Reply #11 on: 22 Jan 2006, 19:48:36 »
just tested it,they will run to the shore, which will complete the waypoint (even though they dont reach it), then go on to the next waypoint.