Jump to content

The Loot

Members
  • Posts

    754
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by The Loot

  1. GGD, did you happen to use my version of Hoppah's Water Supply?

     

    That invisible firehose is a bug I ran into when fixing the person "switch" that happens if you use different types of people to install and remove the supply line. For whatever reason, changing the hidden hose-holder to a different proto causes the firehose to turn invisible; no idea how to fix that, but it's a minor thing that doesn't break any function (you can just tell the person to remove the hose from the hydrant and reconnect if you want to fix it).

  2. Another Q: if doors are different types but grouped the same, do they still open together? Or do they have to be the same in both regards?

     

    Take the LA ambulances: they don't really have "person" doors, but I wonder if I can set one of the "special" doors to "person" with the same group, and have them both open in both circumstances.

  3. 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;
            }
        }
    };

  4. 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.

×
×
  • Create New...