Make multiple objects one?
#1

Hello, I want so make a stock to make multiple objects together as one, but I don't know what function to use, for example, create a house with windows and door, but every coordinates are different, so how would I make that work?
The stock would work like CreateHouse(X, Y, Z); with all the windows, doors, together, any idea?

Any help would be appreciated. Thanks in advance.
Reply
#2

My idea: Create a house at co-ordination x = 0, y = 0, z = 0.
Now you got the objects
pawn Код:
CreateObject(Orgx,Orgy,Orgz);
CreateObject(Orgx,Orgy,Orgz);
CreateObject(Orgx,Orgy,Orgz);
Now; lets start with the stock.
pawn Код:
CreateHouse(x, y, z)
{
CreateObject(Orgx + x,Orgy+ y,Orgy+ z);
CreateObject(Orgx + x,Orgy+ y,Orgy+ z);
CreateObject(Orgx + x,Orgy+ y,Orgy+ z);
}
Simple right.
Reply
#3

You would have one static object, which will be the fundemental of this house, for example, the floor, a door, anything you want really, example:
pawn Код:
stock HouseCreate(HouseX, HouseY, HouseZ)
{
       CreateObject(modelid, HouseX, HouseY, HouseZ, rX, rY, rZ, 0); // change the model id to the floor ID/door ID/basic fundement of the house
       CreateObject(modelid, HouseX+0.5, HouseY-0.356, HouseZ, rX, rY, rZ, 0); // creating yet another object with its position being tweaked off of the original one (random values by the way)
       // And so on and so on untill you have a fully built house ;D
       return 1;
}
Tricky part is getting every piece together and finding the exact position of each object off of the first objects' pos Hope this helps
Reply
#4

Yeah, but what if the house is at an angle? Suddenly everything is messed up. With normal objects you can resort to AttachObjectToObject, but for streamer objects you will need trigonometry. There's no player version of that native.
Reply
#5

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
My idea: Create a house at co-ordination x = 0, y = 0, z = 0.
Now you got the objects
pawn Код:
CreateObject(Orgx,Orgy,Orgz);
CreateObject(Orgx,Orgy,Orgz);
CreateObject(Orgx,Orgy,Orgz);
Now; lets start with the stock.
pawn Код:
CreateHouse(x, y, z)
{
CreateObject(Orgx + x,Orgy+ y,Orgy+ z);
CreateObject(Orgx + x,Orgy+ y,Orgy+ z);
CreateObject(Orgx + x,Orgy+ y,Orgy+ z);
}
Simple right.
This is not what I mean mate, but thanks anyways.

Quote:
Originally Posted by Sandiel
Посмотреть сообщение
You would have one static object, which will be the fundemental of this house, for example, the floor, a door, anything you want really, example:
pawn Код:
stock HouseCreate(HouseX, HouseY, HouseZ)
{
       CreateObject(modelid, HouseX, HouseY, HouseZ, rX, rY, rZ, 0); // change the model id to the floor ID/door ID/basic fundement of the house
       CreateObject(modelid, HouseX+0.5, HouseY-0.356, HouseZ, rX, rY, rZ, 0); // creating yet another object with its position being tweaked off of the original one (random values by the way)
       // And so on and so on untill you have a fully built house ;D
       return 1;
}
Tricky part is getting every piece together and finding the exact position of each object off of the first objects' pos Hope this helps
Thanks, I got an idea, but I don't think it'll work. What if I make one static object as you say, than attach the other objects to it(AttachObjectToObject).
Reply
#6

Quote:
Originally Posted by Onfroi
Посмотреть сообщение
This is not what I mean mate, but thanks anyways.


Thanks, I got an idea, but I don't think it'll work. What if I make one static object as you say, than attach the other objects to it(AttachObjectToObject).
That's basically the idea, but the thing is, the angles won't be as flexible as the X,Y,Z positions.
Logically speaking, one wrong rotation and the half of your house would be stuck inside the ground while the other one hangs loose. So actually mapping this house by yourself would be way easier than this, hope this helps.
Reply
#7

You can simply create a house and use different worlds.

You need the same house no? Just use a different VW so you dont waste objects.
Reply
#8

Quote:
Originally Posted by ReVo_
Посмотреть сообщение
You can simply create a house and use different worlds.

You need the same house no? Just use a different VW so you dont waste objects.
But I want them for different coordinates.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)