Posts: 1,504
Threads: 109
Joined: Jan 2012
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.
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
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.
Posts: 1,504
Threads: 109
Joined: Jan 2012
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).
Posts: 535
Threads: 36
Joined: Oct 2009
Reputation:
0
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.
Posts: 1,504
Threads: 109
Joined: Jan 2012
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.