Jump to content
Sign in to follow this  
Zombitch

How to stick part of buildings together ? (hospital)

Recommended Posts

Hi,

I am trying to stick building pieces together but can't succeed it.

In fact I try to add an hospital in Startis. The hospital is composed of 3 differents parts that should be "merged".

I tried to play with setPos, setPosASL but never succeed.

Here is what I get :

453008armahospital.png

You see, the three parts are "disconnected" and are not at the same level (I mean the slide 1 is lower than the main part)

Does anyone know how to assemble this hospital ?

Thanks !

NB : Don't tell me I have to place them manually :p

NB2 : I don't know if it's important but I always use "this setVectorUp [0,0,1]" in the init field of my buildings, in order to get my buildings vertically.

Share this post


Link to post
Share on other sites

Somebody asked this a while ago so if you use the search function in this forum you will find the thread.

Share this post


Link to post
Share on other sites

Wow, thanks a lot, it works like a charm.

Here is what I've done thanks to your code :

1) Add a game logic named "Hospital"

2) Copy paste this code in the game logic init fields

hs = createVehicle ["Land_Hospital_main_F", [0,0,0], [], 0, "NONE"];
hs setDir (getDir this);
hs setPosATL (getPosATL this);
var = createVehicle ["Land_Hospital_side1_F", [0,0,0], [], 0, "NONE"];
var attachTo [hs, [4.69775,32.6045,-0.1125]];
detach var;
var = createVehicle ["Land_Hospital_side2_F", [0,0,0], [], 0, "NONE"];
var attachTo [hs, [-28.0336,-10.0317,0.0889387]];
detach var;

Code is from Killzone_Kid

3) Then the hospital appears where is located the game logic

Share this post


Link to post
Share on other sites

This will create as many hospitals as players on the server + 1 for dedicated server if you use it in mp. It has to be server only execution to work properly.

Share this post


Link to post
Share on other sites
This will create as many hospitals as players on the server + 1 for dedicated server if you use it in mp. It has to be server only execution to work properly.

You mean I have to check isServer ? Doing something like that :

if (isServer) then
{
   hs = createVehicle ["Land_Hospital_main_F", [0,0,0], [], 0, "NONE"];
   hs setDir (getDir this);
   hs setPosATL (getPosATL this);
   var = createVehicle ["Land_Hospital_side1_F", [0,0,0], [], 0, "NONE"];
   var attachTo [hs, [4.69775,32.6045,-0.1125]];
   detach var;
   var = createVehicle ["Land_Hospital_side2_F", [0,0,0], [], 0, "NONE"];
   var attachTo [hs, [-28.0336,-10.0317,0.0889387]];
   detach var;
};

Thanks again for your advice.

Edited by Zombitch

Share this post


Link to post
Share on other sites

That would be correct, just don't forget the then and the semicolon at the end :).

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×