Jump to content

ENG51INE

Members
  • Posts

    184
  • Joined

  • Last visited

  • Days Won

    7

Posts posted by ENG51INE

  1. I don't know if anyone reported this but at the top of the map to the southwest of the ambulance repair shop there are two people under an apartment building, I forgot to report it because I fixed it my self by hiding the buildings and deleting the two people. When I get home I will upload a screenshot.

    That's a new one, thank you. I will fix that
  2. OK, I found some errors, ambulances loses direction when leaving hospital and stucked in parking lot, tow trucks, fire engines, etc. stucked between buildings when arriving to case.

    Fire captain is useles for firefighting, he is only call county firetrucks and switching off box alarm.

    You really need to pay attention to what other people have already pointed out. Why don't you take a deep breath and WAIT FOR THE UPDATE.
  3.  

    You have to edit the streets in "Streets" mode (Shift F7), you must have it for emergency vehicles. Wherever you want them to use a street, this has to be set. The streets have to have at least one connected street (Like a three-way street or a one way in a different direction).

     

    Yeah, like I said, I have all the streets set up.  Not really sure what the issue is still.

  4. So in the recently released Mayberry Mod, the biggest issue I'm having is trying to fix the problem with player controlled vehicles not following paths. For example, if you send an engine from the east side to the west side for a fire, it will try to drive straight across the entire map and not follow the roads. The same thing happens when you send it back to the station or tell it to go home.

    I have all the roads marked out in the paths and streets, I just don't know if I'm missing something.

  5. Hey man, amazing mod!!!! Reminds me exactly like my towns fire district.

    I do have one question though.. In my town due to the limited water resources, our chief has the ability to call for a Tanker Task Force (TTF) which sends 2 or 3 tankers to the scene, could you have the ability to put that as a option in the chiefs menu?

    I am working on that today actually, you read my mind
  6. To add to the last commenter, when using the Tanker to act as a hydrant, my Engine was unable to detach its supply line. Now I know you guys said you cant do Engine to Engine but Engine to Tanker, is that the same rule? I thought it wasnt.

    In the V1.1 update that bug is fixed, however, you still can not link engine to engine or tanker to tanker
  7. So I fixed the extra "=" in all the applicable lines, and I was able to load my mod, however I lost all limited water supply commands. I have no idea what is wrong without at this point. Normally I'm pretty good at troubleshooting and can at least look at a similar script and figure out my issues, but in this case I have not found anything similar.

    In game, I keep getting "water tank empty" and "tanker water tank empty" being displayed over and over again at the bottom left of the screen.

  8. I have tried many times to get this script to work, but I have run out of options.  I am also wondering if anyone has/ knows of a script to allow fire engines to supply other fire engines and ladder trucks.  I have tried adding my other tankers to the following script, but I either keep getting a syntax error, or one of the lines fails.  Any help is greatly appreciated, thanks.

     

     

    //******************************************************************************************

    //    Limited Water Supply script by Hoppah
    // Version: 1.1
    //******************************************************************************************
     
    int MAX_WATER_TANKER = 1500;
    int MAX_WATER_TLF = 1300;
    int MAX_WATER_LPF = 400;
    int MAX_WATER_GTF = 1000;
    int MAX_WATER_DLK = 1000;
     
    int OUTTAKE_HOSE = 8; //outtake per second
    int OUTTAKE_TLF_CANNON = 20;
    int OUTTAKE_LPF_CANNON = 40;
    int OUTTAKE_DLK_CANNON = 20;
     
    int INTAKE_SUPPLYLINE = 50;
    int OUTTAKE_WATERCANNON = 50;
     
    const char PROTO_WATER_TANKER[] = "mod:Prototypes/Vehicles/02Fire/tanker3.e4p";
    const char PROTO_WATER_TANKERA[] = "mod:Prototypes/Vehicles/02Fire/tanker21.e4p";
    const char PROTO_WATER_TANKERB[] = "mod:Prototypes/Vehicles/02Fire/tanker22.e4p";
     
    object DummyUpdateWaterLevel : CommandScript
    {
    int WaterLevel;
    bool TankEmpty = false;
      DummyUpdateWaterLevel()
      {
      SetGroupID(20);
      }
     
      bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
      {
      return true;
      }
     
    void PushActions(GameObject *Caller, Actor *Target, int childID)
      {
    GameObject obj(Caller);
    Vehicle v(Target);
    if (!v.IsValid() || v.IsSmoking() || v.IsDestroyed())
    {
    System::Log("WATER, Removed Water Supply Tank of: %s",v.GetPrototypeFileName());
    obj.PushActionDeleteOwner(ACTION_NEWLIST);
    return;
    }
    if (v.HasCommand("DummyUpdateWaterLevel"))
    {
    if (StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKER) == 0 || 
    StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERA) == 0 ||
    StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERB) == 0) WaterLevel = MAX_WATER_TANKER;
    else if (v.GetVehicleType() == VT_FIREFIGHTERS_GTF) WaterLevel = MAX_WATER_GTF;
    else if (v.GetVehicleType() == VT_FIREFIGHTERS_TLF) WaterLevel = MAX_WATER_TLF;
    else if (v.GetVehicleType() == VT_FIREFIGHTERS_LPF) WaterLevel = MAX_WATER_LPF;
    else if (v.GetVehicleType() == VT_FIREFIGHTERS_DLK) WaterLevel = MAX_WATER_DLK;
    else
    System::Error("WATER, Unknown vehicletype!");
    v.RemoveCommand("DummyUpdateWaterLevel");
    System::Log("WATER, Assigned water tank level of %d to %s",WaterLevel,v.GetPrototypeFileName());
    } else
    WaterLevel = childID;
     
    int RelativeWaterLevel = 0;
    if (StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKER) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERA) == 0 ||StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERB) == 0)
    RelativeWaterLevel = (WaterLevel*100)/MAX_WATER_TANKER;
    else if (v.GetVehicleType() == VT_FIREFIGHTERS_TLF)
    RelativeWaterLevel = (WaterLevel*100)/MAX_WATER_TLF;
    else if (v.GetVehicleType() == VT_FIREFIGHTERS_LPF)
    RelativeWaterLevel = (WaterLevel*100)/MAX_WATER_LPF;
    else if (v.GetVehicleType() == VT_FIREFIGHTERS_GTF)
    RelativeWaterLevel = (WaterLevel*100)/MAX_WATER_GTF;
    else if (v.GetVehicleType() == VT_FIREFIGHTERS_DLK)
    RelativeWaterLevel = (WaterLevel*100)/MAX_WATER_DLK;
    else
    System::Error("WATER, Unknown vehicletype!");
     
    if (v.HasCommand("DummyCheckWaterSupply"))
    {
    v.RemoveCommand("DummyCheckWaterSupply");
    char Text[255];
    snprintf(Text, 255, "Water level: %d gal. (%d%%)", WaterLevel, RelativeWaterLevel);
    Game::ShowHelpTextWindow(Text, 2.f);
    }
     
    if (((StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKER) != 0 && WaterLevel < 20) || (StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKER) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERA) == 0 ||StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERB) == 0 && WaterLevel < 101)) && !v.HasCommand("DummyEmptyTank"))
    v.AssignCommand("DummyEmptyTank");
    else if (v.HasCommand("DummyEmptyTank") && ((StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKER) != 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERA) != 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERB) != 0 && WaterLevel > 20) || (StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKER) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERA) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERB) == 0 && WaterLevel > 101)))
    v.RemoveCommand("DummyEmptyTank");
     
    bool PumpControllerPresent = false;
    int numActiveHoses = 0;
    int numActiveTLFCannons = 0;
    int numActiveLPFCannons = 0;
    int numActiveDLKCannons = 0;
    int numSupplyLines = 0;
    int numWaterTankerLines = 0;
    int Outtake = 0;
    int Intake = 0;
     
    // CHECK IF PUMP CONTROLLER IS PRESET
    if (v.HasCommand("VcmdPumpSwitch") && v.HasCommand("DummyPumpEnabled"))
    {
    GameObjectList l1 = v.GetObjectsInRange(500.0f, ACTOR_PERSON);
    for(int j = 0; j < l1.GetNumObjects(); j++)
    {
    if (l1.GetObject(j)->GetType() == ACTOR_PERSON)
    {
    Person p = l1.GetObject(j);
    if (p.GetUserData() == v.GetID() && p.HasCommand("DummyPumpEnabled") && !p.IsCurrentAnimation("useextinguis") && !p.IsFlagSet(OF_HIDDEN))
    {
    p.SetUserData(0);
    p.RemoveCommand("DummyPumpEnabled");
    }
    if (!PumpControllerPresent && p.GetUserData() == v.GetID() && p.HasCommand("DummyPumpEnabled") && p.IsCurrentAnimation("useextinguis") && !p.IsFlagSet(OF_HIDDEN))
    PumpControllerPresent = true;
    }
    }
    }
    if (!PumpControllerPresent && v.HasCommand("DummyPumpEnabled"))
    {
    v.RemoveCommand("DummyPumpEnabled");
    if (!v.IsCommandEnabled("MoveTo"))
    v.EnableCommand("MoveTo", true);
    if (!v.IsCommandEnabled("GoHome"))
    v.EnableCommand("GoHome", true);
    }
     
    // CHECK FIRE ENGINES
    if (v.GetVehicleType() == VT_FIREFIGHTERS_GTF && StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKER) !== 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERA) !== 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERB) !== 0 && v.IsInstalled())
    {
    PersonList l2(ROLE_SQUAD);
    for(int k = 0; k < l2.GetNumPersons(); k++)
    {
    if (l2.GetPerson(k)->GetEquipment() == EQUIP_FIREHOSE && l2.GetPerson(k)->GetType() == ACTOR_PERSON && l2.GetPerson(k)->GetFirehoseID() != 0 && !l2.GetPerson(k)->IsFlagSet(OF_HIDDEN))
    {
    GameObject Phydrant = l2.GetPerson(k)->GetHydrant();
    if (Phydrant.GetID() == v.GetID() || ((Phydrant.HasName("extend_wye") || Phydrant.HasName("extend_hose")) && Phydrant.GetUserData() == v.GetID()))
    {
    Person p(l2.GetPerson(k));
    if ((!PumpControllerPresent || v.HasCommand("DummyEmptyTank")) && (p.IsCommandEnabled("Extinguish") || p.IsCurrentAction("EActionExtinguish") || p.IsCurrentAction("EActionCool")))
    {
    p.EnableCommand("Extinguish", false);
    p.EnableCommand("Cool", false);
    p.EnableAutoTarget(false);
    if (p.IsCurrentAction("EActionExtinguish") || p.IsCurrentAction("EActionCool"))
    {
    p.ClearActions();
    p.PushActionSwitchAnim(ACTION_NEWLIST, "idleequipped");
    p.PushActionWait(ACTION_APPEND, 5.f);
    }
    }
    else if (PumpControllerPresent && !v.HasCommand("DummyEmptyTank") && !p.IsCommandEnabled("Extinguish"))
    {
    p.EnableCommand("Extinguish", true);
    p.EnableCommand("Cool", true);
    p.EnableAutoTarget(true);
    }
    if (p.IsCurrentAction("EActionExtinguish") || p.IsCurrentAction("EActionCool"))
    numActiveHoses++;
    }
    }
    }
    }
     
    // CHECK FIRE ENGINES WITH DECK GUN
    if (v.GetVehicleType() == VT_FIREFIGHTERS_GTF && v.HasCommand("VcmdCannonSwitch") && v.IsCurrentAnimation("activate"))
    {
    GameObjectList l3 = Game::GetGameObjectsWithPrefix("engine_water_cannon");
    for(int h = 0; h < l3.GetNumObjects(); h++)
    {
    Vehicle cannon = l3.GetObject(h);
    if (cannon.GetUserData() == v.GetID())
    {
    if (v.HasCommand("DummyEmptyTank"))
    {
    cannon.EnableAutoTarget(false);
    cannon.ClearActions();
    cannon.PushActionWait(ACTION_NEWLIST, 4.f);
    else if (!v.HasCommand("DummyEmptyTank"))
    cannon.EnableAutoTarget(true);
    if (cannon.IsCurrentAction("EActionExtinguish") || cannon.IsCurrentAction("EActionCool"))
    numActiveTLFCannons++;
    }
    }
    }
     
    // CHECK TLF AND LPF VEHICLETYPES
    if ((v.GetVehicleType() == VT_FIREFIGHTERS_TLF || v.GetVehicleType() == VT_FIREFIGHTERS_LPF))
    {
    if (v.HasCommand("DummyEmptyTank") && v.IsCommandEnabled("Extinguish"))
    {
    v.EnableCommand("Extinguish", false);
    v.EnableCommand("Cool", false);
    v.EnableAutoTarget(false);
    v.ClearActions();
    v.PushActionWait(ACTION_NEWLIST, 4.f);
    }
    else if (!v.HasCommand("DummyEmptyTank") && !v.IsCommandEnabled("Extinguish"))
    {
    v.EnableCommand("Extinguish", true);
    v.EnableCommand("Cool", true);
    v.EnableAutoTarget(true);
    }
    if (v.GetVehicleType() == VT_FIREFIGHTERS_TLF && (v.IsCurrentAction("EActionExtinguish") || v.IsCurrentAction("EActionCool")))
    numActiveTLFCannons++;
    if (v.GetVehicleType() == VT_FIREFIGHTERS_LPF && (v.IsCurrentAction("EActionExtinguish") || v.IsCurrentAction("EActionCool")))
    numActiveLPFCannons++;
    }
     
    // CHECK IF VEHICLE HAS SUPPLY LINE CONNECTED
    if (v.HasCommand("DummyWaterSupplyOn"))
    numSupplyLines++;
     
    // CHECK IF WATER TANKER HAS A SUPPLY LINE CONNECTED TO A FIRE ENGINE
    if (v.HasCommand("DummyWaterSupplyFromTankerOn") && StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKER) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERA) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERB) == 0 && v.GetVehicleType() == VT_FIREFIGHTERS_GTF && v.IsInstalled())
    {
    PersonList l4(ROLE_SQUAD);
    for(int y = 0; y < l4.GetNumPersons(); y++)
    {
    if (l4.GetPerson(y)->GetEquipment() == EQUIP_FIREHOSE && l4.GetPerson(y)->GetFirehoseID() != 0 && l4.GetPerson(y)->IsFlagSet(OF_HIDDEN) && l4.GetPerson(y)->HasCommand("DummyWaterSupplyFromTankerOn"))
    {
    GameObject Phydrant = l4.GetPerson(y)->GetHydrant();
    if (Phydrant.GetID() == v.GetID())
    {
    Person p(l4.GetPerson(y));
    GameObjectList l5 = p.GetObjectsInRange(800.0f, ACTOR_VEHICLE);
    for(int z = 0; z < l5.GetNumObjects(); z++)
    {
    if (l5.GetObject(z)->GetType() == ACTOR_VEHICLE)
    {
    Vehicle m = l5.GetObject(z);
    if (p.GetUserData() == m.GetID())
    {
    if (!v.HasCommand("DummyEmptyTank") && !m.HasCommand("DummyWater100Perc"))
    numWaterTankerLines++;
    }
    }
    }
    }
    }
    }
    }
     
    // CHECK FIRE ENGINES FOR A SUPPLY LINE FROM WATER TANKER
    if (v.HasCommand("DummyWaterSupplyFromTankerOn") && StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKER) !== 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERA) !== 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERB) !== 0)
    {
    GameObjectList l6 = v.GetObjectsInRange(800.0f, ACTOR_PERSON);
    for(int d = 0; d < l6.GetNumObjects(); d++)
    {
    Person n = l6.GetObject(d);
    if (n.GetUserData() == v.GetID() && n.HasCommand("DummyWaterSupplyFromTankerOn"))
    {
    GameObject Phydrant = n.GetHydrant();
    if (StrCompare(Phydrant.GetPrototypeFileName(), PROTO_WATER_TANKER) == 0)
    {
    Vehicle hy(&Phydrant);
    if (!hy.HasCommand("DummyEmptyTank") && !v.HasCommand("DummyWater100Perc"))
    numSupplyLines++;
    }
    }
    }
    }
     
    // CHECK LADDER VEHICLES
    if (v.GetVehicleType() == VT_FIREFIGHTERS_DLK && v.IsInstalled() && v.IsUplifted() && !v.IsBasketEmpty())
    {
    PersonList l7(ROLE_SQUAD);
    for(int b = 0; b < l7.GetNumPersons(); b++)
    {
    if (l7.GetPerson(b)->CanUseDLKCannon() && l7.GetPerson(b)->GetEnteredCarID() == v.GetID())
    {
    Person p(l7.GetPerson(b));
    if (v.HasCommand("DummyEmptyTank") && p.IsCommandEnabled("Extinguish"))
    {
    if (p.IsCommandEnabled("Extinguish"))
    {
    p.EnableCommand("Extinguish", false);
    p.EnableCommand("Cool", false);
    p.EnableAutoTarget(false);
    p.ClearActions();
    p.PushActionWait(ACTION_NEWLIST, 4.f);
    }
    else if (!v.HasCommand("DummyEmptyTank") && !p.IsCommandEnabled("Extinguish"))
    {
    p.EnableCommand("Extinguish", true);
    p.EnableCommand("Cool", true);
    p.EnableAutoTarget(true);
    }
    }
    }
    if (v.IsCannonInUse())
    numActiveDLKCannons++;
    }
     
    // RECALCULATE IN- AND OUTTAKES
    Intake = numSupplyLines*INTAKE_SUPPLYLINE;
    Outtake = numActiveHoses*OUTTAKE_HOSE+numActiveTLFCannons*OUTTAKE_TLF_CANNON+numActiveLPFCannons*OUTTAKE_LPF_CANNON+numActiveDLKCannons*OUTTAKE_DLK_CANNON+numWaterTankerLines*OUTTAKE_WATERCANNON;
     
    // CHANGE WATER LEVEL
    if (obj.GetUserData() == v.GetID())
    {
    WaterLevel = WaterLevel+Intake-Outtake;
    if ((StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKER) !== 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERA) !== 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERB) !== 0 && WaterLevel < 20) || (StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKER) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERA) == 0 ||StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERB) == 0 && WaterLevel < 101))
    v.AssignCommand("DummyEmptyTank");
    else if (StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKER) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERA) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERB) == 0 && WaterLevel > MAX_WATER_TANKER)
    WaterLevel = MAX_WATER_TANKER;
    else if (v.GetVehicleType() == VT_FIREFIGHTERS_TLF && WaterLevel > MAX_WATER_TLF)
    WaterLevel = MAX_WATER_TLF;
    else if (v.GetVehicleType() == VT_FIREFIGHTERS_LPF && WaterLevel > MAX_WATER_LPF)
    WaterLevel = MAX_WATER_LPF;
    else if (StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKER) !== 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERA) !== 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERB) !== 0 && v.GetVehicleType() == VT_FIREFIGHTERS_GTF && WaterLevel > MAX_WATER_GTF)
    WaterLevel = MAX_WATER_GTF;
    else if (v.GetVehicleType() == VT_FIREFIGHTERS_DLK && WaterLevel > MAX_WATER_DLK)
    WaterLevel = MAX_WATER_DLK;
    if (WaterLevel < 0)
    WaterLevel = 0;
    if (v.HasCommand("DummyEmptyTank"))
    {
    if (!TankEmpty)
    {
    TankEmpty = true;
    if (StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKER) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERA) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERB) == 0)
    Game::ShowHelpTextWindow("Water tanker is empty!", 2.f);
    else
    Game::ShowHelpTextWindow("Water tank empty!", 2.f);
    System::Log("WATER, Tank of %s empty!", v.GetPrototypeFileName());
    }
    if ((StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKER) !== 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERA) !== 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERB) !== 0 && WaterLevel > 20) || (StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKER) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERA) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_WATER_TANKERB) == 0 && WaterLevel > 101))
    {
    v.RemoveCommand("DummyEmptyTank");
    if (v.HasCommand("Extinguish") && !v.IsCommandEnabled("Extinguish"))
    v.EnableCommand("Extinguish", true);
    if (v.HasCommand("Cool") && !v.IsCommandEnabled("Cool"))
    v.EnableCommand("Cool", true);
    if (TankEmpty)
    TankEmpty = false;
    }
    }
    } else
    System::Error("WATER, Unknown water tank Dummyobject!");
     
    // CHANGE ICONS
    if (RelativeWaterLevel >= 90)
    {
    if (!v.HasCommand("DummyWater100Perc")) v.AssignCommand("DummyWater100Perc");
    if (v.HasCommand("DummyWater80Perc")) v.RemoveCommand("DummyWater80Perc");
    if (v.HasCommand("DummyWater60Perc")) v.RemoveCommand("DummyWater60Perc");
    if (v.HasCommand("DummyWater40Perc")) v.RemoveCommand("DummyWater40Perc");
    if (v.HasCommand("DummyWater20Perc")) v.RemoveCommand("DummyWater20Perc");
    }
    else if (WaterLevel <= 0 || (WaterLevel > 0 && WaterLevel < 20) || RelativeWaterLevel >= 80)
    {
    if (v.HasCommand("DummyWater100Perc")) v.RemoveCommand("DummyWater100Perc");
    if (v.HasCommand("DummyWater80Perc")) v.RemoveCommand("DummyWater80Perc");
    if (v.HasCommand("DummyWater60Perc")) v.RemoveCommand("DummyWater60Perc");
    if (v.HasCommand("DummyWater40Perc")) v.RemoveCommand("DummyWater40Perc");
    if (v.HasCommand("DummyWater20Perc")) v.RemoveCommand("DummyWater20Perc");
    }
    else if (RelativeWaterLevel >= 60)
    {
    if (v.HasCommand("DummyWater100Perc")) v.RemoveCommand("DummyWater100Perc");
    if (!v.HasCommand("DummyWater80Perc")) v.AssignCommand("DummyWater80Perc");
    if (v.HasCommand("DummyWater60Perc")) v.RemoveCommand("DummyWater60Perc");
    if (v.HasCommand("DummyWater40Perc")) v.RemoveCommand("DummyWater40Perc");
    if (v.HasCommand("DummyWater20Perc")) v.RemoveCommand("DummyWater20Perc");
    }
    else if (RelativeWaterLevel >= 40)
    {
    if (v.HasCommand("DummyWater100Perc")) v.RemoveCommand("DummyWater100Perc");
    if (v.HasCommand("DummyWater80Perc")) v.RemoveCommand("DummyWater80Perc");
    if (!v.HasCommand("DummyWater60Perc")) v.AssignCommand("DummyWater60Perc");
    if (v.HasCommand("DummyWater40Perc")) v.RemoveCommand("DummyWater40Perc");
    if (v.HasCommand("DummyWater20Perc")) v.RemoveCommand("DummyWater20Perc");
    }
    else if (RelativeWaterLevel >= 20)
    {
    if (v.HasCommand("DummyWater100Perc")) v.RemoveCommand("DummyWater100Perc");
    if (v.HasCommand("DummyWater80Perc")) v.RemoveCommand("DummyWater80Perc");
    if (v.HasCommand("DummyWater60Perc")) v.RemoveCommand("DummyWater60Perc");
    if (!v.HasCommand("DummyWater40Perc")) v.AssignCommand("DummyWater40Perc");
    if (v.HasCommand("DummyWater20Perc")) v.RemoveCommand("DummyWater20Perc");
    }
    else if (WaterLevel > 0)
    {
    if (v.HasCommand("DummyWater100Perc")) v.RemoveCommand("DummyWater100Perc");
    if (v.HasCommand("DummyWater80Perc")) v.RemoveCommand("DummyWater80Perc");
    if (v.HasCommand("DummyWater60Perc")) v.RemoveCommand("DummyWater60Perc");
    if (v.HasCommand("DummyWater40Perc")) v.RemoveCommand("DummyWater40Perc");
    if (!v.HasCommand("DummyWater20Perc")) v.AssignCommand("DummyWater20Perc");
    }
     
    // REPEAT COMMAND
    childID = WaterLevel;
    obj.PushActionWait(ACTION_NEWLIST, 1.0f);
    obj.PushActionExecuteCommand(ACTION_APPEND, "DummyUpdateWaterLevel", &v, childID, false);
    //System::Log("WATER, Water level of %s: %d",v.GetPrototypeFileName(),childID);
      }
    };
     
    object DummyCheckWaterSupply : CommandScript
    {
      DummyCheckWaterSupply()
      {
      SetGroupID(20);
      }
      
      bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
      {
      return true;
      }
     
    void PushActions(GameObject *Caller, Actor *Target, int childID)
      {
    VehicleList fflist(VT_FIREFIGHTERS_ASF, VT_FIREFIGHTERS_GTF);
    for(int i = 0; i < fflist.GetNumVehicles(); i++)
    {
    if (!fflist.GetVehicle(i)->HasCommand("VcmdWaterSupply") && fflist.GetVehicle(i)->IsValid() && !fflist.GetVehicle(i)->IsSmoking() && !fflist.GetVehicle(i)->IsDestroyed() && fflist.GetVehicle(i)->HasCommand("MoveTo") && (fflist.GetVehicle(i)->GetVehicleType() == VT_FIREFIGHTERS_GTF || fflist.GetVehicle(i)->GetVehicleType() == VT_FIREFIGHTERS_TLF || fflist.GetVehicle(i)->GetVehicleType() == VT_FIREFIGHTERS_LPF || fflist.GetVehicle(i)->GetVehicleType() == VT_FIREFIGHTERS_DLK))
    {
    Vehicle v(fflist.GetVehicle(i));
    v.AssignCommand("VcmdWaterSupply");
    v.AssignCommand("DummyUpdateWaterLevel");
    GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "WaterTankDummy");
    mDummy.Hide();
    mDummy.SetUserData(v.GetID());
    mDummy.PushActionExecuteCommand(ACTION_NEWLIST, "DummyUpdateWaterLevel", &v, 0, false);
    }
    }
    GameObject obj(Caller);
    obj.PushActionWait(ACTION_NEWLIST, 2.0f);
    obj.PushActionExecuteCommand(ACTION_APPEND, "DummyCheckWaterSupply", Caller, childID, false);
      }
    };
     
    object VcmdWaterSupply : CommandScript
    {
      VcmdWaterSupply()
      {
    SetIcon("water100");
    SetCursor("cool");
    SetValidTargets(ACTOR_VEHICLE);
    SetRestrictions(RESTRICT_SELFEXECUTE);
      }
      
      bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
      {
      if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID())
      return false;
    if (Caller->HasCommand("DummyEmptyTank"))
    SetIcon("water0");
    else if (Caller->HasCommand("DummyWater20Perc"))
    SetIcon("water20");
    else if (Caller->HasCommand("DummyWater40Perc"))
    SetIcon("water40");
    else if (Caller->HasCommand("DummyWater60Perc"))
    SetIcon("water60");
    else if (Caller->HasCommand("DummyWater80Perc"))
    SetIcon("water80");
    else
    SetIcon("water100");
      return true;
      }
     
    void PushActions(GameObject *Caller, Actor *Target, int childID)
      {
    Caller->AssignCommand("DummyCheckWaterSupply");
    }
    };
     
    object DummyWater100Perc: CommandScript
    {
      DummyWater100Perc()
      {
    SetGroupID(20);
      }  
      bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
      {
      return false;
     
    void PushActions(GameObject *Caller, Actor *Target, int childID)
      {
    }
    };
     
    object DummyWater80Perc: CommandScript
    {
      DummyWater80Perc()
      {
    SetGroupID(20);
      }  
      bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
      {
      return false;
     
    void PushActions(GameObject *Caller, Actor *Target, int childID)
      {
    }
    };
     
    object DummyWater60Perc: CommandScript
    {
      DummyWater60Perc()
      {
    SetGroupID(20);
      }  
      bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
      {
      return false;
     
    void PushActions(GameObject *Caller, Actor *Target, int childID)
      {
    }
    };
     
    object DummyWater40Perc: CommandScript
    {
      DummyWater40Perc()
      {
    SetGroupID(20);
      }  
      bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
      {
      return false;
     
    void PushActions(GameObject *Caller, Actor *Target, int childID)
      {
    }
    };
     
    object DummyWater20Perc: CommandScript
    {
      DummyWater20Perc()
      {
    SetGroupID(20);
      }  
      bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
      {
      return false;
     
    void PushActions(GameObject *Caller, Actor *Target, int childID)
      {
    }
    };
     
     
    object DummyEmptyTank : CommandScript
    {
      DummyEmptyTank()
      {
      SetGroupID(20);
      }
      
      bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
      {
      return true;
      }
     
    void PushActions(GameObject *Caller, Actor *Target, int childID)
      {
      }
    };

     

  9. Would it be possible to add a button like install for a ladder that would covert the engine to a tanker basically? Then use the tanker scripts when it is in tanker mode?

    That would require the tanker script to accept more than one prototype which we currently have not been able to accomplish... And requires more scripting knowledge than I have
  10. Hey great mod!! Only problem I had was that I tried to relay from one Engine to another then couldn't disconnect one of the suply lines and forevermore got those two engines out of service because of it...idk -_-

    You can not pump from one engine to another... I am not aware of a script that currently allows that otherwise it would be done

  11. So many fires! and is it just me or do the vehicles seem slower compared to other mods? It seems like they go the same speed as units that are set to patrol.

    yeah I have to turn it down. I used the same file from the Manchester amid when everyone was complaining that there was too much time between incidents.
  12. Whats up out there just a little update on some units I have been working on thanks for your support. I am looking for a little up help with a script issues with getting the GetStryker to work.

     

    If you need some assistance I am willing to help.  I am going to be working on the update for my Boston Mod within the next month or so as well.

×
×
  • Create New...