OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Red Ant on 18 Sep 2005, 18:15:05
-
Hello,
I'm currently trying to place a bunch of resistance soldiers in that large building in the center of Lipany (Nogova map). I've tried two different methods to get the soldiers where I want them to be.
A) Create a temporary unti controlled by me and walk to the positions, then use a scripted radio command and the hint function to get my current coordinates and azimuth. Note the numbers down and then setpos() a soldier to that position in the initialization field in the editor.
B) Just get the coords of the position using the nearestbuilding() and buildingPos() functions and setpos my soldier to the position.
Now here's the problem(s) I've run into. With some of the building positions, especially the one that's basically on the roof of the building (great sniping position ;) ), neither method works and I think it's something to do with getpos() returning the z coord (height) relative to the floor I'm standing on rather than absolute, because if I go on the roof and use the radio trick to get my current coords, it'll always return something very close to zero (sometimes even slightly less than zero) even tho the roof is cearly higher up than that. Thus when I use the coords returned by getpos(), and then setpos() a unit there, it often ends up somewhere completely wrong! I tried guessing the correct height, but this didn't work very well either. Anyone know a solution to this problem? ???
-
Oh yeah, I forgot to say that the following
this setpos ( ( nearestbuilding this ) buildingPos 28 )
will teleport my soldier straight into the sea. But i know that building position #28 exists as it is displayed as house position #28 if I tell another soldier to go there.
-
for putting units inside the town hall, the technique of setpossing using experimentation and trial and error usually works fine. for putting dudes on the roof of the building it might be possible just to put them over the building to start with and then setting them as "flying".
-
It's not even neccessary to set them as flying.