Jump to content
  • 0

Need help to correct my custom build military compound


Moody

Question

Hello!

I played around in the editor for the first time (used M3 Editor aswell), to build a military compound i wanted on the North West Airstrip on Chernarus map.

Getting the base on my live server isnt a problem, the problem is that all doors and bargates "duplicate" somehow, and it just keep getting worse and worse. It starts off nice with 1 door per building, but idk...after each restart or when player joins or something, it adds up. At the most it was 10 doors on the front door to the buildings and bargates had 7 gates to open before you could run thru it.

 

I dont know if i explained it hard or so, but i dont know how else to put it.

 

Also, i saved the editor work and put it in my mission folder and called for it in the init.sqf with [] execVM. Dont know if that can be the problem? Doing it like that is client side(?) Would it be better to have it server side? How do i make it server sided?

All help is much appreciated.

nwairportcompound.txt

Link to comment
Share on other sites

Recommended Posts

  • 0

Why not try to add them to the config.hpp? m3editor enables you to copy to clipboard.

 

I could try that, but would that mean that i just add every item in the editor sqf to this section of the config.cpp? Or does it need to be edited abit to fit in? As i see the ones from the editor sqf looks different from the ones already in the config.cpp. 

Thanks for your input prone.

 

// NW Airfield
{ "Land_Airport_Tower_F", { 4327.37, 10905.9, 0 }, 61.1295 },
{ "Land_Offices_01_V1_F", { 4573.46, 9819.88, 0 }, 244.926 },
{ "Land_i_Barracks_V2_F", { 4598.97, 9720.41, 0 }, 100.719 },
["Land_CncBarrierMedium4_F",[4200.58,10970.7,0],49.0909,0,0,false],
["Land_Mil_WallBig_4m_F",[4152.72,10983.2,0],319.091,0,0,false]
Link to comment
Share on other sites

  • 0

... called for it in the init.sqf with [] execVM....

 

All help is much appreciated.

you probably need to add your [] execVM into server-side section

 

if (isServer) then {

...

};

 

This way your new buildings are added only once and not every time a new player joins the server.

Link to comment
Share on other sites

  • 0

you probably need to add your [] execVM into server-side section

 

if (isServer) then {

...

};

 

This way your new buildings are added only once and not every time a new player joins the server.

So i can leave the sqf in the mission.pbo and just relocate the call for that file into the server side section of my init?

Link to comment
Share on other sites

  • 0

yep

Do i need to change/edit something in the .sqf file? Before and after the classname lines? Like:

Now i have this before the items:

 

private ["_objects"];
_objects = [
 
and this after, at the end of the sqf:
 
];
 
{
    private ["_obj"];
_obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
_obj setDir (_x select 2);
_obj setPosATL (_x select 1);
} foreach _objects;
Link to comment
Share on other sites

  • 0

 

Do i need to change/edit something in the .sqf file? Before and after the classname lines? Like:

Now i have this before the items:

 

private ["_objects"];
_objects = [
 
and this after, at the end of the sqf:
 
];
 
{
    private ["_obj"];
_obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
_obj setDir (_x select 2);
_obj setPosATL (_x select 1);
} foreach _objects;

 

Try without changing anything. Any errors, paste here...

Link to comment
Share on other sites

  • 0

Added the if isServer with the sqf file i want to call at the bottom. Does this look correct?
 

// Welcome Credits
[] execVM "welcome\welcome.sqf";
 
[] execVM "EventMenu\eventmenu_loop.sqf";
 
[] execVM "wai\remote.sqf";
 
[] execVM "scripts\fn_statusBar.sqf";
 
[] execVM "zcp.sqf";
 
//Supply Drop Alert Event
"SDROP_Alert" addPublicVariableEventHandler {
hint parseText format["%1", _this select 1];
};
 
if(hasInterface)then{execVM "semClient.sqf"};
 
if (!isDedicated) then {
"VEMFChatMsg" addPublicVariableEventHandler {
systemChat ((_this select 1) select 0);
[
[
[((_this select 1) select 0),"align = 'center' size = '1' font=PuristaBold'],
["","<br/>"],
[((_this select 1) select 1),"align = 'center' size = '0.5'"]
]
] spawn BIS_fnc_typeText2;
VEMFChatMsg = nil;
};
 
if (isServer) then {
[] execVM "nwairportcompound.sqf";
};
};

Link to comment
Share on other sites

  • 0

Compund isnt loading now when i added it within the if (isServer) Maybe some changes needs to be done in the nwairportcompound.sqf?

 

Bottom of my init.sqf:

if (!isDedicated) then {
"VEMFChatMsg" addPublicVariableEventHandler {
systemChat ((_this select 1) select 0);
[
[
[((_this select 1) select 0),"align = 'center' size = '1' font=PuristaBold'],
["","<br/>"],
[((_this select 1) select 1),"align = 'center' size = '0.5'"]
]
] spawn BIS_fnc_typeText2;
VEMFChatMsg = nil;
};
 
if (isServer) then {
[] execVM "nwairportcompound.sqf";
};
};

 
Link to comment
Share on other sites

  • 0

 

Compund isnt loading now when i added it within the if (isServer) Maybe some changes needs to be done in the nwairportcompound.sqf?

 

Bottom of my init.sqf:

if (!isDedicated) then {
"VEMFChatMsg" addPublicVariableEventHandler {
systemChat ((_this select 1) select 0);
[
[
[((_this select 1) select 0),"align = 'center' size = '1' font=PuristaBold'],
["","<br/>"],
[((_this select 1) select 1),"align = 'center' size = '0.5'"]
]
] spawn BIS_fnc_typeText2;
VEMFChatMsg = nil;
};
 
if (isServer) then {
[] execVM "nwairportcompound.sqf";
};
};

 

Do you have any error messages to share?

 

Is the file "nwairportcompound.sqf" exactly in the same directory with "init.sqf"?

Link to comment
Share on other sites

  • 0

Do you have any error messages to share?

 

Is the file "nwairportcompound.sqf" exactly in the same directory with "init.sqf"?

I cant see any errors in the RPT, the nwairportcompound.sqf is in the mission root folder with init, description and everything else in that .pbo.

Link to comment
Share on other sites

  • 0

try moving your custom buildings file to a server-side pbo file called custom_server.pbo

 

MPMissions\epoch.Altis\init.sqf is calling script files from \@EpochHive\Addons\custom_server.pbo

if (isServer) then {
	
	//place new server-side objects
	diag_log "Loading Custom Buildings";
	execVM "\q\addons\custom_server\objects\alt_light.sqf"
	diag_log "Finished Loading Custom Buildings";

};

@EpochHive\Addons\custom_server\objects\alt_light.sqf

private ["_objs"];
_objs = [
	["Land_LampAirport_F",[16714.1,13624.6,0],0,[[0,1,0],[0,0,1]],false],
	["Land_LampAirport_F",[16721.5,13528.5,-9.53674e-007],0,[[0,1,0],[0,0,1]],false],
	["Land_LampAirport_F",[16639.6,13532.4,-9.53674e-007],0,[[0,1,0],[0,0,1]],false],
	["Land_LampAirport_F",[16805.7,13677.2,0],0,[[0,1,0],[0,0,1]],false],
	["Land_LampAirport_F",[16832.2,13561,-9.53674e-007],0,[[0,1,0],[0,0,1]],false]
];

{
	private ["_obj"];
	_obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
	if (_x select 4) then {
		_obj setDir (_x select 2);
		_obj setPos (_x select 1);
	} else {
		_obj setPosATL (_x select 1);
		_obj setVectorDirAndUp (_x select 3);
	};
} foreach _objs;
Link to comment
Share on other sites

  • 0

 

try moving your custom buildings file to a server-side pbo file called custom_server.pbo

 

MPMissions\epoch.Altis\init.sqf is calling script files from \@EpochHive\Addons\custom_server.pbo

if (isServer) then {
	
	//place new server-side objects
	diag_log "Loading Custom Buildings";
	execVM "\q\addons\custom_server\objects\alt_light.sqf"
	diag_log "Finished Loading Custom Buildings";

};

@EpochHive\Addons\custom_server\objects\alt_light.sqf

private ["_objs"];
_objs = [
	["Land_LampAirport_F",[16714.1,13624.6,0],0,[[0,1,0],[0,0,1]],false],
	["Land_LampAirport_F",[16721.5,13528.5,-9.53674e-007],0,[[0,1,0],[0,0,1]],false],
	["Land_LampAirport_F",[16639.6,13532.4,-9.53674e-007],0,[[0,1,0],[0,0,1]],false],
	["Land_LampAirport_F",[16805.7,13677.2,0],0,[[0,1,0],[0,0,1]],false],
	["Land_LampAirport_F",[16832.2,13561,-9.53674e-007],0,[[0,1,0],[0,0,1]],false]
];

{
	private ["_obj"];
	_obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
	if (_x select 4) then {
		_obj setDir (_x select 2);
		_obj setPos (_x select 1);
	} else {
		_obj setPosATL (_x select 1);
		_obj setVectorDirAndUp (_x select 3);
	};
} foreach _objs;

Hey again!

I did what you said now, but nothing is spawning on the server. Can it have anything to do with the fact that im trying to get a vehicle on the server and the template you posted here are calling for objects?

Link to comment
Share on other sites

  • 0

Hey again!

I did what you said now, but nothing is spawning on the server. Can it have anything to do with the fact that im trying to get a vehicle on the server and the template you posted here are calling for objects?

 

If you are spawning a vehicle using this script, you need to set

_veh call EPOCH_server_setVToken;

so that the cleanup script does not delete your vehicles. This piece of script can only run on the server-side. If you try to run it on the mission (client) side you will get an error.

Link to comment
Share on other sites

  • 0

If you are spawning a vehicle using this script, you need to set

_veh call EPOCH_server_setVToken;

so that the cleanup script does not delete your vehicles. This piece of script can only run on the server-side. If you try to run it on the mission (client) side you will get an error.

Im running it server side. I followed your input on the earlier post, packed the "custom_server" into a pbo and uploaded to EpochHive/addons, inside that custom_server.pbo i have the following:

 

"objects" folder with "airplane.sqf" file inside. The airplane.sqf file contains the following:

 

private ["_objs"];
_objs = [
["USAF_C130J_Cargo",[4200.16,10852.5,0],150.454,0,0,true],
    ["USAF_C130J_Cargo",[12489.7,12572.6,0],292.273,0,0,true],
    ["USAF_C130J_Cargo",[4679.4,2527.13,0],120.455,0,0,true]
];
 
{
private ["_obj"];
_obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
if (_x select 4) then {
_obj setDir (_x select 2);
_obj setPos (_x select 1);
} else {
_obj setPosATL (_x select 1);
_obj setVectorDirAndUp (_x select 3);
};
} foreach _objs;

 

Called for it at the end of my init.sqf in the MPMissions/epoch.chernarus.pbo with this:

 

// Welcome Credits
[] execVM "welcome\welcome.sqf";
 
[] execVM "EventMenu\eventmenu_loop.sqf";
 
[] execVM "wai\remote.sqf";
 
[] execVM "scripts\fn_statusBar.sqf";
 
[] execVM "zcp.sqf";
 
//Supply Drop Alert Event
"SDROP_Alert" addPublicVariableEventHandler {
hint parseText format["%1", _this select 1];
};
 
if(hasInterface)then{execVM "semClient.sqf"};
 
if (!isDedicated) then {
"VEMFChatMsg" addPublicVariableEventHandler {
systemChat ((_this select 1) select 0);
[
[
[((_this select 1) select 0),"align = 'center' size = '1' font=PuristaBold'],
["","<br/>"],
[((_this select 1) select 1),"align = 'center' size = '0.5'"]
]
] spawn BIS_fnc_typeText2;
VEMFChatMsg = nil;
};
 
if (isServer) then {
 
//place new server-side objects
diag_log "Loading Custom Buildings";
execVM "\q\addons\custom_server\objects\airplane.sqf"
diag_log "Finished Loading Custom Buildings";
 
};
};

Link to comment
Share on other sites

  • 0

 

all you need now is to add:

 

private ["_obj"];
_obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
_obj call EPOCH_server_setVToken;
if (_x select 4) then {
_obj setDir (_x select 2);
_obj setPos (_x select 1);

 

Can you explain what is EPOCH_server_setVToken?

Link to comment
Share on other sites

  • 0

 

all you need now is to add:

 

private ["_obj"];
_obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
_obj call EPOCH_server_setVToken;
if (_x select 4) then {
_obj setDir (_x select 2);
_obj setPos (_x select 1);

 

Do i replace whole this with what you just said?

private ["_obj"];
_obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
if (_x select 4) then {
_obj setDir (_x select 2);
_obj setPos (_x select 1);
} else {
_obj setPosATL (_x select 1);
_obj setVectorDirAndUp (_x select 3);

 

Or do i add it to what i already have?

 

EDIT: ahh, i just remove:

 

} else {

_obj setPosATL (_x select 1);
_obj setVectorDirAndUp (_x select 3);
 
and place _obj call EPOCH_server_setVToken;
 
Earlier you said add _veh call EPOCH_server_setVToken;
 
Do i add _veh call EPOCH_server_setVToken; or _obj call EPOCH_server_setVToken;
Link to comment
Share on other sites

  • 0

Tried everything, its still not loading the damn plane xD

 

Heres the files:

 

Init.sqf:

// Welcome Credits
[] execVM "welcome\welcome.sqf";
 
[] execVM "EventMenu\eventmenu_loop.sqf";
 
[] execVM "wai\remote.sqf";
 
[] execVM "scripts\fn_statusBar.sqf";
 
[] execVM "zcp.sqf";
 
//Supply Drop Alert Event
"SDROP_Alert" addPublicVariableEventHandler {
hint parseText format["%1", _this select 1];
};
 
if(hasInterface)then{execVM "semClient.sqf"};
 
if (!isDedicated) then {
"VEMFChatMsg" addPublicVariableEventHandler {
systemChat ((_this select 1) select 0);
[
[
[((_this select 1) select 0),"align = 'center' size = '1' font=PuristaBold'],
["","<br/>"],
[((_this select 1) select 1),"align = 'center' size = '0.5'"]
]
] spawn BIS_fnc_typeText2;
VEMFChatMsg = nil;
};
 
if (isServer) then {
 
//place new server-side objects
diag_log "Loading Custom Buildings";
execVM "\q\addons\custom_server\objects\airplane.sqf"
diag_log "Finished Loading Custom Buildings";
};
};

 

airplane.sqf

private ["_objs"];
_objs = [
["USAF_C130J_Cargo",[4200.16,10852.5,0],150.454,0,0,true],
    ["USAF_C130J_Cargo",[12489.7,12572.6,0],292.273,0,0,true],
    ["USAF_C130J_Cargo",[4679.4,2527.13,0],120.455,0,0,true]
];
 
{
private ["_obj"];
_obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
_obj call EPOCH_server_setVToken;
if (_x select 4) then {
_obj setDir (_x select 2);
_obj setPos (_x select 1);
} else {
_obj setPosATL (_x select 1);
_obj setVectorDirAndUp (_x select 3);
};
} foreach _objs;

 

The airplane.sqf file is located within a folder called "objects", which is within a folder called "custom_server". this is packed into custom_server.pbo and uploaded to EpochHive/Addons/custom_server.pbo.

 

Im not so good at this that i can figure out the mistake here, i would love it if a trained eye could give it a look.

Link to comment
Share on other sites

  • 0

Dude, this is an Epoch function that sets some sort of variable on your vehicle object so that is not deleted by the Epoch clean-up script.

 

Simply insert the bold line into your code.

I didn't know that, that's why I'm asking. Thanks dude.

Link to comment
Share on other sites

  • 0

Tried everything, its still not loading the damn plane xD

 

 your init.sqf contains an extra closing bracket in the end that should go above "if (isServer)" part

// Welcome Credits
[] execVM "welcome\welcome.sqf";
 
[] execVM "EventMenu\eventmenu_loop.sqf";
 
[] execVM "wai\remote.sqf";
 
[] execVM "scripts\fn_statusBar.sqf";
 
[] execVM "zcp.sqf";
 
//Supply Drop Alert Event
"SDROP_Alert" addPublicVariableEventHandler {
hint parseText format["%1", _this select 1];
};
 
if(hasInterface)then{execVM "semClient.sqf"};
 
if (!isDedicated) then {
"VEMFChatMsg" addPublicVariableEventHandler {
systemChat ((_this select 1) select 0);
[
[
[((_this select 1) select 0),"align = 'center' size = '1' font='PuristaBold'"],
["","<br/>"],
[((_this select 1) select 1),"align = 'center' size = '0.5'"]
]
] spawn BIS_fnc_typeText2;
VEMFChatMsg = nil;
};
};
 
if (isServer) then {
 
//place new server-side objects
diag_log "Loading Custom Buildings";
execVM "\q\addons\custom_server\objects\airplane.sqf"
diag_log "Finished Loading Custom Buildings";
};
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...