Jump to content

paulo ve

Members
  • Posts

    213
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by paulo ve

  1. The problem is that every person appears to support O2 !!!!


    Is to modify to get along with limited water. 

    So modify the (radioact) to (water_supply_main).


     

     

    const char IMG[] = "LightOn";

    int DummyGroup = 20;

    Vector pos;

     

     

     

     object PCmdStartCon : CommandScript

     

     {

     

    PCmdStartCon()

      {                                                                                                         //2

      SetIcon(IMG);

      SetCursor(IMG);

      SetRestrictions(RESTRICT_SELFEXECUTE);

      SetPriority(90);

    }                                               

     

     bool CheckPossible(GameObject *Caller)

      {

      if (!Caller->IsValid())

      return false;

     

      if (Caller->GetObjectType()==TYPE_PERSON ||Caller->GetType() == VT_FIREFIGHTERS_GTF )

     

      {

      return true;

      }

     

      return false;

      }

     

     

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

      {

      return true;

      }

     

     

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

    {

     

    GameObjectList ra = Game::GetGameObjects("radioact");

    if(ra.GetNumObjects() > 0)

    {

    GameObject *rao = ra.GetObject(0);

    rao->SetContaminationArea(CONTAMINATION_CHEMICAL,2500.0f);

    }

     

    }

     

     

    };

    post-16729-0-48298200-1402796773_thumb.p

  2. I have wished for a script like this, to use in freeplay modifications for a long time.

     

    But the one, you are showing isn't going to be possible, since ERS script are encrypted to use for other players.

    the possibility of an decrypt the scripts?

  3. You just want to use a different animation when using the extinguisher or something? The 'useextinguisher' animation for persons are hardcoded to that specific action (use the extinghuisher) I think. Or did you mean something else? Your posts aren't very clear.

    yes, I would use the uxeaxe animation! 
    Hoppah Thanks for your attention!
  4. Help! 
    I would put the animation (useaxe) instead of the current 
    So that continues as erasing Extinguish. 
     
    Help for possible new script.!!

    Scout for wildfires

     

    object Extinguish : CommandScript
    {
    bool useDLKlogic;
     
    Extinguish()
    {
    SetValidTargets(ACTOR_OBJECT | ACTOR_VEHICLE | ACTOR_HOUSE | ACTOR_OPEN_HOUSE);
    SetRestrictions(RESTRICT_BURNING);
    SetKeepAsCurrentCommand(true);
    SetPossibleCallers(ACTOR_PERSON | ACTOR_VEHICLE);
    SetPossibleEquipment(EQUIP_FIRE_EXTINGUISHER | EQUIP_FIREHOSE);
    SetPossibleExists(CPE_EXTINGUISHABLE_OBJECTS);
    SetNeedsConnectedHose(CFN_NEEDED);
    }
     
    /*bool CheckPossible(GameObject *Caller)
    {
    if(!Caller->IsValid())
    return false;
    if (Caller->GetType() == ACTOR_VEHICLE || Caller->GetEquipment()==EQUIP_FIRE_EXTINGUISHER || (Caller->GetEquipment()== EQUIP_FIREHOSE && Caller->GetFirehoseID() != 0))
    return Game::ExistsExtinguishableObject();
    return false;
    }*/
     
    bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
    {
    if(!Caller->IsValid() || !Target || !Target->IsValid() || Caller->GetID() == Target->GetID())
    return false;
     
    if(Target->GetType() == ACTOR_PERSON)
    return false;
     
    GameObject o(Target);
    if(!o.IsValid() || !o.IsBurning() || o.GetNumActiveFireChilds() == 0)
    return false;
     
    if (Caller->GetType() == ACTOR_PERSON )
    {
    Person p(Caller);
    if (p.GetEquipment() == EQUIP_FIREHOSE && o.GetParentHouseID() > -1)
    return false;
    if (p.CanUseDLKCannon())
    {
    useDLKlogic = true;
    if (o.GetNumActiveFireChilds() == 0)
    return false;
    if (p.GetEnteredCarTargetID() != -1 && p.GetEnteredCarTargetID() != Target->GetID())
    return false;
    if (p.GetEnteredCarID() == Target->GetID())
    return false;
     
    if (p.GetEnteredCarTargetID() != -1 && !o.IsBurningInside())
    return false;
    else 
    if (p.GetEnteredCarTargetID() == -1 && !o.IsBurningOutside())
    return false;
     
    if (!p.CheckDLKExtinguishDistance(Target))
    return false;
     
    return true;
    }
    if (p.GetEnteredCarID() != -1)
    return false;
    }
    useDLKlogic = false;
     
    if (Caller->GetType() == ACTOR_VEHICLE || Caller->GetEquipment()==EQUIP_FIRE_EXTINGUISHER || Caller->GetEquipment()== EQUIP_FIREHOSE)
    {
    if (Caller->GetEquipment() == EQUIP_FIREHOSE && Caller->GetFirehoseID() == 0)
    return false;
    return true;
    }
    return false;
    }
     
    void PushActions(GameObject *Caller, Actor *Target, int childID)
    {
    if (useDLKlogic)
    {
    Person p(Caller);
    if (p.GetEnteredCarTargetID() == -1)
    {
    Caller->PushActionTurnBase(ACTION_NEWLIST, Target);
    Caller->PushActionCannonExtinguish(ACTION_APPEND, Target, 25.f, false);
    }
    else
    Caller->PushActionCannonExtinguish(ACTION_NEWLIST, Target, 25.f, false);
    return;
    }
     
    if (Caller->GetType() == ACTOR_VEHICLE)
    {
    Vehicle v(Caller);
    float Energy;
    if(v.GetVehicleType()==VT_FIREFIGHTERS_TLF)
    Energy = 25.0f;
    else
    if(v.GetVehicleType()==VT_FIREFIGHTERS_FLB)
    Energy = 30.0f;
    else
    if(v.GetVehicleType()==VT_FIREFIGHTERS_LPF)
    Energy = 25.0f;
    else
    Energy = 70.0f;
     
    GameObject o(Target);
    if (v.IsCurrentAnimation("activate"))
    {
    int UnitID = v.GetID();
    GameObjectList l1 = Game::GetGameObjectsWithPrefix("engine_water_cannon");
    for(int i = 0; i < l1.GetNumObjects(); i++)
    {
    if (l1.GetObject(i)->GetType() == ACTOR_VEHICLE)
    {
    Vehicle obj(l1.GetObject(i));
    if (obj.GetUserData() == UnitID && obj.CheckExtinguishDistance(o) && obj.GetVehicleType()==VT_FIREFIGHTERS_TLF)
    obj.PushActionExtinguish(ACTION_NEWLIST, Target, 30.0f);
    }
    }
    }
    else if (!v.CheckExtinguishDistance(o))
    {
    if (v.HasCommand("VcmdRotateLightmast"))
    return;
    Caller->PushActionMove(ACTION_NEWLIST, Target, TARGET_EXTINGUISH);
    Caller->PushActionExtinguish(ACTION_APPEND, Target, Energy);
    }
    else
    Caller->PushActionExtinguish(ACTION_NEWLIST, Target, Energy);
    }
    else
    {
    if (Target->GetType()==ACTOR_VEHICLE)
    {
    Caller->PushActionMove(ACTION_NEWLIST, Target, TARGET_ENGINE_EXTINGUISH);
    Vector TargetPos = Target->GetTargetPoint(Caller, TARGET_ENGINE);
    Caller->PushActionTurnTo(ACTION_APPEND, TargetPos);
    }
    else
    {
    Caller->PushActionMove(ACTION_NEWLIST, Target, TARGET_EXTINGUISH_PERSON);
    Vector TargetPos = Target->GetTargetPoint(Caller, TARGET_FLAME_EFFECT);
    Caller->PushActionTurnTo(ACTION_APPEND, TargetPos);
    }
     
    float Energy = (Caller->GetEquipment()==EQUIP_FIREHOSE) ? 20.0f : 12.5f;
    Caller->PushActionExtinguish(ACTION_APPEND, Target, Energy);
    }
    }
     
    };
     
×
×
  • Create New...