Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Object adapt to terrain

  1. #1

    Object adapt to terrain

    Hi all, i've got a problem.
    I'm making a hostage rescue mission with alot of infantry inside the building (75), for the building I used MAP Editorupgrade (EU) mod so I have access to all objects in the editor, worked great, when i (manually) created 9 soldiers, i stored the rest of the coords (66 left) and so I wanted to test it with a friend, unfortunately he cannot join because he also requires the map editor upgrade mod, but I don't want people to download my mod, yet I want to keep the building, so instead of keeping that building, i replaced it with something small like a can, and then used this line: bld="Land_A_BuildingWIP" createvehicle (getposasl this);bld setdir (getdir this);, Now that I tested again, the building is there, but its straight. it didnt adapt to the terrain it was on, which was a small sort of hill, so the infantry were badly misplaced, and therefor i can say goodbye to my 75 manually made coords inside the building, I really hope that the only issue is the rotating/adapting of the building to the terrain and not coords.
    so is there anyway i can create an object that adapts to the terrain it is put on or maybe another way of using this MAP EU mod while other people are not required to download it.
    please help.

    Thanks in advance, Martin

  2. #2
    Master Gunnery Sergeant Rydygier's Avatar
    Join Date
    Aug 22 2011
    Location
    Poland, Pomerania
    Posts
    1,066
    If I understood correctly the problem - you can try perhaps something like:

    PHP Code:
    bld setVectorUP (surfaceNormal [(getPosATL bldselect 0,(getPosATL bldselect 1]); 

  3. #3
    Haha, yeah.. i kinda explained this issue the wrong way, what i meant is that my object is not aligned to the ground its should be placed on, instead its just horizontally sunk into the ground. Let me test your suggestion.
    edit: error; missing ) is what i get, i'll try to solve it myself, but any help'd be appreciated.
    edit2: i just realized, this mission is made on arma 2, not OA, surfacenormal seems to be introduced in OA 1.60, i got OA though.. this mission is on Arma 2, due to my friends not having OA.
    Last edited by PhonicStudios; Aug 18 2012 at 21:15.

  4. #4
    You can use bld setVectorUP [0,0,0]; you will need to adjust the numbers to find the angle which can take a while as they're not really x,y,z.

    You could use the pitch bank function which will make it a little easier

    [object, pitch, bank]

    PHP Code:
     [bld,20,-2call BIS_fnc_setPitchBank
    You may need to place the function module on the map and if it still doesn't work try it from a trigger.

  5. #5
    this is what I use:

    this setpos [getpos this select 0, getpos this select 1,((getpos this select 2) + 1)]; this setVectorUp [0,0,+1]

  6. #6
    Master Gunnery Sergeant Rydygier's Avatar
    Join Date
    Aug 22 2011
    Location
    Poland, Pomerania
    Posts
    1,066
    Quote Originally Posted by PhonicStudios View Post
    edit2: i just realized, this mission is made on arma 2, not OA, surfacenormal seems to be introduced in OA 1.60, i got OA though.. this mission is on Arma 2, due to my friends not having OA.
    If you have OA, then you can also in OA use this:

    PHP Code:
    diag_log format ["%1",(surfaceNormal [(getPosATL bldselect 0,(getPosATL bldselect 1])]; 
    Now you have stored in yours RPT needed vectorUp values, so you can use for yours friends just this:

    PHP Code:
    bld setVectorUp [val1,val2,val3]; 
    where val1, 2 and 3 are these stored values. This give you same result as my first code.

  7. #7
    I just got chance to try surfaceNormal and it's really help full thanks Rydygier I'd missed that command completely.

    The only problem I had was it wouldn't work until I realised I was changing the direction of the object after setting the vector undoing what the command was doing.

  8. #8
    Quote Originally Posted by Rydygier View Post
    If you have OA, then you can also in OA use this:

    PHP Code:
    diag_log format ["%1",(surfaceNormal [(getPosATL bldselect 0,(getPosATL bldselect 1])]; 
    Now you have stored in yours RPT needed vectorUp values, so you can use for yours friends just this:

    PHP Code:
    bld setVectorUp [val1,val2,val3]; 
    where val1, 2 and 3 are these stored values. This give you same result as my first code.
    i dont get where to put the first line, i made this mission on arma 2, going to play it on arma 2... what do i have to do?

  9. #9
    Master Gunnery Sergeant Rydygier's Avatar
    Join Date
    Aug 22 2011
    Location
    Poland, Pomerania
    Posts
    1,066
    If you have OA, like you said, launch yours game in CO mode (A2 + OA), open in editor yours mission, where you have building already placed, where should be, adapted to the surface, name it "bld", and add first line to yours init.sqf or init field of any object on map. Effects you will find in yours RPT file (copy these values somewhere perhaps in some other txt file). Exit game, and launch it again, this time in A2 only mode, in which you, as I pressume, make mission for yours friends. Here use second line and use values stored earlier.

  10. #10
    Quote Originally Posted by Rydygier View Post
    If you have OA, like you said, launch yours game in CO mode (A2 + OA), open in editor yours mission, where you have building already placed, where should be, adapted to the surface, name it "bld", and add first line to yours init.sqf or init field of any object on map. Effects you will find in yours RPT file (copy these values somewhere perhaps in some other txt file). Exit game, and launch it again, this time in A2 only mode, in which you, as I pressume, make mission for yours friends. Here use second line and use values stored earlier.
    Hi,

    I thought setPos did just that? Setting the object pitch/bank depending on terrain.
    Instead, setPosATL/setPosASL are quite (significantly) faster cause they ignore terrain elevation etc.
    Proud community admin/member of The Tour of Teamrespawn

Page 1 of 2 12 LastLast

Similar Threads

  1. Making an Object form to terrain
    By FuzzySquirrel in forum ARMA 2 & OA : MODELLING - (O2)
    Replies: 1
    Last Post: Jul 2 2012, 13:17
  2. Align object/multiple objects to terrain?
    By McNools in forum ARMA 2 & OA : TERRAIN - (Visitor)
    Replies: 16
    Last Post: Nov 17 2011, 06:37
  3. Matching the object to the terrain texture
    By jezpops in forum ARMA : O2 MODELLING
    Replies: 0
    Last Post: Feb 21 2008, 04:48
  4. how can i adapt a finnished mission in the editor?
    By lorence_lin in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 5
    Last Post: Mar 20 2007, 05:19
  5. Getting a forest object to follow terrain
    By SelectThis in forum OFP : O2 MODELLING
    Replies: 1
    Last Post: Jul 19 2002, 04:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •