Results 1 to 6 of 6

Thread: Copying 3d positions from editor

  1. #1
    CWR² Developer SaOk's Avatar
    Join Date
    Nov 23 2006
    Location
    Helsinki, Finland
    Posts
    1,341

    Copying 3d positions from editor

    Is the an easy way to copy 3d position from editor map or ingame to notepad? It works with camera.sqs but it copies too much information to be quick tool. I would need position arrays for spawned unit and waypoints. I am currently using invisible helipads but hopefully there would be a easier way.

  2. #2
    I dont know if this is an "easy" way, but it saves from having to type the numbers from a hint/sidechat.

    Init field:
    Code:
    diag_log format ["%1: %2",this, getpos this]
    That way you can place all the hpads at once and then just copy&paste positions from arma2.rpt.

  3. #3
    Another option would be:

    Add an action to your player:

    Code:
    this addAction ["Copy Pos","copypos.sqf"];
    copypos.sqf:
    Code:
    _unit = cursorTarget;
    _pos = getPos _unit;
    
    copyToClipboard format["Unit %1 is at %2",_unit, _pos];
    hintSilent "Pos copied!";
    Then just point at what you want to know the location of, click the action and paste to Notepad.

  4. #4
    CWR² Developer SaOk's Avatar
    Join Date
    Nov 23 2006
    Location
    Helsinki, Finland
    Posts
    1,341
    Author of the Thread
    Thank you both

    I ended up to use action but with some changes since cursorTarget gave me null and [0,0,0]

    But getting the position of player is good enought so I am using now these:

    Code:
    this addAction ["Copy Pos","copypos.sqs"];
    Code:
    _unit = position player;
    copyToClipboard format["%1",_unit];
    hint "Pos copied!";
    exit

  5. #5
    An easy way to get the position is to simply place the object in the editor (say an invisible h), open the mission sqm file (you can do it while working on a mission) and just copy the position for your object.

  6. #6
    Oops, sorry, thought you wanted positions for other units, not just your player.

    Also, exit doesn't do anything in SQF, so you can leave that out.

Posting Permissions

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