Jump to content

How to make Custom map content [ Tutorial & Ongoing Support ]


Poncho

Recommended Posts

This may have been answered already, but.....

 

I want to add more items, do I just repeat the steps, add another .sqf file (named differently) to "maps" and add another:

 

execVM "\z\addons\dayz_server\maps\name of file.sqf";

 

below the first one?

 

or do I have have keep editing the original one?

 

Thanks.

You do not have to keep editing the original file.

This is how I have it all set up.

Inside my init.sqf in my mission.pbo I....

Placed

_nil = [] execVM "\z\addons\dayz_server\Maps\CustomLocations.sqf";

Under

_serverMonitor = [] execVM "\z\addons\dayz_code\system\server_monitor.sqf";

So it looks like

if (isServer) then {
	//Compile vehicle configs
	call compile preprocessFileLineNumbers "\z\addons\dayz_server\missions\DayZ_Epoch_7.Lingor\dynamic_vehicle.sqf";				
	// Add trader citys
	_nil = [] execVM "\z\addons\dayz_server\missions\DayZ_Epoch_7.Lingor\mission.sqf";
	_serverMonitor = [] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
	_nil = [] execVM "\z\addons\dayz_server\Maps\CustomLocations.sqf";
};

The contents of the customlocations.sqf inside the server.pbo as an example looks like

if (isServer) then {
// LOCATIONS BY Randomdoode
        _nil = [] execVM "\z\addons\dayz_server\Maps\xxx.sqf";        //Custom location #1 By Randomdoode 
        _nil = [] execVM "\z\addons\dayz_server\Maps\xxx.sqf";        //Custom location #2 By Randomdoode 
        _nil = [] execVM "\z\addons\dayz_server\Maps\xxx.sqf";        //Custom location #3 By Randomdoode 
        _nil = [] execVM "\z\addons\dayz_server\Maps\xxx.sqf";        //Custom location #4 By Randomdoode 
        _nil = [] execVM "\z\addons\dayz_server\Maps\xxx.sqf";        //Custom location #5 By Randomdoode 
		
	};

Just point the files to the right locations with the folder structure you have set up.

I personally kept everything inside server_functions.sqf before I was shown this method by a friend and I prefer it as it keeps everything more organized for me. Hope this helps in anyway!

Link to comment
Share on other sites

You do not have to keep editing the original file.

This is how I have it all set up.

Inside my init.sqf in my mission.pbo I....

Placed

_nil = [] execVM "\z\addons\dayz_server\Maps\CustomLocations.sqf";

Under

_serverMonitor = [] execVM "\z\addons\dayz_code\system\server_monitor.sqf";

So it looks like

if (isServer) then {
	//Compile vehicle configs
	call compile preprocessFileLineNumbers "\z\addons\dayz_server\missions\DayZ_Epoch_7.Lingor\dynamic_vehicle.sqf";				
	// Add trader citys
	_nil = [] execVM "\z\addons\dayz_server\missions\DayZ_Epoch_7.Lingor\mission.sqf";
	_serverMonitor = [] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
	_nil = [] execVM "\z\addons\dayz_server\Maps\CustomLocations.sqf";
};

The contents of the customlocations.sqf inside the server.pbo as an example looks like

if (isServer) then {
// LOCATIONS BY Randomdoode
        _nil = [] execVM "\z\addons\dayz_server\Maps\xxx.sqf";        //Custom location #1 By Randomdoode 
        _nil = [] execVM "\z\addons\dayz_server\Maps\xxx.sqf";        //Custom location #2 By Randomdoode 
        _nil = [] execVM "\z\addons\dayz_server\Maps\xxx.sqf";        //Custom location #3 By Randomdoode 
        _nil = [] execVM "\z\addons\dayz_server\Maps\xxx.sqf";        //Custom location #4 By Randomdoode 
        _nil = [] execVM "\z\addons\dayz_server\Maps\xxx.sqf";        //Custom location #5 By Randomdoode 
		
	};

Just point the files to the right locations with the folder structure you have set up.

I personally kept everything inside server_functions.sqf before I was shown this method by a friend and I prefer it as it keeps everything more organized for me. Hope this helps in anyway!

 

OK, so the way it looks to me is that you are using your mission/init.sqf to point to a new file you made called customlocations.sqf  inside the server .pbo . then you use that file to point to your map locations on the server side instead of using server_functions.sqf , correct?

 

Thanks for the help.

Link to comment
Share on other sites

I add mine to the the very bottom of the server_functions.sqf, so using the above example would be :

 

server_logUnlockLockEvent = {
    private["_player", "_obj", "_objectID", "_objectUID", "_statusText", "_status"];
    _player = _this select 0;
    _obj = _this select 1;
    _status = _this select 2;
    if (!isNull(_obj)) then {
        _objectID = _obj getVariable["ObjectID", "0"];
        _objectUID = _obj getVariable["ObjectUID", "0"];
        _statusText = "UNLOCKED";
        if (_status) then {
            [_obj, "gear"] call server_updateObject;
            _statusText = "LOCKED";
        };
        diag_log format["SAFE %5: ID:%1 UID:%2 BY %3(%4)", _objectID, _objectUID, (name _player), (getPlayerUID _player), _statusText];
    };
};
 
call compile preProcessFileLineNumbers "\z\addons\dayz_server\Maps\xxx.sqf"; //Custom location #1 By Randomdoode 
call compile preProcessFileLineNumbers "\z\addons\dayz_server\Maps\xxx.sqf"; //Custom location #2 By Randomdoode 
call compile preProcessFileLineNumbers "\z\addons\dayz_server\Maps\xxx.sqf"; //Custom location #3 By Randomdoode 
call compile preProcessFileLineNumbers "\z\addons\dayz_server\Maps\xxx.sqf"; //Custom location #4 By Randomdoode 
call compile preProcessFileLineNumbers "\z\addons\dayz_server\Maps\xxx.sqf"; //Custom location #5 By Randomdoode 
Link to comment
Share on other sites

 

I add mine to the the very bottom of the server_functions.sqf, so using the above example would be :

server_logUnlockLockEvent = {
    private["_player", "_obj", "_objectID", "_objectUID", "_statusText", "_status"];
    _player = _this select 0;
    _obj = _this select 1;
    _status = _this select 2;
    if (!isNull(_obj)) then {
        _objectID = _obj getVariable["ObjectID", "0"];
        _objectUID = _obj getVariable["ObjectUID", "0"];
        _statusText = "UNLOCKED";
        if (_status) then {
            [_obj, "gear"] call server_updateObject;
            _statusText = "LOCKED";
        };
        diag_log format["SAFE %5: ID:%1 UID:%2 BY %3(%4)", _objectID, _objectUID, (name _player), (getPlayerUID _player), _statusText];
    };
};
 
call compile preProcessFileLineNumbers "\z\addons\dayz_server\Maps\xxx.sqf"; //Custom location #1 By Randomdoode 
call compile preProcessFileLineNumbers "\z\addons\dayz_server\Maps\xxx.sqf"; //Custom location #2 By Randomdoode 
call compile preProcessFileLineNumbers "\z\addons\dayz_server\Maps\xxx.sqf"; //Custom location #3 By Randomdoode 
call compile preProcessFileLineNumbers "\z\addons\dayz_server\Maps\xxx.sqf"; //Custom location #4 By Randomdoode 
call compile preProcessFileLineNumbers "\z\addons\dayz_server\Maps\xxx.sqf"; //Custom location #5 By Randomdoode 

OK, I was just adding these lines:

 

execVM "\z\addons\dayz_server\maps\name of file.sqf"; (as explained in the very first post)

 

to the bottom of server_functions.sqf (one below another for each map file), the first one worked, the second one didn't.

 

Link to comment
Share on other sites

See the example above that Nakama Mind and Myself posted above (Nakama's post looks better but same idea). When you only add the one line to the bottom of your init/server_functions.sqf that points to a custom mapfiles.sqf. You will only have to change 1 line of code when updating to a new version or restoring the backup of the maps. I backed up 40+ player bases, each base is a separate map file, which would be a pain to readd to the server_functions.sqf file, but the method we use makes the task so much easier and cleaner yet still keeping each map edit separate for any removal or editing of each map file.

I did the same thing for my init.sqf file in my mpmissions folder, most of the mods I installed that wanted to have lines of code added to the init.sqf, i just added to a custominit.sqf file instead, then added a single line of code to call upon my custom file.

Link to comment
Share on other sites

HELP ! LOL

 

I followed along and made me a new base., then added more with new map edit, then another all three loaded as above added this line for every map execVM "\z\addons\dayz_server\Maps\mapedit.sqf";

changing the name of course to my sqf name .. only the first show .. skips the other two all together .. Im missing some piece of info on mutiple map edits .. sqf for each one, and yes name is correct in the sqf

 

THANKS in advance

Link to comment
Share on other sites

On each of my maps I start out with :

 

if (isServer) then {

 

 

and the last 3 lines is:

 

};  <----closing of the last object
 
}; <----closing of the "If Server Then"
 
processInitCommands;  
 
 
 
also if using __bldObj_###  or _vehicle_####   make sure your not using duplicate numbers for another object/vehicle in the same map edit file
Link to comment
Share on other sites

are you getting any errors in your server .rpt file? how about your local .rpt file?  I use a program called tail.exe  part of GnuWin then I made a simple .bat file to execute the tail command telling it to read/display the local rpt file as things happen.

 

Here is an example of the .bat file I made

 

@ECHO OFF

 
echo Starting Local RPT Log Window.
set tailpath="C:\Program Files (x86)\gnuwin32\bin"
cd /d %tailpath%
timeout 1
start "LocalRPT" "tail.exe" -F "C:\Users\yourpcusername\AppData\Local\ArmA 2 OA\ArmA2OA.RPT"
echo.
 
exit
 
 
Just copy and paste that into a notepad file and save it as .bat instead of .txt  change yourpcusername to whatever you have.  I have it setup for both my test server and my local rpt file so I can see any errors on both sides of the fence at once for troubleshooting. was surprised the amount of client side errors ya can get that don't show on server side logs.
Link to comment
Share on other sites

HELP ! LOL

 

I followed along and made me a new base., then added more with new map edit, then another all three loaded as above added this line for every map execVM "\z\addons\dayz_server\Maps\mapedit.sqf";

changing the name of course to my sqf name .. only the first show .. skips the other two all together .. Im missing some piece of info on mutiple map edits .. sqf for each one, and yes name is correct in the sqf

 

THANKS in advance

Can you post the mapedit.sqf inside a spoiler. Like Ganja said it might be a closing bracket missing or you could have multiple IDs that are the same for your objects.

Link to comment
Share on other sites

HELP ! LOL

 

I followed along and made me a new base., then added more with new map edit, then another all three loaded as above added this line for every map execVM "\z\addons\dayz_server\Maps\mapedit.sqf";

changing the name of course to my sqf name .. only the first show .. skips the other two all together .. Im missing some piece of info on mutiple map edits .. sqf for each one, and yes name is correct in the sqf

 

THANKS in advance

 

This is the EXACT same thing that happened to me, and I was told to use:

 

call compile preProcessFileLineNumbers "\z\addons\dayz_server\Maps\xxx.sqf";

 

which I still havent tried yet. Been working on other scripts.

Link to comment
Share on other sites

So which one do we use?

 

call compile preProcessFileLineNumbers "\z\addons\dayz_server\Maps\xxx.sqf";

 

or

 

execVM "\z\addons\dayz_server\Maps\xxx.sqf";

 

and which .sqf file do they go in the bottom of?

 

server_functions.sqf?

 

Sorry, but after reading all this, it seems that different people do it different ways, I, like northrivergeek, added multiple lines of:

 

execVM "\z\addons\dayz_server\Maps\xxx.sqf"; (obviously changing the map name on each)

 

to the bottom of Server_functions.sqf and got the same results, first one works, the rest do not.

 

So do we add

 

call compile preProcessFileLineNumbers "\z\addons\dayz_server\Maps\xxx.sqf";

 

to the bottom of Server_functions.sqf instead? If not, where?

 

The map.sqf files are fine, as the first one works. Just the call is incorrect.

Link to comment
Share on other sites

Ok guys I have added custom content before but for what ever reason my

Recent addon does "appear" in game. And yes I have the links and call compress right. My question is, does the vehicle limit and other map editions have a restriction or conflict with my map addition? Ie if I have vehicle 1 in one sqf and vehicle 1 in another will only the first vehicle 1 show in game?

Link to comment
Share on other sites

Ok guys I have added custom content before but for what ever reason my

Recent addon does "appear" in game. And yes I have the links and call compress right. My question is, does the vehicle limit and other map editions have a restriction or conflict with my map addition? Ie if I have vehicle 1 in one sqf and vehicle 1 in another will only the first vehicle 1 show in game?

 

The IDs matching ones from other files have no ill-effect. Could you post the arma2oaserver.RPT log file on Pastebin or Github?  Or alternatively, you can PM me for further assistance.

Link to comment
Share on other sites

Ok guys I have added custom content before but for what ever reason my

Recent addon does "appear" in game. And yes I have the links and call compress right. My question is, does the vehicle limit and other map editions have a restriction or conflict with my map addition? Ie if I have vehicle 1 in one sqf and vehicle 1 in another will only the first vehicle 1 show in game?

Corper send me your server.pbo and all the map edits you're wanting to use, I'll do them for you and get them working :)

Link to comment
Share on other sites

In MP Missions folder you will find a file called mission.sqm
 
 
scroll down till you see 
 
class Markers
{
items=48;
class Item0
{
position[]={10010.905,110.96082,10448.559};
name="center";
type="Empty";
};
class Item1
{
position[]={10153.301,0.48597428,-4593.061};
name="respawn_west";
type="Empty";
};
 
By default there are not 48 markers, I have added a bunch of custom onesd myself.  When making new markers always remember, the numbering starts at 0 not 1.  So if ya have 0-47 you have 48 markers, here is my last marker.
 
class Item47
{
position[]={12817.9.14,0.114151,5294};
name="OverpochTrader";
text="Sleazy Sahranis Paradise Plaza and Clinic";
type="mil_circle";
colorName="ColorBlack";
};
 
};
 
 
 
as for the marker types  
 
type= 
 
 
they can be found here (not sure about the Service Station marker specificly tho, but yave a look around with google, ya may find something.
Link to comment
Share on other sites

Edited my post. I had a dumb question. Figured out myself. was just wondering why it was talking about biedi file in the setVectorUp section of the first post since we dont use the biedi file... Now that i have tried it and it works I understand what he meant.

 

 

Now my real question.

 

I have a mapping wich is on shore and a part over the water. Some objects are pretty high (up to 51 meters according to the values I have in the .sqf)

 

because the heigh was off I tried 

_this setVehicleInit "this setVectorUp [0,0,1];";

Allready looks better but some heigh still are way off

 

Should i consider using this ?

this setPosATL

I have no idea how it works! Lets say I want my object 51 meters up in the air... Will it look like this?

  _this setVehicleInit "this setVectorUp [0,0,1];this setPosATL (_this select 51);";

Or does this makes more sence?

_this setVehicleInit "this setVectorUp [0,0,1];";   
_this setVehicleInit "this setPosATL [getposATL this select 0, getposATL this select 1, 51];";

I dont even know if the ''this'' in front is ok... I guess it is because it's calling for the _vehicle_x

 

And for the height value I'm trying to force in I have no idea how i'm suppose to write this. There is an example from BIS :

player setPosATL [ getPosATL player select 0, (getPosATL player select 1) - 10,
getPosATL player select 2]

But again, I have no idea where my height value needs to go. I figure it's at the end (where the 2 is in the example)

 

Any Ideas?

 

Thanks in advance!

Link to comment
Share on other sites

Why not do it like the following?

_vehicle_60 = objNull;
if (true) then
{
  _this = createVehicle ["land_A_TVTower_Base", [6437.8472, 14002.853, 51.00000], [], 0, "CAN_COLLIDE"];
  _vehicle_60 = _this;
  _this setDir 104.81783;
  _this setPos [6437.8472, 14002.853, 51.00000];
};
Link to comment
Share on other sites

 

Why not do it like the following?

 

 

_vehicle_60 = objNull;

if (true) then

{

  _this = createVehicle ["land_A_TVTower_Base", [6437.8472, 14002.853, 51.00000], [], 0, "CAN_COLLIDE"];

  _vehicle_60 = _this;

  _this setDir 104.81783;

  _this setPos [6437.8472, 14002.853, 51.00000];

};

 

I was doing this actually. But I was trying to add the setVectorUp in it so my object get straight! Now it works! and I did not have to use setPosATL.

What I was doing wrong is that I had duplicate like many others but I didnt realized it until I used setPosATL and put everything at 50 meters and I still had the same objects on the ground. So I called my sqf inside server_monitor instead.

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
×
×
  • Create New...