OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: LCD on 31 Aug 2007, 22:25:56

Title: solved : geting relative position
Post by: LCD on 31 Aug 2007, 22:25:56
im creating a script dat will randomize da position of a camp... now i placed da whole camp so it looks good in 1 place... is dere a way 2 get da proportions between da objects ? (so i can use it w/ modeltoworld comand 2 make it stay da same everywere)

it doesnt matter i figured it out....

worldtomodel is the comand i needed

here is my script if ny1 needs somin similar

Code: [Select]
private ["_unit","_obj","_relpos","_pos"];

_unit = _this select 0;
_obj = (getpos _unit) nearestobject (_this select 1);
_relpos = _obj worldtomodel (getpos _unit);
_pos = getpos _obj;

waituntil {(_pos select 0) != ((getpos _obj) select 0)};

_unit setpos (_obj modeltoworld _relpos);

if (true) exitwith{};

LCD OUT