Jump to content
  • 0

some Advice please...


leegreaves

Question

I've been using some custom map addons on my server (including a couple I created myself). Ive been doing this, up until now, calling them from the mission file ie - execVM "\some\folder\path\somescript.sqf";

 

I've noticed a few people who have created map additions in their posts saying to add them server sided then call them using server_functions.sqf. I've been trying to get this to work but for some reason Im unable to. The server starts up, gets thru to authentication but wont authenticate as the hive hasnt kicked in. Does anyone know the reason why this is happening? Ive made sure the path is correct to the my map folder ("\z\addons\dayz_server\buildings" and have made sure that the calls match that path in server functions ie - execVM "\z\addons\dayz_server\buildings\script.sqf";

Some pointers would help out here as would prefer to call map addons server sided rather than mission file side.

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0
Just now, leegreaves said:

I have several scripts being called...should i add them one by one until i come across what is causing the hive not to kick in. In meantime im gonna try [] execVM instead of execVM. But thanks anyway!

calling a map addon with server_functions.sqf or server_monitor.sqf

example.sqf (dayz_server.pbo\maps\)

Spoiler

if (isServer) then {




_vehicle_9 = objNull;
if (true) then
{
  _this = createVehicle ["HeliHEmpty", [5408.3813, 3825.3184, 1.5258789e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_9 = _this;
  _this setPos [5408.3813, 3825.3184, 1.5258789e-005];
};


_vehicle_10 = objNull;
if (true) then
{
  _this = createVehicle ["Land_Table_EP1", [5418.8921, 3812.2117, -0.06759686], [], 0, "CAN_COLLIDE"];
  _vehicle_10 = _this;
  _this setDir -91.545029;
  _this setPos [5418.8921, 3812.2117, -0.06759686];
};

};

 

Using Server_functions.sqf

1-server_functions.sqf (at very bottom)

call compile preProcessFileLineNumbers "z\addons\dayz_server\maps\example.sqf";

 

Using server_monitor.sqf

1-calling a map addon with server_monitor.sqf (at very bottom)

execVM "\z\addons\dayz_server\maps\example.sqf";

 

Link to comment
Share on other sites

  • 0
15 minutes ago, juandayz said:

calling a map addon with server_functions.sqf or server_monitor.sqf

example.sqf (dayz_server.pbo\maps\)

  Reveal hidden contents


if (isServer) then {




_vehicle_9 = objNull;
if (true) then
{
  _this = createVehicle ["HeliHEmpty", [5408.3813, 3825.3184, 1.5258789e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_9 = _this;
  _this setPos [5408.3813, 3825.3184, 1.5258789e-005];
};


_vehicle_10 = objNull;
if (true) then
{
  _this = createVehicle ["Land_Table_EP1", [5418.8921, 3812.2117, -0.06759686], [], 0, "CAN_COLLIDE"];
  _vehicle_10 = _this;
  _this setDir -91.545029;
  _this setPos [5418.8921, 3812.2117, -0.06759686];
};

};

 

Using Server_functions.sqf

1-server_functions.sqf (at very bottom)


call compile preProcessFileLineNumbers "z\addons\dayz_server\maps\example.sqf";

 

Using server_monitor.sqf

1-calling a map addon with server_monitor.sqf (at very bottom)


execVM "\z\addons\dayz_server\maps\example.sqf";

 

Cheers Juan that worked for me...now i know what to do from now on...see ya learn something EVERY day...even at my crooked old age ;-)

Link to comment
Share on other sites

  • 0

glad juans method worked for you.

I do it buy calling it in the server_functions.sqf. First line is just for location purposes.

Spoiler

spawn_vehicles = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\spawn_vehicles.sqf";

execVM "\z\addons\dayz_server\objects\stary.sqf";

and in the file itself, you need to make sure you have the

if (isServer) then {

Custom content here

};

in the file, otherwise it wont work, or double the buildings.

Another method since 1061 to spawn buildings would be to use the function epoch has created. its simple enough after a bit of editing. ( i plan to revert to this method when i get the time to do it)

If you go to the epoch client files navigate to dayz_code\system\mission\chernarus.sqf

You'll noticed they are called different

Spoiler

[[

["MAP_R2_RockTower",[13827.3,11770.9,-13.6761],0],
["MAP_R2_Rock1",[13817.8,11746.1,-27.2185],68.5491]
],true,false,true] call fnc_spawnObjects;

This uses fnc_spawnObjects the new epoch function

which in turn does this

Spoiler

/*
    Spawns objects from compact array format.
    
    Notes for global spawned objects:
    - Recommend running on server machine only.
    - Always present global objects use the most resources. Damage and other updates about them are regularly sent over the network.
    
    Notes for local spawned objects:
    - Always present local objects are more performant than global, but less performant than town generator (spawning locally only when player is nearby)
    - Recommend running on every machine including the server, so all units know about the object and vehicles parked on top are not affected.
    - Recommend running unscheduled before player_monitor.fsm and server_monitor.sqf, so units and vehicles spawned on top do not fall through.
    - Not recommended for destructible or removable objects. Damage and deleted status are not synced across machines.
    - Not recommended for objects with animations (like gates). Anim status is not synced across machines.
    
    Params:
    [
        [
            ["ObjectType1", [position], dir],
            ["ObjectType2", [position], dir],
            ["ObjectType3", [position], dir]
        ],
        false, // Block damage
        false, // Use setPosATL instead of setPos
        true // Spawn objects locally
    ] call fnc_spawnObjects;
*/

 

Link to comment
Share on other sites

  • 0
2 hours ago, theduke said:

glad juans method worked for you.

I do it buy calling it in the server_functions.sqf. First line is just for location purposes.

  Reveal hidden contents

spawn_vehicles = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\spawn_vehicles.sqf";

execVM "\z\addons\dayz_server\objects\stary.sqf";

and in the file itself, you need to make sure you have the


if (isServer) then {

Custom content here

};

in the file, otherwise it wont work, or double the buildings.

Another method since 1061 to spawn buildings would be to use the function epoch has created. its simple enough after a bit of editing. ( i plan to revert to this method when i get the time to do it)

If you go to the epoch client files navigate to dayz_code\system\mission\chernarus.sqf

You'll noticed they are called different

  Reveal hidden contents

[[

["MAP_R2_RockTower",[13827.3,11770.9,-13.6761],0],
["MAP_R2_Rock1",[13817.8,11746.1,-27.2185],68.5491]
],true,false,true] call fnc_spawnObjects;

This uses fnc_spawnObjects the new epoch function

which in turn does this

  Reveal hidden contents

/*
    Spawns objects from compact array format.
    
    Notes for global spawned objects:
    - Recommend running on server machine only.
    - Always present global objects use the most resources. Damage and other updates about them are regularly sent over the network.
    
    Notes for local spawned objects:
    - Always present local objects are more performant than global, but less performant than town generator (spawning locally only when player is nearby)
    - Recommend running on every machine including the server, so all units know about the object and vehicles parked on top are not affected.
    - Recommend running unscheduled before player_monitor.fsm and server_monitor.sqf, so units and vehicles spawned on top do not fall through.
    - Not recommended for destructible or removable objects. Damage and deleted status are not synced across machines.
    - Not recommended for objects with animations (like gates). Anim status is not synced across machines.
    
    Params:
    [
        [
            ["ObjectType1", [position], dir],
            ["ObjectType2", [position], dir],
            ["ObjectType3", [position], dir]
        ],
        false, // Block damage
        false, // Use setPosATL instead of setPos
        true // Spawn objects locally
    ] call fnc_spawnObjects;
*/

 

Yeah Ive noticed the new method for spawning custom content in, think its a shorter form instead of the standard way arma 2 calls it all. Bit long winded having to call a custom script in the editor. Now if someone was to create a cmd line or an exe with gui to convert a custom map sqf from long to the newer short form adopted by 1061 id be pretty interested in that. Im assuming the new short form being used has less impact on server performance which im sure we all agree is a good thing to have.

Link to comment
Share on other sites

  • 0
Just now, leegreaves said:

Yeah Ive noticed the new method for spawning custom content in, think its a shorter form instead of the standard way arma 2 calls it all. Bit long winded having to call a custom script in the editor. Now if someone was to create a cmd line or an exe with gui to convert a custom map sqf from long to the newer short form adopted by 1061 id be pretty interested in that. Im assuming the new short form being used has less impact on server performance which im sure we all agree is a good thing to have.

Im just going to use the find and replace function in notepad++. Seems scary, but once you start, its easy going...

I made a video for the sanford and son trader we made, which shows how to do the find and replace with symbols.

Link to comment
Share on other sites

  • 0

I use this that @ebayShopper wrote to compact the map edits down, it works great.

I run all my map edits from the bottom of server_monitor.sqf after this line: https://github.com/EpochModTeam/DayZ-Epoch/blob/master/SQF/dayz_server/system/server_monitor.sqf#L540

The reason is, I have had some scripts take a while to start and then fnc_spawnObjects was not initialized yet and the mapedits have failed to load.

Moving them till later in the load time at the bottom of server_monitor fixed a lot of these issues.

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...