Jump to content

The Loot

Members
  • Posts

    763
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by The Loot

  1. Looks like you need lines to hide the person after being picked up, and to enable the correct patient child on the unit. I have it working in my script; not currently on that PC so I can't post it.

     

    Edit: Here we go. Here's what my Lift script looks like in my LA mod. "DummyLiftStretcher" is what handles the various actions that need to happen after picking the person up with a stretcher. I changed the command names into English and tweaked other things somewhat, too, so just use this as an example.

     

    The only issue I ran into with the Stryker was that when transporting the patient from the ambulance to the hospital, the patient would reappear, the unit would wig out and start spinning around while trying to walk, and sometimes getting stuck doing that and never get into the hospital. I fixed this by moving the PutInBase action before the move action so the patient gets removed before that..

     

    //**********************************************************************************//
    //    Scripts by Hoppah, Modified by Xplorer4x4, YSB, and The Loot.                    //
    //**********************************************************************************//

    const char HINT_NOT_DEAD[]    = "This person is still alive!";

    const char PER_COR[]     = "mod:Prototypes/Persons/01 LA Ambulance/coroners.e4p";

    int DummyGroup = 20;

    object Lift : CommandScript
    {
        Lift()
        {
            SetIcon("liftperson");
            SetCursor("liftperson");
            SetValidTargets(ACTOR_PERSON);
            SetGroupID(CGROUP_CARRY_PERSON);
            SetGroupLeader(true);
            SetPriority(400);
            SetSelfClickActivation(true);
            SetPossibleExists(CPE_DROWNING_PERSONS | CPE_INJURED_PERSON);
            SetPossibleEquipment(EQUIP_NONE);
        }
        bool CheckGroupVisibility(GameObject *Caller)
        {
            if(!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON)
                return false;
            Person p(Caller);
            if (p.IsCarryingPerson())
                return false;
            if (p.HasCommand("Dive"))
                return Game::ExistsDrowningPerson();
            return Game::ExistsInjuredPerson();
        }
        bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
        {
            if(!Caller->IsValid() || Caller->IsEquipped() || !Target->IsValid() || Target->GetID() == Caller->GetID())
                return false;
            Person p(Caller);
            Person t(Target);
            if (StrCompare(p.GetPrototypeFileName(), PER_COR) != 0 && t.HasCommand("DummyBlanket"))
                return false;
            // if (p.IsParamedicTeam() && !t.HasCommand("DummyHealed"))
                // return false;
            if(p.IsValid() && !p.IsCarryingPerson()&& !p.IsLinkedWithPerson() && !p.IsPulling() && t.IsValid() && t.IsInjured() && !t.IsCarried() && t.GetRole()!=ROLE_ANIMAL && !t.IsRescueDog())
            {
                if (p.GetEnteredCarID() != -1 && p.GetEnteredCarTargetID() != t.GetEnteredHouseID())
                    return false;
                if (p.GetEnteredCarID() == -1 && t.GetEnteredHouseID() != -1 && t.GetEnteredHouseID() != p.GetEnteredHouseID() && !t.IsInHouseWithGroundEntrance())
                    return false;
                if (p.HasCommand("Dive") && !t.IsDrowning())
                    return false;
                if(!p.HasCommand("Dive") && t.IsDrowning())
                    return false;
                if(p.IsCurrentAction("EActionTreatPerson"))
                    return false;
                return true;
            }        
            return false;
        }
        void PushActions(GameObject *Caller, Actor *Target, int childID)
        {
            Person p(Caller);
            Person t(Target);
            if(StrCompare(p.GetPrototypeFileName(), PER_COR) == 0)
            {
                if (t.IsClassified() && !t.IsDead())
                {
                    Mission::PlayHint(HINT_NOT_DEAD);
                    return;
                }
                if (p.GetEnteredCarID() == -1)
                {
                    Caller->PushActionMove(ACTION_NEWLIST, Target, TARGET_TOUCHPERSON);
                    Caller->PushActionTurnTo(ACTION_APPEND, Target);
                    Caller->PushActionExecuteCommand(ACTION_APPEND, "DummyLife", Target, 0, false);
                }
                else
                {
                    if (t.GetEnteredHouseID() == p.GetEnteredCarTargetID())
                    {
                        Caller->PushActionEnterHouse(ACTION_NEWLIST, t.GetEnteredHouseID());
                        Caller->PushActionMove(ACTION_APPEND, Target, TARGET_TOUCHPERSON);
                        Caller->PushActionTurnTo(ACTION_APPEND, Target);
                        Caller->PushActionExecuteCommand(ACTION_APPEND, "DummyLife", Target, 0, false);
                    }
                    else
                        Caller->PushActionTurnTo(ACTION_NEWLIST, Target);
                    Caller->PushActionExecuteCommand(ACTION_APPEND, "DummyLife", Target, 0, false);
                }
            }
            else if(p.HasCommand("DummyPersonHasStretcher"))
            {
                p.PushActionMove(ACTION_NEWLIST, Target, TARGET_TOUCHPERSON);
                p.PushActionTurnTo(ACTION_APPEND, Target);
                p.PushActionLift(ACTION_APPEND, Target);
                p.PushActionExecuteCommand(ACTION_APPEND, "DummyLiftStretcher", Target, 0, false);            
            }
            else
            {
                if (p.GetEnteredCarID() == -1)
                {
                    if (p.HasCommand("Dive"))
                        Caller->PushActionMove(ACTION_APPEND, Target, TARGET_FOLLOW);
                    else
                        Caller->PushActionMove(ACTION_NEWLIST, Target, TARGET_TOUCHPERSON);
                    Caller->PushActionTurnTo(ACTION_APPEND, Target);
                    Caller->PushActionLift(ACTION_APPEND, Target);
                }
                else
                {
                    if (t.GetEnteredHouseID() == p.GetEnteredCarTargetID())
                    {
                        Caller->PushActionEnterHouse(ACTION_NEWLIST, t.GetEnteredHouseID());
                        Caller->PushActionMove(ACTION_APPEND, Target, TARGET_TOUCHPERSON);
                        Caller->PushActionTurnTo(ACTION_APPEND, Target);
                    }
                    else
                        Caller->PushActionTurnTo(ACTION_NEWLIST, Target);
                    Caller->PushActionLift(ACTION_APPEND, Target);                
                }            
            }        
        }
    };

    object DummyLiftStretcher : CommandScript
    {
        DummyLiftStretcher()
        {
            SetGroupID(20);
        }
        bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID)
        {}
        void PushActions(GameObject *Caller, Actor *Target, int ChildID)
        {
            Person p(Caller);
            Person t(Target);
            if(ChildID == 0)
            {
                p.SetUserData(t.GetID());
                t.PushActionShowHide(ACTION_NEWLIST, true);
                p.SetChildEnabled("Patient", true);
                // t.ChangePrototype("mod:Prototypes/Persons/Ambulance/Patient.e4p");
                p.AssignCommand("DummyPersonHasPatient");
                p.RemoveCommand("PcmdRemoveEquipment");
                p.RemoveCommand("UnloadPerson");
                p.RemoveCommand("Lift");
                // p.RemoveCommand("DropStryker");            
            }
        }
    };

    object DummyPersonHasPatient : CommandScript
    {
        DummyPersonHasPatient()
        {
            SetGroupID(120);
        }
        bool CheckGroupVisibility(GameObject *Caller)
        {
            return false;
        }
        void PushActions(GameObject *Caller, Actor *Target, int childID)
        {}
    };

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

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

        void PushActions(GameObject *Caller, Actor *Target, int childID)
        {
            Person t(Target);
            if (!t.IsClassified())
                t.SetClassified(true);
            if (t.IsDead())
            {
                if (!t.HasCommand("DummyBlanket"))
                {
                    Caller->PushActionExecuteCommand(ACTION_APPEND, "PcmdDead", &t, 0, false);
                    return;
                }
                Caller->PushActionLift(ACTION_APPEND, Target);  
            }
            else
            {
                Caller->PushActionSwitchAnim(ACTION_APPEND, "paramedicput");
                Caller->PushActionWait(ACTION_APPEND, 0.5f);
                Caller->PushActionSwitchAnim(ACTION_APPEND, "paramedicget");
                Mission::PlayHint(HINT_NOT_DEAD);
                return;
            }
        }
    };

  2. Some additions to Jose Pedalio's info.

     

    Lang/EN/Infotexts.xml

    <string name="ID_NAME_VEHICLE">Name Here</string> (Shows up in buy/deploy dialog.)<string name="ID_PURPOSE_VEHICLE">Short description here.</string> (Shows up in buy/deploy dialog.)<string name="ID_TOOLTIP_VEHICLE">Name Here</string> (Shows up when hovering over a picture on vehicle menu.)

    Lang/EN/Portraits.xml

    <string name="ID_PORTRAIT_VEHICLE">Name Here</string> (Shows up under unit picture when selected in-game.)

    Specs/Portraits.xml

    <portrait prototype="mod:Prototypes/Vehicles/03 LA Police/vehicle.e4p" text="VEHICLE" unit="VEHICLE"/> (Determines what strings are used for specific prototypes.)

    Everywhere it says "VEHICLE" needs to be the same for a single unit, and corresponds with the same Unit ID used in the unit.xml file. Multiple vehicles can share the same Unit ID, and pull from the same Language strings, but each prototype needs its own line in the Specs xml file.

     

    Itchboy, do you plan on replacing the tow truck? I know you're working on something for the Engineer vehicle.

  3. Yeah I think it just depends on the vehicle, if its an actual car then you will see the model on the back of the tow truck, if its like the tanker then it will be a tarp as its bigger then the tow truck.

     

    It looked like there were multiple types of tow trucks in various screens, so I thought maybe they'd make it so certain vehicles need certain trucks. Must have been WIP models if that isn't how the game is now.

  4. The tow truck actually has the vehicle which it just picked up, not just a shape with a tarp over it.

     

    Really? I swear I saw a gameplay video where it looked like it just had changed to model to a tarp-covered generic car (this was a car-sized one for the tanker from the tram/tanker collision too!).

  5. Read the first 2 pages and you will find your answer, the only unfortunate part is: you won't find your download link.

     

    The one obstacle that could present a real problem is the use of the Police Upgrade mod: one of it's stipulations is that it can't be redistributed until the RCMP mod is released. That mod is on hold until EM5, or until the team decides to finish a release for EM4. I can always seek permissions, but I'm not at a point where I'm going to release this just yet anyways.

  6. Looks great. Here's a treat you and everyone would probably like:

    The window bars are 3D. The side door has a slide animation too.

    Does this thing have any emergency lights at all? Should it have any window bars on the rear doors?

    Awesome!

    I saw the older model without bars on the rear doors, but I can't find any images of this particular model. As for lights, can't find much easily, except one with a single red LED between the visors. Maybe treat it like a slicktop with minimal windshield and rear door lights, and some recessed grill lights. It could easily be converted to a SWAT vehicle that way (which I'd like. BTW, do you plan on replacing the SWAT and FBI SUVs?)

     

    Anyone got info on the SAR Rescue Dog vehicle?

    All I've found of Los Angeles Rescue vehicles are various LASD Utility and Pickup trucks (RAM 5500, this RAM, F350 and 450) and SUVs (Expedition, Yukon, Wrangler, H2, a dealer sponsored Montero Sport, an older Sierra 3500). Also saw an LA County Fire S&R Econoline in there.

     

    Hows the LACoFD Squad coming?

     

    Nice little banner there, though I'd feature some of your cars instead of real ones. ;)

×
×
  • Create New...