Helicopters explode on reboot if left on top of buildings... plus cars do too!

Discussion in 'Scripting Discussions' started by MikeTheMike, Apr 13, 2013.

  1. MikeTheMike

    MikeTheMike Well-Known Member

    Joined:
    Jan 29, 2013
    Messages:
    112
    Likes Received:
    4
    Okay, I HAVE used the search function, and can't seem to find anything quite matching this...

    If I leave a heli on top of a building, sometimes on server reboot, it comes in blown up (I have a theory!)

    Also, we have a base built, that uses the heli flat platforms as the floor (Land_LHD_elev_R) - cars sometimes explode on reboot if left parked on these :(

    MY THEORY:

    Perhaps what is happening, is that vehicles are spawning in the game at the right worldspace (inc. height), but yet for some reason, the building (or raised floor in the case of our base!) does not appear first, so the spawned in vehicle drops, and explodes.

    This would kinda make sense in a way, as sometimes the vehicles left on the raised floor (which is a about half a meter above the floor), on reboot, just their wheels are blown :p

    Then, when the building (or floor in case of our base!) comes in during the server boot, the vehicle is somehow pushed back up to where it should be... busted up though.

    Just not sure, as perhaps my theory is a load of rubbish :D

    QUESTION: Has anyone else had issues with helis blowing up when left on top of buildings, or any related issues?

    Any advice?

    Thanks guys :D
     
  2. daambi

    daambi Member

    Joined:
    Apr 4, 2013
    Messages:
    79
    Likes Received:
    2
    I am also interested in this topic, my issues is them blowing up on the carrier.
     
  3. J3T

    J3T Valued Member!

    Joined:
    Apr 8, 2013
    Messages:
    292
    Likes Received:
    29
    The solution is simple as f*ck. The vehicles are load BEFORE the buldings. That results in vehicle which are in the building...and that is the reason why they blow up.
     
  4. MikeTheMike

    MikeTheMike Well-Known Member

    Joined:
    Jan 29, 2013
    Messages:
    112
    Likes Received:
    4
    Ah, kinda what I suspected then?

    Although - that's more the PROBLEM than the SOLUTION ;) hehehe

    Anyone know a way around this? Delay the spawning of vehicles?
     
  5. J3T

    J3T Valued Member!

    Joined:
    Apr 8, 2013
    Messages:
    292
    Likes Received:
    29
    Sorry used the wrong word :D.
     
    MikeTheMike likes this.
  6. MikeTheMike

    MikeTheMike Well-Known Member

    Joined:
    Jan 29, 2013
    Messages:
    112
    Likes Received:
    4
    No worries :D
     
  7. simon

    simon Member

    Joined:
    Apr 1, 2013
    Messages:
    59
    Likes Received:
    2
    i to have had this same problem ! lol heres another thing i noticed yesterday after a server restart the hospital in cherno had spawn twice! making it glitched impossible to break glass for loot even tried to blow it up with 20 pipebombs but still the hospital was standing lol wen i walked on the roof it sounded like i was walking on a metal container deep bassy footsteps lol very strange
     
  8. MikeTheMike

    MikeTheMike Well-Known Member

    Joined:
    Jan 29, 2013
    Messages:
    112
    Likes Received:
    4
    Nobody have any solution to this? Does it mean that on DayZ, heli's can't be left on the roof???
     
  9. mmmyum

    mmmyum Valued Member!

    Joined:
    Apr 12, 2013
    Messages:
    352
    Likes Received:
    51
    At the moment, that is what it means.

    You can look at spawning buildings before helis, or freezing helis in air (disable gravity sim) for a few seconds on start - try looking in dayz_code.pbo and dayz_server.pbo for the files that handle server boot vehicle loading, and add a sleep 5; to them or something.
     
  10. Kind-Sir

    Kind-Sir OpenDayZ Rockstar!

    Joined:
    Jan 6, 2013
    Messages:
    122
    Likes Received:
    124
    How about having a check when publishing vehicles, and any vehicle that is not touching ground (has a height higher than 0.2m) would be loaded in after a few seconds, giving the buildings they're on time to spawn in.
     
  11. mmmyum

    mmmyum Valued Member!

    Joined:
    Apr 12, 2013
    Messages:
    352
    Likes Received:
    51
    That sounds like it would work @Kind-Sir, I just don't know much about how stuff is spawned in in the first place - you would have to make sure that and sleep command to make it wait a few seconds didn't hold up the whole server boot by pausing the whole thing (again, no expert here).
    You could also try setting a variable for them as they spawn, then suspending gravity simulation on anything with that variable until server start is complete (or the buildings are in or something)
     
  12. Hangender

    Hangender Valued Member!

    Joined:
    Jan 14, 2013
    Messages:
    126
    Likes Received:
    37
    just comment out the _object setvelocity [0,0,1]; line in your server_monitor.sqf.

    When you do createVehicle the vehicle stays in the air until something collide with it or a command like setvelocity is used
     
  13. Kind-Sir

    Kind-Sir OpenDayZ Rockstar!

    Joined:
    Jan 6, 2013
    Messages:
    122
    Likes Received:
    124
    in dayz_server.pbo/system/server_monitor.sqf, you can just move the buildings up, or look for the line:
    Code:
    if (_damage < 1) then {
    and edit it from there with the previous idea:


     
  14. MikeTheMike

    MikeTheMike Well-Known Member

    Joined:
    Jan 29, 2013
    Messages:
    112
    Likes Received:
    4
    Thanks Kind-Sir (and Hangender and mmmyum!)...

    Kind-Sir, when you say
    - Sorry if I am being abit slow, but could you explain a bit more on this?

    Thanks! REALLY appreicated :D
     
  15. MikeTheMike

    MikeTheMike Well-Known Member

    Joined:
    Jan 29, 2013
    Messages:
    112
    Likes Received:
    4
    Do you mean literally just cut/paste the stuff for spawning buildings above the part that spawns vehicles? Perhaps with 3 or 4 seconds wait between them?
     
  16. MikeTheMike

    MikeTheMike Well-Known Member

    Joined:
    Jan 29, 2013
    Messages:
    112
    Likes Received:
    4
    Hmmmm not sure I am getting this right (not tried anything yet, just reading the files :) )
    But... in the server_monitor.sqf file, where it is referring to buildings, it 'appears' (to me at least) that it is talking about buildings in the database, rather than the mission file (instance_building etc)...

    Hmmmm If that is the case, does server_monitor.sqf get processed in it's entirety then, before mission file-based buildings etc?

    Meh! Not sure if I am understanding this properly :p

    I am wondering if putting a wait on vehicles that have a height above 'x' as you suggested, will in fact then pause the processing of the whole file, and so not have the desired effect? Anyone know this?

    Hangender - any other side effects of your suggestion?

     
  17. daambi

    daambi Member

    Joined:
    Apr 4, 2013
    Messages:
    79
    Likes Received:
    2
    Really interested in getting this to work, like Mike mentions above I am also not understanding this properly. :-/
     
  18. mmmyum

    mmmyum Valued Member!

    Joined:
    Apr 12, 2013
    Messages:
    352
    Likes Received:
    51
    That's what he means. Move the customstreaming part for the buildings above the vehicles part - and it will load those buildings first (from the buildings table in the db) before the vehicles (vehicles tables in the db). If you want to use a sleep, make it 0.1 or something small, so the hold up if there is one is negligible.

    This is only for buildings in the DB, so it doesn't fix everything - but I think it would make any custom buildings you added load first so the vehicles (provided nothing shifted due to arma being stupid) will be ok, and load on top.

    Now as for the other suggestion, by Hangender -
    Code:
    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;
    };
    He means to comment out this line. Now I think that any vehicles left very high in the air will just float there if we do that - anything above ground will not fall. Not 100% sure on this. Perhaps we could remove it and add another call for it to the end of the file, under the same if statement
    Code:
    if (_object isKindOf "AllVehicles") then {
    _object setvelocity [0,0,1];
    }
    
    So gravity doesn't happen until the file is fully processed.

    But what about the rest of the buildings on map? I want them all to work - y'know, like buildings!

    When are the map files buildings processed?
     
    MikeTheMike likes this.
  19. MikeTheMike

    MikeTheMike Well-Known Member

    Joined:
    Jan 29, 2013
    Messages:
    112
    Likes Received:
    4
    Thanks :) That cleared up my thoughts!

    Like you though, I'm really interested in all buildings... for 2 reasons.

    1) My base is added in the mission.sqm file, not database :D

    2) I want it to be okay for all players - say if someone lands on hospital, etc :)

    I might setup a 2nd dayz instance on my server just for testing all this later this week :D

    Mike.

     
  20. daambi

    daambi Member

    Joined:
    Apr 4, 2013
    Messages:
    79
    Likes Received:
    2
    Just bumping this thread to see if anyone has managed to resolve the issue of helicopters blowing up on restart?

    Thanks
     

Share This Page