[How-To] Add new Buildings and Objects via database

Discussion in 'General Discussion' started by Doc, Dec 16, 2012.

  1. angry pineapple

    angry pineapple Member

    Joined:
    Apr 4, 2013
    Messages:
    37
    Likes Received:
    3
    Where is fGetVehCount located? Is this a database function or a call from the server.pbo somewhere?
     
  2. Aaron J

    Aaron J Member

    Joined:
    Mar 19, 2013
    Messages:
    43
    Likes Received:
    2
    Yea I am a little lost on step 2 as well granted its not required but I would really like to figure this out.
     
  3. DSH-Nibbler

    DSH-Nibbler Well-Known Member

    Joined:
    Feb 9, 2013
    Messages:
    156
    Likes Received:
    14
    its a function in ur database
     
  4. Aaron J

    Aaron J Member

    Joined:
    Mar 19, 2013
    Messages:
    43
    Likes Received:
    2
    Alright after doing some homework I understand how to do this on a NaviCat server but how do you do this with bliss setup? Can I do Step 2 on a dayz.st server?
     
  5. Jrb

    Jrb New Member

    Joined:
    Jan 4, 2013
    Messages:
    7
    Likes Received:
    0
    Doc, just out of curiosity, how are you adding the lighting objects from your screenshot?
     
  6. mintypie007

    mintypie007 Member

    Joined:
    Mar 4, 2013
    Messages:
    74
    Likes Received:
    0
    This is kinda of overboard to have to do, each building one by one to the database. I am trying to get my mission.sqm to be reconized but it either does nothing or doesn't let the server start. Anyone give me a hand with getting this huge edited map installed into this server pack?
     
  7. Rossymond

    Rossymond Moderator Staff Member

    Joined:
    Apr 12, 2013
    Messages:
    317
    Likes Received:
    65
    Just use the SQF from the mission file you created when editing, and exec it from the init file, pissing around with mission.sqm and databases really is not needed.
     
  8. mintypie007

    mintypie007 Member

    Joined:
    Mar 4, 2013
    Messages:
    74
    Likes Received:
    0
    So all I do is take the mission.sqf file I have, use the exact exec script on the init file described in the videos? Do I need to edit the mission.sqf file like he does in the video?

    The server package also comes with a mission.sqm. I leave this alone yes? I think I may have began messing with this causing me issues.

    I just put the mission.sqf file in my mission folder with the included mission.sqm. I added If (isserver) then [execVM "mission.sqf";]; to the bottom of my init, initially it gave me a something went wrong and put me in debug then it put me in the map without any additions.

    Any ideas?
     
  9. mintypie007

    mintypie007 Member

    Joined:
    Mar 4, 2013
    Messages:
    74
    Likes Received:
    0
    I just double checked and I actually did make the changes to my sqf file like in the video. Need to wait for someone else to give me another copy of that file since I saved over it. Safe to say that if I just put the mission.sqf file unedited with the init changes it should work?
     
  10. mintypie007

    mintypie007 Member

    Joined:
    Mar 4, 2013
    Messages:
    74
    Likes Received:
    0
    I was able to get a hold of another copy of my mission.sqf file. I made the edits in the init file, edited the sqf file at the top and bottom. The server sends the mission file out but sits at the progress screen and just keeps counting up.
     
  11. Rossymond

    Rossymond Moderator Staff Member

    Joined:
    Apr 12, 2013
    Messages:
    317
    Likes Received:
    65
    You have to edit the file. Basically the file is

    Code:
    if (isServer) then {
     
    blah blah bunch of vehicles.
     
    }
    So to add one building

    Code:
    if (isServer) then {
     
    _vehicle_8 = objNull;
    if (true) then
    {
      _this = createVehicle ["Land_A_FuelStation_Build", [1286.8618, 2435.3079, -5.7220459e-006], [], 0, "CAN_COLLIDE"];
      _vehicle_8 = _this;
      _this setDir 94.335472;
      _this setPos [1286.8618, 2435.3079, -5.7220459e-006];
    };
    };
    There, and so on and so forth for multiple buildings.

    I use a folder "buildings" in my mission PBO,

    Then

    [] execVM "buildings\yourbuildings.sqf";

    Done.
     
  12. mintypie007

    mintypie007 Member

    Joined:
    Mar 4, 2013
    Messages:
    74
    Likes Received:
    0
    Ah, you see I had simply removed everything expect for the vehicle statements from the sqf file. I then called the sqf file from the init with the isserver (execvm etc...

    What happened i think is when someone would log into the server it would spawn another building. While testing i had 6 or 7 barracks placed exactly atop one another. I realized what was going on when there was an unbearable lag when someone went close to a city.

    I had also included my mission.sqm since doing it this way would not allow it to load without it.
    Just to clarify

    in my mission.sqf
    if (isServer) then { my mission.sqf file contents with the vehicles }

    then in my init

    [] execVM "buildings\mission.sqf";

    I do not need to use the if isserver statment again here before the execvm? I don't do I since it will also be Server?
     
  13. Doc

    Doc Valued Member!

    Joined:
    Nov 23, 2012
    Messages:
    355
    Likes Received:
    39
    Guys please don't spam this with SQF discussion. You obviously can add buildings via SQF and it is easier, but not everybody has access to the mission file when they buy hosting from certain companies. This page is for THEM using the DATABASE method.

    In response to an earlier post: the lighting is me throwing flares :rolleyes:
     
  14. DahBlount

    DahBlount New Member

    Joined:
    Jul 21, 2013
    Messages:
    10
    Likes Received:
    2
    I added a "Land_Ind_TankSmall2" to the object_data but it did not spawn. I had the object parameters set correctly and it's coordinates are shifted to avoid getting into any objects or vehicles. Is there a possibility I need to add the building I want to use in the object_classes table?

    I also attempted the "Land_Mil_ControlTower" test but that did not work either. After checking the spawn queue in the MySQL Cmd instead of a "0" after the class name, it had ",", which I assume could tell me something about my problem but I don't know what it is.

    This does work with Navicat correct?

    Your explanation helped me, thank you. Is the object Map ID, just a continuation from the highest already on there when you add a building?
     
  15. redzanakub

    redzanakub New Member

    Joined:
    Apr 29, 2013
    Messages:
    1
    Likes Received:
    0
    That i just Add new object step by step it myself.
    This does work spwans Buliding in game.

    That's my MySQL
    [​IMG]

    ? So how to done solve the problem ?
     
  16. John C

    John C New Member

    Joined:
    Aug 3, 2013
    Messages:
    18
    Likes Received:
    2
    how to convert this mission file.sqf coord ("[13451.714, 11733.261, 0.21902354] ") to database coord?
     
  17. alexlawson

    alexlawson OpenDayZ Rockstar!

    Joined:
    Jan 5, 2014
    Messages:
    721
    Likes Received:
    116
  18. Chris Atkins

    Chris Atkins Valued Member!

    Joined:
    Aug 28, 2013
    Messages:
    407
    Likes Received:
    52
    There's an easier way of adding buildings via 3d editor then renaming the mission.sqf to say, "balota_addon.sqf", then place in a custom folder in your server pbo and add a "call compile preProcessFileLineNumbers "\z\addons\dayz_server\buildings\balota_addon.sqf";" for example, to the server_functions.sqf file.

    Anyhow, I know there's a full tutorial around somewhere....
     

Share This Page