Home   Help Search Login Register  

Author Topic: Yes, its another SETPOS question  (Read 1076 times)

0 Members and 1 Guest are viewing this topic.

Offline SilentHunter

  • Members
  • *
  • frozen leg'o'lamb (every gamers most loved weapon)
Yes, its another SETPOS question
« on: 05 Mar 2005, 18:21:44 »
This MUST have been asked @ least a million times b4 on ofp boards across the world, (and occasionally a CS board when 1 becomes a slash to drunk and forgets what game there scripting for). Point is, i couldn't find it on the ol' search thing so...

Does any1 know how to setpos from sea level and NOT from ground level

if anyone says it can't be done i'll crack you over the head with a frozen leg'o'lamb (every REAL gamers most loved weapon)

SILENTHUNTER

(why does no1 use this emo :afro:, its BLATANTLY the best 1 ever)
[size=4.5]NERDS HAVE FEELINGS TOO! [/size] [size=2.5]*adjusts glasses*[/size]

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Yes, its another SETPOS question
« Reply #1 on: 05 Mar 2005, 19:06:47 »

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:Yes, its another SETPOS question
« Reply #2 on: 05 Mar 2005, 19:34:31 »
the way I do it is to place a reference object at the shoreline, then when setpos'ing, do it like this:
 object setpos [getpos object select 0, getpos object select 1,(getpos reference) + height you want it]

Offline SilentHunter

  • Members
  • *
  • frozen leg'o'lamb (every gamers most loved weapon)
Re:Yes, its another SETPOS question
« Reply #3 on: 05 Mar 2005, 23:12:38 »
Sorry, that question probly sounded a bit stupid,

I negleted to mention i had writtian a simmiler equation to that function, (im a maths teacher)

But you'll notice there are slight variences as you go furthur accross the map (towards top right), this is due to the fact that flashpoint rounds number up after about 30sf. This may sound accurate enough to fire a pin between 2 atoms at 5000 meters, but when it starts dealing with square numbers n' stuff it dosent quite cut it.

I was in fact looking specificaly for a command that calculates the hight straight from sea level thus eradicating the need for triganometry, bottem line is,
(Function and code to that effect) == (not accurate enough)

Thanks @ dmakatra and zombie anyway

Initial question still exists though

SILENTHUNTER

[size=4.5]NERDS HAVE FEELINGS TOO! [/size] [size=2.5]*adjusts glasses*[/size]

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Yes, its another SETPOS question
« Reply #4 on: 06 Mar 2005, 03:30:37 »
Okay, there are two ways I know of to PLACE an object at sea level, anywhere on the map. First one is to create a trigger ("emptydetector"), then setpos it to the [x,y] location you want. Triggers are always at sea level. The other method is to camcreate a game logic at [x,y,0]. For some reason, when you camcreate a game logic, it will be created (z) meters above SEA level, instead of above ground level. After you create it, setpossing it around will result in the usual (z) meters above ground level.

So anyway, with that said, you should create an object at sea level, right under your [x,y] target position. Then, create a game logic and place it at GROUND level of your [x,y] position (using setpos; remember camcreating it will make it start from sea level). Then, use the distance command to find the vertical distance between the two objects. Once you know this (the elevation of the terrain), then the rest is cake.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline SilentHunter

  • Members
  • *
  • frozen leg'o'lamb (every gamers most loved weapon)
Re:Yes, its another SETPOS question
« Reply #5 on: 06 Mar 2005, 13:34:49 »
Thanks, Works perfectly

But i found when creating a trigger for some reason it sets the hight exactly 5 meters BELOW sea level???????

It all works though so i aint complaining

SILENTHUNTER
[size=4.5]NERDS HAVE FEELINGS TOO! [/size] [size=2.5]*adjusts glasses*[/size]