OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: SilentHunter on 05 Mar 2005, 18:21:44

Title: Yes, its another SETPOS question
Post by: SilentHunter 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)
Title: Re:Yes, its another SETPOS question
Post by: dmakatra on 05 Mar 2005, 19:06:47
http://www.ofpec.com/editors/funcref.php?filter_func=23

:beat: *Gets Shot* :beat:
Title: Re:Yes, its another SETPOS question
Post by: Zombie 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]
Title: Re:Yes, its another SETPOS question
Post by: SilentHunter 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

Title: Re:Yes, its another SETPOS question
Post by: General Barron 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.
Title: Re:Yes, its another SETPOS question
Post by: SilentHunter 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