Home   Help Search Login Register  

Author Topic: setPos many editor-placed-objects in their correct relative position  (Read 1950 times)

0 Members and 1 Guest are viewing this topic.

Offline zwobot

  • Members
  • *
Hello, I have built a small base with editor objects for my mission in the mission editor. Now I want to move all the objects to a different location at mission start because the position of the base should be variable (players have to search for it in the mission).

I thought to move the editor placed objects somewhere out of the mission area in the editor and then move all the objects to a game logic or marker which is picked randomly in the init.sqs; all in their correct relative position to each other of course.
So I guess in addition to the game logic which marks the new position for the base objects there needs to be another game logic (or any other object or a marker) as a kind of reference object which helps to find out the relative position of the objects and then setPos them to the same relative position to the game logic which marks the new location of the base.

Has anyone done something similar before and can share a script with me? I'm not very good in trigonometry, or maybe there is another solution which requires less complicated scripting? I'm open for suggestions...
"Executing tactics in real combat is the hardest thing one can ever do...well I've never given birth but..well whatever."

Offline dr. seltsam

  • Members
  • *
hi,

i made something, that maybe comes close to your request...

I build a little base by setpos'ing objects relative to an initial object. The scripts needs to know the initial object, the desired initial angle, and all x,y and z positions relative to the initial object. To avoid problems with objects with floor level, i build a few objects from above to down, sounds unlogic, but resolves the problems fine...

Do you have BAS Tonal ?? I build this base with Tonal objects. Try to move the initial object around. In most areas the base should be correct.
 :D

« Last Edit: 15 Jul 2008, 15:38:38 by dr. seltsam »

Offline zwobot

  • Members
  • *
Thanks I'll have a look at it.
By now I think I'll just do two different scripts for each location of the base and camCreate or setPos the objects there with positions from the mission.sqm
The more dynamic approach probably might look a bit akward because objects might be positioned in the middle of a street or so.
"Executing tactics in real combat is the hardest thing one can ever do...well I've never given birth but..well whatever."