AttachObjectToObject
#1

How the hell can i attach object to another object that fits like i want?

i got like this now.. "ship" is the main object and i want to attach shipp1 and shipp2 to "ship"..

i did this: "ship"(pos/rot) - "shipp1"/"shipp2"(pos/rot)

but when in game the object doesn't fit right.. -.-

pawn Код:
ship = CreateObject(10794, 2960.53, -2041.31, 7.00,   0.00, 0.00, 90.00);
shipp1 = CreateObject(10793, 2960.42, -2116.40, 35.57,   0.00, 0.00, 90.00);
shipp2 = CreateObject(10795, 2960.49, -2043.60, 17.14,   0.00, 0.00, 90.00);
AttachObjectToObject(shipp1,ship,-0.11,-75.09,28.557,0,0,0,1);
AttachObjectToObject(shipp2,ship,-0.04,-2.29,10.14,0,0,0,1);

anyone got idea how to calculate pos and rot right?
Reply
#2

You should use a good map editor... Like MTA has. What you use?
Reply
#3

JernejL's map editor.
Reply
#4

bump
Reply
#5

if you attach an object, the potition and rotation is RELATIVE to the first object (parent), so its the best way to map it how you want, then subtract the position ship from position ship2 (rotation too, but you can do that later):
Код:
position x y and z:
ship:   10.0   20.0   0.0
ship2: 15.0   08.0   0.0
do that math now:
15-10=5
8-20=-12
0-0=0
..so your offset to attach ship1 to ship, is 5.0, -12.0, 0.0
Reply
#6

you mean what i basicly did here:
pawn Код:
ship = CreateObject(10794, 2960.53, -2041.31, 7.00,   0.00, 0.00, 90.00);
shipp1 = CreateObject(10793, 2960.42, -2116.40, 35.57,   0.00, 0.00, 90.00);
AttachObjectToObject(shipp1,ship,-0.11,-75.09,28.557,0,0,0,1);
2960.42 - 2960.53 = -0.11

.
.
.
still it doesnt work, i checked if the objects are right without AttachObjectToObject and they are.
But when i attach, ill show the screens when i get home.
Reply
#7

Are you trying to make a ferry or something like my server? If yes you dont need to attach them just place them right
Reply
#8

Wtf! I didn't know this function existed!
This will be really handy!
Reply
#9

Quote:
Originally Posted by thimo
Посмотреть сообщение
Are you trying to make a ferry or something like my server? If yes you dont need to attach them just place them right
I want to create a moving ship, thats why they need to be attached.
Reply
#10

Quote:
Originally Posted by ғαιιοцт
Посмотреть сообщение
Wtf! I didn't know this function existed!
This will be really handy!
ғαιιοцт yet learned another thing xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)