Announcement

Collapse
No announcement yet.

Vehicles respawn problems with ACE

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Vehicles respawn problems with ACE

    I was rearranging one older map to new version and change vehicles with ACE version of vehicles.

    I notice problems with re spawn. It is usual script which when the vehicle is inactive disappeared and spawn back on starting position.

    Problem is when player get in the vehicle start to drive after same time, same like when vehicle is inactive, vanish like it is inactive but you driving it suddenly you are outside scratching road with your but without trace of your vehicle that just respawn back on starting position.
    Sometimes working OK sometime not and I notice same bug on Evolution for ACE.

    Did anybody knows how to fix that problem or is maybe bug in ACE mod itself?

  • #2
    Re: Vehicles respawn problems with ACE

    Which script are you using? I have been using a old school OFP one and it works fine. I can post it up if you need the file and activation....
    "The chief foundations of all states, new as well as old or composite, are good laws and good arms; and as there cannot be good laws where the state is not well armed, it follows that where they are well armed they have good laws." -Machiavelli

    Comment


    • #3
      Re: Vehicles respawn problems with ACE


      // File Description
      // Name : vehicleRespawn.sqf
      // Called by : Arma engine in init lines from vechiles, and by itself!
      // Referenced by : mission.sqm, vehicleRespawn.sqf (this file!)
      // Client/Server : server side (though it runs on clients and terminates straight away)
      // Function area : game mechanics (vehicle respawning)
      //
      // Description
      // This script is run by the game engine with arguments for each vehicle in
      // the game. At initialisation time, it records the initial position of the vehicle,
      // and then monitors the damage, fuel level of the vehicle. If the levels drop too
      // low, the script deletes the vehicle, creates a new one on the original spot
      // and then re-launches itself to look after the new vehicle. Finally it terminates.
      //
      // This script has some known issues at the moment, occasionally vehicles just
      // disappear while you are driving them. Needs a little debugging.

      // ----------------------------------------------------------------------------
      // DEFINES
      // ----------------------------------------------------------------------------

      #include "globalDefines.hpp"

      #define MAX_STATIONARY_TIME (60*3)
      #define MAX_DAMAGE 0.9

      // ----------------------------------------------------------------------------
      // MAIN FUNCTION
      // ----------------------------------------------------------------------------

      // this function is called by every vehicle to record its
      // initial coords then respawn it if it is destroyed
      if( isServer ) then
      {
      int _respawnDelay = _this select 1;
      _theVehicle = vehicle (_this select 0);

      _startDirection = getDir (_this select 0);
      pos _startPos = getPos _theVehicle;
      _typ = typeOf (_this select 0);

      bool _abandoned = false;
      float _lastMovedTime = time;

      // main loop
      while { (damage _theVehicle < MAX_DAMAGE) and (canMove _theVehicle) and (fuel _theVehicle > 0) and !_abandoned } do
      {
      sleep 5;

      if( speed _theVehicle > 0 ) then { _lastMovedTime = time };
      if( (time-_lastMovedTime) > MAX_STATIONARY_TIME and (_theVehicle distance _startPos) > 20 ) then { _abandoned=true; };
      };

      sleep _respawnDelay;
      deleteVehicle (_this select 0);
      _newVehicle = _typ createVehicle [_startPos select 0, _startPos select 1,0];
      _newVehicle setDir _startDirection;
      [_newVehicle,_respawnDelay] execVM "vehicleRespawn.sqf";
      exit;
      };

      this is whole script and looks like I will need your verzion.

      Thanks.

      Comment


      • #4
        Re: Vehicles respawn problems with ACE

        I used this one the other day and it worked fine.


        Initialization: this exec "respawn_vehicle.sqs";

        Originally posted by ;respawn_vehicle.sqs
        ? !(Local server) : Exit



        _vehicle = Vehicle _this

        _startpos = GetPos _vehicle

        _direction = GetDir _vehicle

        _typ = TypeOf _this





        #loop

        ~10

        ? (GetDammage _vehicle > 0.98) : Goto "checkdamage"

        ? !(CanMove _vehicle) : Goto "checkmove"

        ? (Fuel _vehicle == 0) : Goto "checkfuel"

        Goto "loop"





        #checkdamage

        ~10

        ? (GetDammage _vehicle > 0.98) : Goto "destruct"

        Goto "loop"





        #checkmove

        ~10

        ? (GetDammage _vehicle == 1) : Goto "destruct"

        ~120

        ? (CanMove _vehicle) : Goto "loop"

        Goto "destruct"





        #checkfuel

        ~10

        ? (GetDammage _vehicle == 1) : Goto "destruct"

        ~120

        ? (Fuel _vehicle > 0) : Goto "loop"

        Goto "destruct"





        #destruct

        ? (GetDammage _vehicle < 1) : _vehicle SetDammage 1

        ~30

        DeleteVehicle _vehicle

        Goto "createnew"





        #createnew

        ~10

        _new = _typ CreateVehicle [_startpos Select 0, _startpos Select 1,0]

        _new SetDir _direction

        _new Exec "respawn_vehicle.sqs"

        Exi

        Hopefully this helps!! Good luck!
        "The chief foundations of all states, new as well as old or composite, are good laws and good arms; and as there cannot be good laws where the state is not well armed, it follows that where they are well armed they have good laws." -Machiavelli

        Comment


        • #5
          Re: Vehicles respawn problems with ACE

          Steel didn't have time to test it but thanks’.
          Sorry I didn’t thank you earlier.

          Comment

          Connect

          Collapse

          TeamSpeak 3 Server

          Collapse

          Advertisement

          Collapse

          Twitter Feed

          Collapse

          Working...
          X