Jump to content

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


Poncho

Recommended Posts

Quick question, as I have been looking around and getting brain drain with so much scripting and stuff. I would like to add a locked Cinder Garage door via the map editor. I already placed the door and put a lock on it while in the game itself. I then went into the database and got the object name and world space location and put it in my custom map file. My question is, how would I go about giving the door/lock a CharacterID (unlock code) so that it can be unlocked via reg non-admin means?

 

_bldObj_7506 = objNull;
if (true) then
{
  _this = createVehicle ["CinderWallDoorLocked_DZ", [10318.1, 17554.7, -0.199], [], 0, "CAN_COLLIDE"];
  _bldObj_7506 = _this;
  _this setDir 220.831;
  _this setPos [10318.1, 17554.7, -0.199];
};
 
Thx alot for any assistance, and if this has been covered already, can you provide a link to the topic plz. 
Link to comment
Share on other sites

 

Quick question, as I have been looking around and getting brain drain with so much scripting and stuff. I would like to add a locked Cinder Garage door via the map editor. I already placed the door and put a lock on it while in the game itself. I then went into the database and got the object name and world space location and put it in my custom map file. My question is, how would I go about giving the door/lock a CharacterID (unlock code) so that it can be unlocked via reg non-admin means?

 

_bldObj_7506 = objNull;
if (true) then
{
  _this = createVehicle ["CinderWallDoorLocked_DZ", [10318.1, 17554.7, -0.199], [], 0, "CAN_COLLIDE"];
  _bldObj_7506 = _this;
  _this setDir 220.831;
  _this setPos [10318.1, 17554.7, -0.199];
};
 
Thx alot for any assistance, and if this has been covered already, can you provide a link to the topic plz. 

 

I have been wondering if you could do something like this to buildings with doors already on them! I see in the locked status it has locked: true, false, default. Does this have anything remotely to do with with how I would begin to sort out achieving this? 

Don't mean to stray off your topic but if anyone can add a little side note if they know how one could find more info on this.

Link to comment
Share on other sites

I wouldent do this ^^

 

I would go as far as placing the Cinder Block down, but with no door.
Then add the door and lock through the game. They work how they are meant to this way. If you want to change the door combo lock number do it through the database.

 

Dont get me wrong it can be done, but I think this is the simple way of doing this =)

Link to comment
Share on other sites

I was thinking the same thing, but adding the lock to the door via in game, that way it gives a character ID for it. was just trying to reduce the amount of info that will eventually end up in the database. Also looking at this as a learning experience, which is why i decided to ask instead of taking the easy way out.  8>)

Link to comment
Share on other sites

I wouldent do this ^^

 

I would go as far as placing the Cinder Block down, but with no door.

Then add the door and lock through the game. They work how they are meant to this way. If you want to change the door combo lock number do it through the database.

 

Dont get me wrong it can be done, but I think this is the simple way of doing this =)

Was this pertained to my comment as well?

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

Can I have multiple sqf files for custom buildings on a server? For instance can I have a file for a custom Balota.sqf, a Custom Trader.sqf, and a Bridge.sqf? If so, how does or can the editor make sure that ' _vehicle_numbers ' aren't duplicated between the files, or does that matter? (I'm guessing it does)

Link to comment
Share on other sites

Can I have multiple sqf files for custom buildings on a server? For instance can I have a file for a custom Balota.sqf, a Custom Trader.sqf, and a Bridge.sqf? If so, how does or can the editor make sure that ' _vehicle_numbers ' aren't duplicated between the files, or does that matter? (I'm guessing it does)

Have as many as you want and don't worry about duplicating vehicle numbers, it'll still work :)

Link to comment
Share on other sites

it is in @DayZ_Epoch_Server\addons\dayz_server.pbo\missions\map that you run\mission.sqf

 

But this runs your traders.

So what is it that you want to do?

i have added those big Villas around the map (lingor) and want to add them into my server. so do i put them in:

dayz_server.pbo\missions\DayZ_Epoch_7.Lingor\mission.sqf

Link to comment
Share on other sites

Not sure this has been suggested yet, as I read through the comments but may have overlooked it. But I'm going to share what I think is an easy way to organize your map files and will make it easier to restore many maps when you need to wipe your server. I decided to do this when I was adding each of our players bases to a separate map file for each. Typically this would mean adding each base as a separate line item to the server_functions.sqf. This could easily result in having to add 40+ lines of code, so instead I just added One line to the bottom of my server_functions.sqf 

 

 

execVM  "\z\addons\dayz_server\dfltcustom\mapcompiles.sqf";

 

I then made a file called mapcompiles.sqf and placed it in my dfltcustoms folder. In the newly created mapcompiles.sqf I added each map edit to that file.
 
//Call Custom Server mod buildings HERE not in server functions
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\chateau_de_ganja.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\mtwtf.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\ganjafield1.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\dobersshoreshack.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\campbananahammock.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\aitrucksparkystop.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\iambbase.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\castlefourtwenty.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\campkiwi.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\mattzmansion.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\dobersdoghouse.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\phyrsstormceller.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\chadcharities.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\vetguysretreat.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\hmsmurders.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\bryansbase.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\randomsrandomness.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\waynemanor.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\dgirlscrib.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\behemothsisland.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\behemothsbridge.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\homeofthebeast.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\yourmomshomesweethome.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\adysbase.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\stubbysstation.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\aiisland.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\dustinsden.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\jamiesjumble.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\greensmokesshack.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\sykocity.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\mapupdatedbaseinway.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\mysterybase1.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\aosareaodoperations.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\AeilHouse.sqf";
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\ai_airfield.sqf";
//Trader and Banks
call compile preProcessFileLineNumbers "\z\addons\dayz_server\dfltcustom\ganja_mapedits\dflt_banks.sqf";
 
And as you can see I placed each map edit file in folder location dfltcustom\ganja_mapedits\
 
So now when we update our server, we only have to replace one line of code to re-add every single map edit we done. Sure we could have added all these edits to one single map file, but that is messy and confusing, This way, if someone wants to remove a base or even temp remove an edit for an event we just have to // the line of the map edit.
 
Again sry if this was already mentioned, but I didn't see it and thought I would share an organization tip to help keep your servers clean and easy to manage.  
Link to comment
Share on other sites

 

Ok I also had this problem before with dayz.st a while back, maybe you are using them as a host? Either way here is the fix I used.

In dayz_server.pbo\server_monitor.sqf find

//Send the key
_key = format["CHILD:999:select b.class_name, ib.worldspace from instance_building ib join building b on ib.building_id = b.id where ib.instance_id = ?:[%1]:", dayZ_instance];
_data = "HiveEXT" callExtension _key;

diag_log("SERVER: Fetching buildings...");

//Process result
_result = call compile format ["%1", _data];
_status = _result select 0;

_bldList = [];
_bldCount = 0;
if (_status == "CustomStreamStart") then {
_val = _result select 1;
for "_i" from 1 to _val do {
_data = "HiveEXT" callExtension _key;
_result = call compile format ["%1",_data];

_pos = call compile (_result select 1);
_dir = _pos select 0;
_pos = _pos select 1;

_building = createVehicle [_result select 0, _pos, [], 0, "CAN_COLLIDE"];
_building setDir _dir;
_bldCount = _bldCount + 1;
};
diag_log ("SERVER: Spawned " + str(_bldCount) + " buildings!");

T
hat's actually the code responsible for spawning buildings at server start. Now look a little lower and you'll find the same code again (Sometimes it has been duplicated) If that is the case - Delete it.

 

Next step...

 

        Before:    

//Send the key
_key = format["CHILD:999:select b.class_name, ib.worldspace from instance_building ib join building b on ib.building_id = b.id where ib.instance_id = ?:[%1]:", dayZ_instance];
_data = "HiveEXT" callExtension _key; 

        Add:

} forEach _objList;

That should be it, hope it works out :)

 

 

I'm running a Celle 1.9 server and this is my server_monitor:

 

 

[]execVM "\z\addons\dayz_server\system\s_fps.sqf"; //server monitor FPS (writes each ~181s diag_fps+181s diag_fpsmin*)
 
dayz_versionNo = getText(configFile >> "CfgMods" >> "DayZ" >> "version");
dayz_hiveVersionNo = getNumber(configFile >> "CfgMods" >> "DayZ" >> "hiveVersion");
_script = getText(missionConfigFile >> "onPauseScript");
 
if ((count playableUnits == 0) and !isDedicated) then {
isSinglePlayer = true;
};
 
waitUntil{initialized}; //means all the functions are now defined
 
diag_log "HIVE: Starting";
 
if (_script != "") then
{
diag_log "MISSION: File Updated";
} else {
while {true} do
{
diag_log "MISSION: File Needs Updating";
sleep 1;
};
};
 
//Send the key
_key = format["CHILD:999:select payload, loop_interval, start_delay from message where instance_id = ?:[%1]:", dayZ_instance];
_data = "HiveEXT" callExtension _key;
 
diag_log("SERVER: Fetching messages...");
 
//Process result
_result = call compile format ["%1", _data];
_status = _result select 0;
 
msgList = [];
_msgCount = 0;
if (_status == "CustomStreamStart") then {
        _val = _result select 1;
        for "_i" from 1 to _val do {
                _data = "HiveEXT" callExtension _key;
                _result = call compile format ["%1",_data];
 
                _status = _result select 0;
                msgList set [count msgList, _result];
                _msgCount = _msgCount + 1;
        };
        diag_log ("SERVER: Added " + str(_msgCount) + " messages!");
};
 
//Stream in objects
/* STREAM OBJECTS */
//Send the key
_key = format["CHILD:302:%1:",dayZ_instance];
_result = _key call server_hiveReadWrite;
 
diag_log "HIVE: Request sent";
 
//Process result
_status = _result select 0;
 
_myArray = [];
if (_status == "ObjectStreamStart") then {
_val = _result select 1;
//Stream Objects
diag_log ("HIVE: Commence Object Streaming...");
for "_i" from 1 to _val do {
_result = _key call server_hiveReadWrite;
 
_status = _result select 0;
_myArray set [count _myArray,_result];
//diag_log ("HIVE: Loop ");
};
//diag_log ("HIVE: Streamed " + str(_val) + " objects");
};
 
_countr = 0;
{
 
//Parse Array
_countr = _countr + 1;
 
_idKey = _x select 1;
_type = _x select 2;
_ownerID = _x select 3;
_worldspace = _x select 4;
_intentory= _x select 5;
_hitPoints= _x select 6;
_fuel = _x select 7;
_damage = _x select 8;
 
_dir = 0;
_pos = [0,0,0];
_wsDone = false;
if (count _worldspace >= 2) then
{
_dir = _worldspace select 0;
if (count (_worldspace select 1) == 3) then {
_pos = _worldspace select 1;
_wsDone = true;
}
};
if (!_wsDone) then {
if (count _worldspace >= 1) then { _dir = _worldspace select 0; };
_pos = [getMarkerPos "center",0,4000,10,0,2000,0] call BIS_fnc_findSafePos;
if (count _pos < 3) then { _pos = [_pos select 0,_pos select 1,0]; };
diag_log ("MOVED OBJ: " + str(_idKey) + " of class " + _type + " to pos: " + str(_pos));
};
 
if (_damage < 1) then {
diag_log format["OBJ: %1 - %2", _idKey,_type];
 
//Create it
_object = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];
_object setVariable ["lastUpdate",time];
if (_ownerID == "0") then {_object setVariable ["ObjectID", str(_idKey), true];} else {_object setVariable ["ObjectUID", str(_idKey),true];}; //_object setVariable ["ObjectID", _idKey, true];
_object setVariable ["CharacterID", _ownerID, true];
 
clearWeaponCargoGlobal  _object;
clearMagazineCargoGlobal  _object;
 
if (_object isKindOf "TentStorage") then {
_pos set [2,0];
_object setpos _pos;
_object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
};
_object setdir _dir;
_object setDamage _damage;
 
if (count _intentory > 0) then {
//Add weapons
_objWpnTypes = (_intentory select 0) select 0;
_objWpnQty = (_intentory select 0) select 1;
_countr = 0;
{
if (_x == "Crossbow") then { _x = "Crossbow_DZ" }; // Convert Crossbow to Crossbow_DZ
_isOK = isClass(configFile >> "CfgWeapons" >> _x);
if (_isOK) then {
_block = getNumber(configFile >> "CfgWeapons" >> _x >> "stopThis") == 1;
if (!_block) then {
_object addWeaponCargoGlobal [_x,(_objWpnQty select _countr)];
};
};
_countr = _countr + 1;
} forEach _objWpnTypes; 
 
//Add Magazines
_objWpnTypes = (_intentory select 1) select 0;
_objWpnQty = (_intentory select 1) select 1;
_countr = 0;
{
if (_x == "BoltSteel") then { _x = "WoodenArrow" }; // Convert BoltSteel to WoodenArrow
_isOK = isClass(configFile >> "CfgMagazines" >> _x);
if (_isOK) then {
_block = getNumber(configFile >> "CfgMagazines" >> _x >> "stopThis") == 1;
if (!_block) then {
_object addMagazineCargoGlobal [_x,(_objWpnQty select _countr)];
};
};
_countr = _countr + 1;
} forEach _objWpnTypes;
 
//Add Backpacks
_objWpnTypes = (_intentory select 2) select 0;
_objWpnQty = (_intentory select 2) select 1;
_countr = 0;
{
_isOK = isClass(configFile >> "CfgVehicles" >> _x);
if (_isOK) then {
_block = getNumber(configFile >> "CfgVehicles" >> _x >> "stopThis") == 1;
if (!_block) then {
_object addBackpackCargoGlobal [_x,(_objWpnQty select _countr)];
};
};
_countr = _countr + 1;
} forEach _objWpnTypes;
};
 
if (_object isKindOf "AllVehicles") then {
{
_selection = _x select 0;
_dam = _x select 1;
if (_selection in dayZ_explosiveParts and _dam > 0.8) then {_dam = 0.8};
[_object,_selection,_dam] call object_setFixServer;
} forEach _hitpoints;
_object setvelocity [0,0,1];
_object setFuel _fuel;
_object call fnc_vehicleEventHandler;
};
 
//Monitor the object
//_object enableSimulation false;
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
};
} forEach _myArray;
 
// # END OF STREAMING #
} forEach _objList;
// Spawn Buildings
        //Send the key
        _key = format["CHILD:999:select b.class_name, ib.worldspace from instance_building ib join building b on ib.building_id = b.id where ib.instance_id = ?:[%1]:", dayZ_instance];
        _data = "HiveEXT" callExtension _key;
        diag_log("SERVER: Fetching buildings...");
 
        //Process result
        _result = call compile format ["%1", _data];
        _status = _result select 0;
 
        _bldList = [];
        _bldCount = 0;
        if (_status == "CustomStreamStart") then {
                _val = _result select 1;
                for "_i" from 1 to _val do {
                        _data = "HiveEXT" callExtension _key;
                        _result = call compile format ["%1",_data];
 
                        _pos = call compile (_result select 1);
                        _dir = _pos select 0;
                        _pos = _pos select 1;
 
                        _building = createVehicle [_result select 0, _pos, [], 0, "CAN_COLLIDE"];
                        _building setDir _dir;
                        _bldCount = _bldCount + 1;
                };
                diag_log ("SERVER: Spawned " + str(_bldCount) + " buildings!");
        };
 
//Set the Time
//Send request
_key = "CHILD:307:";
_result = _key call server_hiveReadWrite;
_outcome = _result select 0;
if(_outcome == "PASS") then {
_date = [2012,8,31,(_result select 1) select 3, (_result select 1) select 4]; 
if(isDedicated) then {
//["dayzSetDate",_date] call broadcastRpcCallAll;
setDate _date;
dayzSetDate = _date;
publicVariable "dayzSetDate";
};
 
diag_log ("HIVE: Local Time set to " + str(_date));
};
 
createCenter civilian;
if (isDedicated) then {
endLoadingScreen;
};
 
if (isDedicated) then {
_id = [] execFSM "\z\addons\dayz_server\system\server_cleanup.fsm";
};
[] call compile preprocessFileLineNumbers "\z\addons\dayz_server\DZAI\init\dzai_initserver.sqf";
allowConnection = true;
 
// [_guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire]
nul = [3, 4, (50 * 60), (15 * 60), 0.75, 'center', 4000, true, false] spawn server_spawnCrashSite;
 
I'm still getting dual-spawned buildings. I'm stumped.
Link to comment
Share on other sites

  • 3 weeks later...

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.

 

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