Jump to content
  • 0

Moving buildings to dayz_server.pbo problem


Sandbird

Question

I am making a building complex and while in the editor or SP mode its working fine....moving the file to the dayz_server is giving me some problems with aligning buildings together.

 

This is my 1st building on which the others depend on :

_vehicle_18 = objNull;
if (true) then
{
  _this = createVehicle ["land_nav_pier_c_270", [1974.354,3693.311,0], [], 0, "CAN_COLLIDE"];
  _vehicle_18 = _this;
  _this setVehicleVarName "core1";
  core1 = _this;
  _this setVehicleInit "this setposASL [getPosASL this select 0,getPosASL this select 1,(getPosASL this select 2)+40]; this setVectorUp [0, 0, 1];";
  _this setPos [1974.354,3693.311,0];
};

all the other buildings around it have a similar structure.

......
_vehicle_22 = objNull;
if (true) then
{
  _this = createVehicle ["land_nav_pier_c", [1916.0552,3613.377,0], [], 0, "CAN_COLLIDE"];
  _vehicle_22 = _this;
  _this setDir 90;
  _this setVehicleVarName "wall";
  wall= _this;
  _this setVehicleInit "this setposASL [getPosASL this select 0,getPosASL this select 1,(getPosASL core1 select 2)]; this setVectorUp [0, 0, 1];";
  _this setPos [1916.0552,3613.377,0];
};


......
_vehicle_30 = objNull;
if (true) then
{
  _this = createVehicle ["land_nav_pier_c", [1906.0068,3638.65,0], [], 0, "CAN_COLLIDE"];
  _vehicle_30 = _this;
  _this setVehicleVarName "c1";
  c1 = _this;
  _this setVehicleInit "this setposASL [getPosASL this select 0,getPosASL this select 1,(getPosASL core1 select 2)+30]; this setVectorDirAndUp [[0, 1, 0],[-1, 0, 0]];";
  _this setPos [1906.0068,3638.65,0];
};

See the 2nd object is suppose to get the Z location of the core1 object in order to get its height right, and then rotate also to the side.

While this is working fine like i said in SP, or temp MP (simple MP mission, not dedicated)....when i move the file in my dayz_server.pbo 2 things happen:

 

1) I get this error for all of my objects (in the client .RPT file, not the servers'):

Error in expression <this setposASL [getPosASL this select 0,getPo>
  Error position: <setposASL [getPosASL this select 0,getPo>
  Error Type Any, expected Number

as if it cant understand this.

 

2) While all the buildings, even with the errors align fine (probably cause i have their Z axis to 0).....the ceiling vehicles (like _vehicle_30) dont appear....or if they do...they are under ground ?...i dont know.

These buildings are the same with the "wall" buildings (_vehicle_22)...the only difference is the setVectorDirAndUp which the wiki says the local machine must run that....aka...the server ?

 

Why dont the recognize core1 and give an error ? I am pretty sure thats why the 'ceiling' buildings dont appear as well cause of that...they just wont align with core1....not to mention that they dont understand themselves....with the : getPosASL this .....

 

Any ideas ?

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

how are you calling upon these on your dedicated server? Did you separate them out to a sqf file and call that in the init ?

 

ie

 

_vehicle_3684 = objNull;
if (true) then
{
  _this = createVehicle ["Land_HBarrier5", [14448.163, 9490.7158, 4.5776367e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_3684 = _this;
  _this setPos [14448.163, 9490.7158, 4.5776367e-005];
};

processInitCommands;

 

and your #'s seem awful low for the objects you have added, like they may collide with existing trader setups, i haven't looked at what's in that number range, but just seems like it.

Link to comment
Share on other sites

  • 0

Yeah this buildings i a huge city surrounded with walls...i am trying to add some roof...thats where i have the problem.

The buildings are inside an .sqf file with : if (isServer) then {  on the top.

And from my server_functions.sqf....at the end of it i call the script.

 

[] execVM "\z\addons\dayz_server\custombuildings\city.sqf";

 

ps: the building is in the dayz_server.pbo...no init there :P, careful, hehe, i am not running this on mppmissions.pbo

Link to comment
Share on other sites

  • 0

I would just set a local variable to refer to it.

_vehicle_18 = objNull;
if (true) then
{
  _this = createVehicle ["land_nav_pier_c_270", [1974.354,3693.311,0], [], 0, "CAN_COLLIDE"];
  _vehicle_18 = _this;
  _core1 = _this;
  _this setVehicleInit "this setposASL [(getPosASL this) select 0,(getPosASL this) select 1,((getPosASL this) select 2)+40]; this setVectorUp [0, 0, 1];";
  _this setPos [1974.354,3693.311,0];
};

_vehicle_22 = objNull;
if (true) then
{
  _this = createVehicle ["land_nav_pier_c", [1916.0552,3613.377,0], [], 0, "CAN_COLLIDE"];
  _vehicle_22 = _this;
  _this setDir 90;
  _wall = _this;
  _this setVehicleInit "this setposASL [(getPosASL this) select 0,(getPosASL this) select 1,((getPosASL _core1) select 2)]; this setVectorUp [0, 0, 1];";
  _this setPos [1916.0552,3613.377,0];
};
Link to comment
Share on other sites

  • 0

huh -  really nothing out of the obvious - number thing threw me off but looking at it , there are a ton of holes in that number range..

 

That's a really odd one man, I wish I could provide some insight to this

yeah it is odd...i've been trying to do this for at least 6h now...its just crazy.

 

type any, expected number may mean its getting an array in return instead of the selection, so that's why I added the parenthesis on my code.

i also tried with local variables...still the same error...I'll give it a try with the parenthesis.

 

Thanks guys..will test now.

 

ps: totally forgot about the processInitCommands....I hope thats not it.lol...i'll kill myself.

Link to comment
Share on other sites

  • 0

Ok i am still having this problem and i think i know why now....

The errors are reported at the arma2oa.RPT, meaning the client's.

Although there is a big if (isServer) then { at the top of the file. My guess is that the client is trying to get position and it cant get it cause it cant 'see' the object cause its running on server side ?

 

To simplify things....can someone (with this new way of adding buildings) give me a 2 building example of what it should look like 100% ? The problem is that i share info between the 2 buildings

 

the 2nd building must get its X,Y,Z coordinates from the 1st building...(so i can align them perfectly).

 

_vehicle_68 setVehicleInit "this setposASL [getPosASL this select 0,getPosASL this select 1,(getPosASL building1 select 2)-100];";

 

I am having the same problem with sharing coordinates between the 2 objects.

Example:....the 1st object needs to know where the 2nd one is....and so does the 2nd one.

if (isServer) then {

private ["_vehicle_17","_vehicle_68"];

_vehicle_17 = objNull;
if (true) then
{
  _this = createVehicle ["land_nav_pier_c_270",[5984.2954,11666.067,0], [], 0, "CAN_COLLIDE"];
  vehicle_17 = _this;
  _this setVehicleInit "this setVariable [""secondLocation"", getPosASL vehicle_68];";
  _this setPos [5984.2954,11666.067,0];
};

_vehicle_68 = objNull;
if (true) then
{
  _this = createVehicle ["land_nav_pier_c", [5969.4497, 11637.368, 0], [], 0, "CAN_COLLIDE"];
  vehicle_68 = _this;
   _this setVehicleInit "this setVariable [""secondLocation"",getPosASL vehicle_17];";
  _this setPos [5969.4497, 11637.368, 0];
};

processInitCommands;
};

Link to comment
Share on other sites

  • 0

 

Ok i am still having this problem and i think i know why now....

The errors are reported at the arma2oa.RPT, meaning the client's.

Although there is a big if (isServer) then { at the top of the file. My guess is that the client is trying to get position and it cant get it cause it cant 'see' the object cause its running on server side ?

 

To simplify things....can someone (with this new way of adding buildings) give me a 2 building example of what it should look like 100% ? The problem is that i share info between the 2 buildings

 

the 2nd building must get its X,Y,Z coordinates from the 1st building...(so i can align them perfectly).

 

_vehicle_68 setVehicleInit "this setposASL [getPosASL this select 0,getPosASL this select 1,(getPosASL building1 select 2)-100];";

 

I am having the same problem with sharing coordinates between the 2 objects.

Example:....the 1st object needs to know where the 2nd one is....and so does the 2nd one.

if (isServer) then {

private ["_vehicle_17","_vehicle_68"];

_vehicle_17 = objNull;
if (true) then
{
  _this = createVehicle ["land_nav_pier_c_270",[5984.2954,11666.067,0], [], 0, "CAN_COLLIDE"];
  vehicle_17 = _this;
  _this setVehicleInit "this setVariable [""secondLocation"", getPosASL vehicle_68];";
  _this setPos [5984.2954,11666.067,0];
};

_vehicle_68 = objNull;
if (true) then
{
  _this = createVehicle ["land_nav_pier_c", [5969.4497, 11637.368, 0], [], 0, "CAN_COLLIDE"];
  vehicle_68 = _this;
   _this setVehicleInit "this setVariable [""secondLocation"",getPosASL vehicle_17];";
  _this setPos [5969.4497, 11637.368, 0];
};

processInitCommands;
};

 

If I were you I'd go the route of transferring it over to the local format and trying that instead of using _this. Then you should be able to refer to an object as a local and get it working.

Link to comment
Share on other sites

  • 0
_trash = createVehicle ["Barrels",[(_coords select 0) - 7.4511, (_coords select 1) + 3.8544,0],[], 0, "NONE"];
_trash setDir 61.911976;

_trash1 = createVehicle ["Misc_palletsfoiled",[(_coords select 0) + 4.062, (_coords select 1) + 4.7216,0],[], 0, "NONE"];
_trash1 setDir -29.273479;

_trash2 = createVehicle ["Paleta2",[(_coords select 0) - 3.4033, (_coords select 1) - 2.2256,0],[], 0, "NONE"];

_trash3 = createVehicle ["Land_Pneu",[(_coords select 0) + 1.17, (_coords select 1) + 1.249,0],[], 0, "NONE"];

_trash4 = createVehicle ["Land_transport_crates_EP1",[(_coords select 0) + 3.9029, (_coords select 1) - 1.8477,0],[], 0, "NONE"];
_trash4 setDir -70.372086;

_trash5 = createVehicle ["Fort_Crate_wood",[(_coords select 0) - 2.1181, (_coords select 1) + 5.9765,0],[], 0, "NONE"];
_trash5 setDir -28.122475;
_pier1 = createVehicle ["land_nav_pier_c", [5969.4497, 11637.368, 0], [], 0, "CAN_COLLIDE"];
_pier1 setVariable [""secondLocation"",getPosASL _pier2];
_pier1 setPos [5969.4497, 11637.368, 0];

_pier2 = createVehicle ["land_nav_pier_c_270",[5984.2954,11666.067,0], [], 0, "CAN_COLLIDE"];
_pier2 setVariable [""secondLocation"", getPosASL _pier3];
_pier2 setPos [5984.2954,11666.067,0];
Link to comment
Share on other sites

  • 0

Yeah thats what i thought :)

Ok thanks, will give it a go, although i am 99% that it gave the same errors..

I should have (isServer) and processInitCommands; at the bottom right ?

I mean is there anything extra i should take into consideration ?

-Thanks

Link to comment
Share on other sites

  • 0

Yeah thats what i thought :)

Ok thanks, will give it a go, although i am 99% that it gave the same errors..

I should have (isServer) and processInitCommands; at the bottom right ?

I mean is there anything extra i should take into consideration ?

-Thanks

 

If you aren't adding setVehicleInit to it, then you shouldn't need to use processInitCommands.

If it still gives you problems after you convert it, pastebin it for me to have a look.

Link to comment
Share on other sites

  • 0

Well its kinda working....Only the 1st object has a problem...one of its setVariable is not set :

_pier1 = objNull;
if (true) then
{
 _pier1 = createVehicle ["land_nav_pier_c", [5969.4497, 11637.368, 0], [], 0, "CAN_COLLIDE"];
 _pier1 setVariable ["BuildingID","123",true];
 _pier1 setVariable ["BuildingFace","top",true];
 _pier1 setVariable ["otherPierloc",(getPosASL _pier2),true];
 _pier1 setPos [5969.4497, 11637.368, 0];
};

_pier2 = objNull;
if (true) then
{
 _pier2 = createVehicle ["land_nav_pier_c_270",[5984.2954,11666.067,0], [], 0, "CAN_COLLIDE"];
 _pier2 setVariable ["BunkerCode","321",true];
 _pier2 setVariable ["BuildingFace","side",true];
 _pier2 setVariable ["otherPierloc",(getPosASL _pier1),true];
 _pier2 setDir -90;
 _pier2 setPos [5984.2954,11666.067,0];
};

I had to add "true" to the variables so that they are broadcasted to all clients....but _pier1 doesnt get "otherPierloc". It comes out any. Probably because at that point _pier2 was not created yet right ?

_pier2 does get the proper value for "otherPierloc".

 

If thats the case, then i am f......d.lol... I need for _pier1 to have that value on server start...

Can i set it to its value under (or inside _pier2) ?  Would that work ?

That would totally weird things up for me if it did.

 

edit: Yup that did it :)

Thanks Vamp

Link to comment
Share on other sites

  • 0

Well its kinda working....Only the 1st object has a problem...one of its setVariable is not set :

 

I had to add "true" to the variables so that they are broadcasted to all clients....but _pier1 doesnt get "otherPierloc". It comes out any. Probably because at that point _pier2 was not created yet right ?

_pier2 does get the proper value for "otherPierloc".

 

If thats the case, then i am f......d.lol... I need for _pier1 to have that value on server start...

Can i set it to its value under (or inside _pier2) ?  Would that work ?

That would totally weird things up for me if it did.

 

edit: Yup that did it :)

Thanks Vamp

 

Just so you know, you don't need this junk around it.

_pier1 = objNull;
if (true) then
{

};

It gets defined when you first do something with it, and since you no longer use _this, there's no reason to have it.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...