Jump to content

Darren-NYPD

Members
  • Posts

    190
  • Joined

  • Last visited

Posts posted by Darren-NYPD

  1. Hi, sorry  for the long post hehe.. well I tried using the LA mod Siren instead but then some units does not have sirens available..

    example: in the case of ambulances I have everything named like the la mod. ambulance01.e4p etc... the only difference is that my folder is 01 Ambulance not 01 La Ambulance

    so all I needed to modify was the location of folder (removing LA). but after this ambulances are still without sirens.

    I also renamed the names of the sirens from the script to those in my mod.

    .

  2. Hi, I was using the NYCsiren for my personal mod, I separated some types of vehicles such as NEF from the other ones in it category ez: ITW etc so

    units assigned as NEF have different siren sound. I did this to the RW, MTW and STW.

    It is working fine but sometimes when I click on a unit to move somewhere the siren start and keeps on going even when the unit stops moving

    and there is now way I can turn it off except to send the unit home.

    Any Idea What might be wrong?

    This is the script:

    const char CMD_AUTOSIREN_OFF[]   = "VcmdAutoSirenOff";
    const char EACTION_FINDPATH[]    = "EActionFindPath";
    const char EACTION_EXTINGUISH[]   = "EActionExtinguish";
    const char OBJ_INVIS[]     = "mod:Prototypes/Objects/01 Equipment/invisible.e4p";
    const char DUMMY_HASSIREN[]    = "DummyHasSiren";
    const char DUMMY_UPDATEPOS[]    = "DummyUpdatePos";
    const char DUMMY_FINDPATH[]    = "DummyFindPath";
    const char DUMMY_HOSESON[]     = "DummyHosesAreOn";
    const char DUMMY_RANDOMSPAWN[]   = "DummyRandomSpawn";
    const char DUMMY_RANDOMGOHOME[]   = "DummyRandomGoHome";
    const char NAME_DUMMYOBJECT[]    = "HelpingObjekt_Hoppah";

    const char PROTO_ENGINE01[]    = "mod:Prototypes/Vehicles/02 Fire Department/engine01.e4p";
    const char PROTO_ENGINE02[]    = "mod:Prototypes/Vehicles/02 Fire Department/engine02.e4p";
    const char PROTO_SQUAD01[]     = "mod:Prototypes/Vehicles/02 Fire Department/squad61.e4p";
    const char PROTO_LADDER01[]    = "mod:Prototypes/Vehicles/02 Fire Department/ladder01.e4p";
    const char PROTO_LADDER02[]    = "mod:Prototypes/Vehicles/02 Fire Department/ladder02.e4p";
    const char PROTO_HAZMAT01[]    = "mod:Prototypes/Vehicles/02 Fire Department/hazmat01.e4p";
    const char PROTO_HAZMAT02[]    = "mod:Prototypes/Vehicles/02 Fire Department/hazmat02.e4p";
    const char PROTO_RESCUE01[]    = "mod:Prototypes/Vehicles/02 Fire Department/Rescue1.e4p";

    const char PROTO_ESU01[]     = "mod:Prototypes/Vehicles/02 Fire Department/i20.e4p";
    const char PROTO_ESU02[]     = "mod:Prototypes/Vehicles/02 Fire Department/cpdr.e4p";
    const char PROTO_SUPT02[]     = "mod:Prototypes/Vehicles/03 Police/supt2_body.e4p";

    int DummyGroup = 23;

    object VcmdSiren : CommandScript
    {
     VcmdSiren()
     {
      SetIcon("sirenson");
      SetCursor("sirens");
      SetRestrictions(RESTRICT_SELFEXECUTE);
      SetPossibleCallers(ACTOR_VEHICLE);
       SetGroupID(DummyGroup);
       SetGroupLeader(true);
     }

     bool CheckPossible(GameObject *Caller)
     {
      if (!Caller->IsValid())
       return false;
       
      if (Game::IsFreeplay() && Caller->HasCommand(DUMMY_RANDOMSPAWN))
       return false;
      
      if (Caller->HasCommand(DUMMY_HASSIREN))
       SetIcon("sirensoff");
      else
       SetIcon("sirenson");

      if(Caller->HasCommand(DUMMY_HOSESON))
       return false; 
       
      return true;
     }

     bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
     {
      if (!Target->IsValid() || Target->GetID() != Caller->GetID())
       return false;
       
      return true;
     }

     void PushActions(GameObject *Caller, Actor *Target, int childID)
     {
      Vehicle v(Caller);
      if (Game::IsFreeplay() && v.HasCommand(DUMMY_RANDOMSPAWN))
       return;
      if (Input::LShiftPressed() || Input::RShiftPressed()) // Play airhorn sound (and make it clear people away)
      {
       Vector CarPos = v.GetPosition();
       if (StrCompare(v.GetPrototypeFileName(), PROTO_ENGINE01) == 0 ||
       StrCompare(v.GetPrototypeFileName(), PROTO_ENGINE02) == 0 ||
       StrCompare(v.GetPrototypeFileName(), PROTO_SQUAD01) == 0 ||
       StrCompare(v.GetPrototypeFileName(), PROTO_HAZMAT01) == 0 ||
       StrCompare(v.GetPrototypeFileName(), PROTO_HAZMAT02) == 0 ||   
       StrCompare(v.GetPrototypeFileName(), PROTO_LADDER01) == 0 ||
       StrCompare(v.GetPrototypeFileName(), PROTO_LADDER02) == 0 ||
       StrCompare(v.GetPrototypeFileName(), PROTO_RESCUE01) == 0 ||
       StrCompare(v.GetPrototypeFileName(), PROTO_ESU01) == 0 ||
       StrCompare(v.GetPrototypeFileName(), PROTO_ESU02) == 0 ||
       StrCompare(v.GetPrototypeFileName(), PROTO_SUPT02) == 0)
          Audio::PlaySample3D("mod:Audio/Fx/sirens/supt.wav", CarPos);
        else
          Audio::PlaySample3D("mod:Audio/FX/Sirens/supt.wav", CarPos);

        float r[9];
       v.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);
       GameObject deleteDummy = Game::CreateObject(OBJ_INVIS, "HornDummy");
       GameObject halt = Game::CreateObject(OBJ_INVIS, "HornDummy_Halt");  
       if (halt.IsValid())
       {
        halt.SetSelectable(false);
        halt.SetPosition(CarPos);
        halt.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);
        halt.UpdatePlacement();
        halt.PushActionHalt(ACTION_NEWLIST, 500, HALT_PERSONS);
        if (deleteDummy.IsValid())
        {
         deleteDummy.PushActionWait(ACTION_NEWLIST, 2.0f);
         deleteDummy.PushActionExecuteCommand(ACTION_APPEND, "DummyHorn", &halt, 0, false);
        }
       }
         return;
       }
      
      if (!v.HasCommand(DUMMY_HASSIREN))
      {
       if (!v.IsBlueLightEnabled())
       {
        v.EnableBlueLights(true);
       }

       int soundID;
       Vector CarPos = v.GetPosition();

        if (StrCompare(v.GetPrototypeFileName(), PROTO_ENGINE01) == 0 ||
       StrCompare(v.GetPrototypeFileName(), PROTO_ENGINE02) == 0 ||
       StrCompare(v.GetPrototypeFileName(), PROTO_SQUAD01) == 0 ||
       StrCompare(v.GetPrototypeFileName(), PROTO_HAZMAT01) == 0 ||
       StrCompare(v.GetPrototypeFileName(), PROTO_HAZMAT02) == 0 ||
       StrCompare(v.GetPrototypeFileName(), PROTO_RESCUE01) == 0 ||
       StrCompare(v.GetPrototypeFileName(), PROTO_LADDER01) == 0 ||
       StrCompare(v.GetPrototypeFileName(), PROTO_LADDER02) == 0)
        {
        int random = Math::rand()%2;
        if (random == 0)
           soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/Siren01.wav", CarPos, true);
        else
           soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/Siren02.wav", CarPos, true);
        }
        else if (v.GetVehicleType() == VT_AMBULANCE_RTW || v.GetVehicleType() == VT_AMBULANCE_ITW)
        {
        int random = Math::rand()%2;
        if (random == 0)
           soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/ambulance_01.wav", CarPos, true);
        }
        else if (v.GetVehicleType() == VT_AMBULANCE_NEF)
        {
        int random = Math::rand()%2;
        if (random == 0)
           soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/fire.wav", CarPos, true);
        }     
        else if (v.GetVehicleType() == VT_POLICE_SW || v.GetVehicleType() == VT_POLICE_WAW || v.GetVehicleType() == VT_POLICE_GTW)
       {
        int random = Math::rand()%2;
        if (random == 0)
           soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/police_02.wav", CarPos, true);
        }
        else if (v.GetVehicleType() == VT_POLICE_MTW)
       {
        int random = Math::rand()%2;
        if (random == 0)
           soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/police_01.wav", CarPos, true);
        }
        else if (v.GetVehicleType() == VT_POLICE_STW)
       {
        int random = Math::rand()%2;
        if (random == 0)
           soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/supt.wav", CarPos, true);
        }
        else if (v.GetVehicleType() == VT_FIREFIGHTERS_DLK || v.GetVehicleType() == VT_FIREFIGHTERS_GTF || v.GetVehicleType() == VT_FIREFIGHTERS_TLF || v.GetVehicleType() == VT_FIREFIGHTERS_DEKONP || v.GetVehicleType() == VT_FIREFIGHTERS_LPF || v.GetVehicleType() == VT_FIREFIGHTERS_TFMB)
        {
        int random = Math::rand()%2;
        if (random == 0)
           soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/Siren01.wav", CarPos, true);
        }
        else if (v.GetVehicleType() == VT_FIREFIGHTERS_RW)
        {
        int random = Math::rand()%2;
        if (random == 0)
           soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/fire.wav", CarPos, true);
        }
       
       int CarID = v.GetID();

       GameObject mDummy =  Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", NAME_DUMMYOBJECT);
       v.AssignCommand(DUMMY_HASSIREN);

       v.SetUserData(soundID);
       mDummy.Hide();
       mDummy.SetUserData(soundID);
       mDummy.AttachSound(soundID);
       mDummy.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_UPDATEPOS, &v, 0, false);

       return;
      }

      if (v.HasCommand(DUMMY_HASSIREN))
      {
       if (childID == 1)
       {
        v.EnableBlueLights(false);
       }

       //int CarID = v.GetID();
       int CarID = v.GetUserData();
       int ref = v.GetUserData();
       v.UnattachSound(ref);
       Audio::StopSample(ref);

       int mSirTest;
       GameObjectList list = Game::GetGameObjects(NAME_DUMMYOBJECT);
       for(int i=0; i<list.GetNumObjects(); i++)
       {
        GameObject *obj = list.GetObject(i);
        if (obj->GetUserData() == CarID)
        {
         mSirTest = i;
        }
       }

       GameObject *obj = list.GetObject(mSirTest);
       obj->PushActionDeleteOwner(ACTION_NEWLIST);

       if (v.HasCommand(DUMMY_HASSIREN))
        v.RemoveCommand(DUMMY_HASSIREN);

       return;
      }
     }
    };

    object DummyUpdatePos : CommandScript
    {
     DummyUpdatePos()
     {
      SetGroupID(DummyGroup);
     }

     bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
     {
     }

       void PushActions(GameObject *Caller, Actor *Target, int childID)
     {
      Vehicle v(Target);
      GameObject mDummy(Caller);
      if (v.HasCommand("VcmdFollow") && v.HasCommand("DummyFollow"))  
      {
       v.Destroy();
       return;
      }
      if (v.IsDestroyed() || !v.IsValid())
      {
       int ref = mDummy.GetUserData();
       mDummy.UnattachSound(ref);
       Audio::StopSample(ref);

       if (v.HasCommand(DUMMY_HASSIREN))
        v.RemoveCommand(DUMMY_HASSIREN);

       mDummy.PushActionDeleteOwner(ACTION_NEWLIST);
      } else
      {
       if (v.IsCurrentAction(EACTION_FINDPATH))
       {
        if (!v.HasCommand(DUMMY_FINDPATH))
        {
         v.AssignCommand(DUMMY_FINDPATH);
        }
       }

       Vector vPos = v.GetPosition();
       mDummy.SetPosition(vPos);
       mDummy.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_UPDATEPOS, Target, childID, false);
      }

      if (v.HasCommand(DUMMY_FINDPATH))
      {
       if (!v.IsCurrentAction(EACTION_FINDPATH) && v.HasCommand(CMD_AUTOSIREN_OFF) && (v.GetNumActions() == 0 || v.IsCurrentAction(EACTION_EXTINGUISH)))
       {
        if (v.HasCommand(DUMMY_HASSIREN))
         v.RemoveCommand(DUMMY_HASSIREN);

        if (v.HasCommand(DUMMY_FINDPATH))
         v.RemoveCommand(DUMMY_FINDPATH);

        //int CarID = v.GetID();
        int CarID = v.GetUserData();
        int ref = v.GetUserData();
        v.UnattachSound(ref);
        Audio::StopSample(ref);

        GameObjectList list = Game::GetGameObjects(NAME_DUMMYOBJECT);
        for(int i = 0; i < list.GetNumObjects(); i++)
        {
         int mSirTest;
         GameObject *obj = list.GetObject(i);
         if (obj->GetUserData() == CarID)
         {
          mSirTest = i;

          GameObject *obj = list.GetObject(mSirTest);
          obj->PushActionDeleteOwner(ACTION_NEWLIST);

          if (v.HasCommand(DUMMY_HASSIREN))
           v.RemoveCommand(DUMMY_HASSIREN);
          if (v.HasCommand(DUMMY_FINDPATH))
           v.RemoveCommand(DUMMY_FINDPATH);
         }
        }
       }
      }
     }
    };

    object DummyDisableSiren : CommandScript
    {
     DummyDisableSiren()
     {
      SetGroupID(DummyGroup);
     }

     bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
     {
     }

       void PushActions(GameObject *Caller, Actor *Target, int childID)
     {
      Vehicle v(Caller);
      if (childID == 1)
      {
       v.EnableBlueLights(false);
      }

      //int CarID = v.GetID();
      int CarID = v.GetUserData();
      int ref = v.GetUserData();
      v.UnattachSound(ref);
      Audio::StopSample(ref);

      GameObjectList list = Game::GetGameObjects(NAME_DUMMYOBJECT);
      for(int i = 0; i < list.GetNumObjects(); i++)
      {
       GameObject *obj = list.GetObject(i);
       if (obj->GetUserData() == CarID)
       {
        int mSirTest = i;

        GameObject *obj = list.GetObject(mSirTest);
        obj->PushActionDeleteOwner(ACTION_NEWLIST);

        if (v.HasCommand(DUMMY_HASSIREN))
         v.RemoveCommand(DUMMY_HASSIREN);
        if (v.HasCommand(DUMMY_FINDPATH))
         v.RemoveCommand(DUMMY_FINDPATH);
       }
      }
     }
    };

    object DummyFindPath : CommandScript
    {
     DummyFindPath()
     {
      SetGroupID(DummyGroup);
     }

     bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
     {
      return false;
     }

       void PushActions(GameObject *Caller, Actor *Target, int childID)
     {
     }
    };

    object DummyHasSiren : CommandScript
    {
     DummyHasSiren()
     {
      SetGroupID(DummyGroup);
     }

     bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
     {
      return false;
     }

       void PushActions(GameObject *Caller, Actor *Target, int childID)
     {
     }
    };

    object DummyHorn : CommandScript
    {
     DummyHorn()
     {
     }

     bool CheckPossible(GameObject *Caller)
     {
     }

     void PushActions(GameObject *Caller, Actor *Target, int childID)
     {
      GameObject t(Target);
      t.PushActionDeleteOwner(ACTION_NEWLIST);
      Caller->PushActionDeleteOwner(ACTION_NEWLIST);
     }
    };

  3. Hi, I wanted to add new Police parking bays but In a different place on the map due to the fact of having another  small police station.

    I did search the forum numerous times and there were some topics which served a bit of a guide, (doing what was written, still got errors).

    I modified the GotoPolicestation.script  in the se parts

    Added this: const char VO_POLICE09[] = "police_park09";

    added 19 here: GameObjectList l1, l2, l3, l4, l5, l6, l7, l8, 19;

     

    Copied this from an existent and modified it:

    Game::CollectObstaclesOnVirtualObject(VO_POLICE09, l9, ACTOR_VEHICLE);

    if(l9.GetNumObjects() == 0)

    {

    list1 = Game::GetActors(VO_POLICE09);

    list2 = Game::GetActors(VO_POLICE_FP2);

    ParkinglotFound = true;

    }

    }

    if (!ParkinglotFound)

    {

    Added this:

    else if (v.IsCollidingWithVirtualObject(VO_POLICE09))

    return;

    When I send units to Police Station the game pops up and error stating that ther is a problem in line... gameobjects 19 something like that?

    (I also did the parking bay (virtual object) in map) police_park09

    RE: Parking direction that is not a problem I know what to do hehe.

     

  4. To edit the texture you should rename the dds (textrure file) to v3o and unpack it with editor. Then rename back to v3o and you can open it in photoshop (using nvidia dds plugin).

    In the downloads section there is also a tool than unpacks/packd file but i am not sure how it works.. Haven't use it yet.

  5. Yes they are named the same.

    So I named the animations in the truck as Light_on and Light_OFF exectally how the are the names of the animations in the RW_SPOTLIGHT_SUPER file.

    When the rw_spotlight_super file was placed on the rw equipment vehicle in the game it had Lightson and lightsoff commands attached and it worked.. min is'nt :s .... I also changed the traits of the police truck to rw. (as the rw truck) to be exectally.

  6. Hi, ( If i understood you right )

     

    regarding animations,  I did the animation already (with zmod 3) so now i have the truck file (v3o) and truck animatiuon file (vmo).. in editor they work but in game no *probably due to script :s

    I was planning to somehow assign the animations in Lights On and Lights Of scripts of the original game since they are used for the same purpose. but can't manage

  7. Hi, I watched this youtube video from zmodeler
     

    https://www.youtube.com/watch?v=Gc6N6KPqgW8

     

    Now I managed to create animations as Lights On (Light Pole goes up) ... then Lights OFF (light Pole goes down)..

    Now it seemd that my problem is How to connect  these animatuons in the game scripts of LIGHTS ON and LIGHTS OFF.

    Any type of help would be greatly appriciated

    Here are 2 pics to explain

    LIGHTS ON:

    lights_on.jpg

    LIGHTS OFF

    off.jpg
     

  8. Hi I was trying to animate a new spotlight for a police light tower truck. I tried using zmodeler 3 and thats  to a tutorial online I managed to get an Idea how to animate..

    If I manage to animate correctly and manages to assign the animation with the model in zmodeler do i have to create a script for commands in game ?

    (Becuase Rw spotlight super has Loghts on, Lights Of Commands and same commands are not in scrips folder of the game)... how can this be possabile?

    Thanks in advance

  9. Hi, I was working at my mod.. and the Icons of the personnel you could choose to enter in vehicle used to be visible..

    Now at one point (can't understand what happened) When I click on any unit, I see the personnel boxes empty but when I put my curser the name comes.. (it's only missing the texture in the personnel menu of the vehicle..

    Is it Possible maybe a file got corrupted?
    Anybody knows if there is a file or which t is that links textures to unit.?

×
×
  • Create New...