Jump to content

Quincy

Members
  • Posts

    368
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Quincy

  1. I completely forgot about this topic im going to pickup where i left off. Im going to work on the helmet light next then the PASS device script and after that im going to come back to this command post and fix it and try to make it so it calls in units already on the map. Sorry about not being active. 

  2.  

    Got it to play and stop a repeating 3D sound.

     

    Step 1: Find this line (two places)...

    x = Audio::PlaySample3D(PfadAudio3D, go->GetPosition(), true);

    ...and add...

    go->SetUserData(x);

    ...after it.

     

    Step 2: Find...

    go.RemoveCommand("AlarmTriggered");
    go.RemoveCommand("FalseAlarm");

    ...and add these lines after it...

    if (Audio3D == 0)
    {
        int ref = Target->GetUserData();
        Audio::StopSample(ref);
    }

    That pretty much wraps up the script as far as I'm concerned. I'm not sure about the permissions on the BMA script, otherwise I'd post mine here for others to use.

    Free to use, it seems, so here's the whole package with English readme and script.

    attachicon.gif Fire Alarm Script with False Alarms (BMA).rar

    The loot, could you please reupload those files. Im getting unknown format or damaged message.

  3. Thanks Bama slow progress but thanks again for the feedback guys.  I am looking for a script person and someone who can do some light modeling work

    I made some changes to the LA 2.0 map but it still dose not look like Boston.  Only Dyson's and Rafael  Manhattan  map comes close to city map. Here is few screen shots. i also thinking of adding in Dyson's and Raf Fire engines great work by their team.

    I say nay to adding Dyson and Raf's engines, Boston doesn't run Seagraves. The run Pierce, Eone, Ferrara and KME and  by the way I PM'd you about scripting.

  4. Hi I'm making a script/set of scripts that will require hazmat on scene to survey the area and find out what type of contaminate it is and then you would have to change them over to the correct type of suit for the situation. Here are my questions:

    1. Is there a way to check for contamination in a script? I found this in EM4 sdk under gameobject section. I just need a way of detecting the type and posting to a helptext display. I have the logic I just don't know what function would be used to check for it.
      CONTAMINATION_ATOMIC,CONTAMINATION_CHEMICAL,CONTAMINATION_BIOLOGICAL
    2. I know that the hazmat events in freeplay are caused by a trigger detecting if a building within the trigger is on fire, is there a way of setting what type of contaminate it is? (ATOMIC, CHEM, BIO)

                                                                                                                                                                                                    Thanks,

                                                                                                                                                                                                    Quincy

  5. Hi, I'm trying to make it so this script can also pickup objects that fire fighters can pull (i.e. rubble on top of victims). If tried what I think would work and it doesnt. I know it has to do with the CheckTarget loop but I just don't know what to write to make that happen, I've tried multiple things with no success. (Script Credit: Kreuzung from emergency-forum.de)

     

    Snippet of code I need help with:

     

    object HeliLift : CommandScript

    {
    HeliLift()
    {
    SetPossibleCallers(ACTOR_VEHICLE);
    SetValidTargets(ACTOR_VEHICLE | ACTOR_OBJECT);
    SetRestrictions(RESTRICT_NOTBURNING);
    SetGroupID(CGROUP_CRANE);
    SetIcon("liftwithcrane");
    SetCursor("liftwithcrane");
    }
     
    bool CheckPossible(GameObject *caller) { return caller->IsChildEnabled("hook") && Game::ExistsObjectWithFlagSet(OF_RECOVERABLE); }
    bool CheckGroupVisibility(GameObject *caller) { return caller->IsChildEnabled("hook"); }
     
    bool CheckTarget(GameObject *caller, Actor *target, int childID)
    {
    GameObject tgt(target);
     
    if(!tgt.IsFlagSet(OF_RECOVERABLE))
    return false;
     
    if(tgt.GetType() == ACTOR_VEHICLE)
    {
    Vehicle v(target);
    if(v.IsSmoking() || v.GetNumPassengers() || v.GetNumTransported() || v.HasAnyAction()
    || ((v.HasCommand("flyto") || v.GetVehicleType() == VT_TV_HELI) && !v.IsOnGround()))
    return false;
    if(v.GetVehicleType() > VT_NOSQUAD && (v.GetVehicleType() < VT_TAXI || v.GetVehicleType() > VT_TV_HELI) && !v.IsCommandable())
    return false;
    }
    return true;
    }

     

    Full Script: (For Reference)

     

    /*

    Helicopter lift script by Kreuzung
    Published under the CreativeCommons Attribution License
     
    Features:
    - Helicopters can lift objects and vehicles, including empty squad ones
    - While carrying something, helis will have to fly slower (configurable)
     
    Known bugs:
    - Sometimes dropping an object drops it slightly below the ground, I've setup the drop offset to minimize this
    - The person routefinder refuses to guide persons around dropped vehicles, either move the vehicle (if you can) or guide the persons around it manually
    - Sometimes you can lift a squad vehicle when you shouldn't be able to
    - The wheels of vehicles rotate while lifting/dropping them... xD
     
    How to use:
    - It really works the same as the standard crane ;)
     
    How to add to your mod:
    - Put this file in your command script folder
    - Assign the commands "HeliLift" and "HeliDrop" to the helicopter
    - Add a child called "hook" to the helicopter (important!), this is used to determine if the helicopter is carrying something and where exactly objects will be attached
    - If you want other commands to not work while lifting something, check if the "hook" child is enabled in their CheckPossible part - it will be disabled while lifting
    */
    const float LIFT_MAX_DISTANCE = 25f; //how far the heli can be away from the object to be lifted
    const float LIFT_SPEED = 10f; //how fast the heli can lift/drop things, slower means higher accuracy when putting the object to the ground, so you might want to adjust drop offset as well when you change this
    const float DROP_HEIGHTOFFSET = 15f; //prevents the object from dropping into the ground, the default value is ideal for a lift speed of 10
    const float LIFTED_HEIGHTOFFSET = 250f; //how high the heli will stay above the lifted object
    const float SPEED_MULTIPLIER_CARRYING = 0.5f; //speed multiplier while carrying something
    namespace Utils
    {
    GameObject GetHook(int id)
    {
    GameObjectList l("hook");
    for(int i = 0; i < l.GetNumObjects(); i++)
    if(l.GetObject(i)->GetUserData() == id)
    return l.GetObject(i);
    return NULL;
    }
     
    GameObject GetLiftedObject(GameObject hook)
    {
    GameObjectList l = Game::GetGameObjects();
    GameObject result = l.GetObject(0);
    for(int i = 0; i < l.GetNumObjects(); i++)
    if(l.GetObject(i)->HasCommand("DummyHeliLifted") && (!result.IsValid() || l.GetObject(i)->DistanceXY(hook) < result.DistanceXY(hook)))
    result = l.GetObject(i);
    if(result.HasCommand("DummyHeliLifted"))
    return result;
    return NULL;
    }
    };
     
    object HeliLift : CommandScript
    {
    HeliLift()
    {
    SetPossibleCallers(ACTOR_VEHICLE);
    SetValidTargets(ACTOR_VEHICLE | ACTOR_OBJECT);
    SetRestrictions(RESTRICT_NOTBURNING);
    SetGroupID(CGROUP_CRANE);
    SetIcon("liftwithcrane");
    SetCursor("liftwithcrane");
    }
     
    bool CheckPossible(GameObject *caller) { return caller->IsChildEnabled("hook") && Game::ExistsObjectWithFlagSet(OF_RECOVERABLE); }
    bool CheckGroupVisibility(GameObject *caller) { return caller->IsChildEnabled("hook"); }
     
    bool CheckTarget(GameObject *caller, Actor *target, int childID)
    {
    GameObject tgt(target);
     
    if(!tgt.IsFlagSet(OF_RECOVERABLE))
    return false;
     
    if(tgt.GetType() == ACTOR_VEHICLE)
    {
    Vehicle v(target);
    if(v.IsSmoking() || v.GetNumPassengers() || v.GetNumTransported() || v.HasAnyAction()
    || ((v.HasCommand("flyto") || v.GetVehicleType() == VT_TV_HELI) && !v.IsOnGround()))
    return false;
    if(v.GetVehicleType() > VT_NOSQUAD && (v.GetVehicleType() < VT_TAXI || v.GetVehicleType() > VT_TV_HELI) && !v.IsCommandable())
    return false;
    }
    return true;
    }
     
    void PushActions(GameObject *caller, Actor *target, int childID)
    {
    GameObject tgt(target);
    switch(childID)
    {
    Vehicle v(caller);
    if(caller->DistanceXY(tgt) > LIFT_MAX_DISTANCE || v.IsOnGround())
    {
    caller->PushActionFlyTo(ACTION_NEWLIST, tgt.GetPosition(), false, -1);
    caller->PushActionExecuteCommand(ACTION_APPEND, "HeliLift", target, 0, true);
    return;
    }
     
    GameObject hook = Game::CreateObject(tgt.GetPrototypeFileName(), "hook");
    hook.SetPlacementNone();
    hook.SetPosition(caller->GetChildPosition("hook") + Vector(0, 0, -LIFTED_HEIGHTOFFSET));
    hook.SetRotation(caller);
    hook.SetFlag(OF_HIDDEN);
    hook.SetUserData(caller->GetID());
    hook.SetSpeed(caller->GetSpeed());
     
    caller->SetCommandable(false);
    caller->SetChildEnabled("hook", false);
    caller->SetSpeed(caller->GetSpeed() * SPEED_MULTIPLIER_CARRYING);
     
    tgt.SetCommandable(false);
    tgt.AssignCommand("DummyHeliLifted");
    tgt.SetPlacementNone();
    tgt.PushActionMoveToPoint(ACTION_NEWLIST, &hook, LIFT_SPEED);
    tgt.PushActionExecuteCommand(ACTION_APPEND, "HeliLift", &hook, 1, false);
    break;
     
    case 1: //caller = object / target = hook
    Vehicle heli(&Game::GetActor(tgt.GetUserData()));
    heli.SetCommandable(true);
    heli.AddTrainWaggon(caller);
    heli.AddTrainWaggon(&tgt);
    tgt.SetFlag(OF_HIDDEN);
    tgt.PushActionExecuteCommand(ACTION_NEWLIST, "HeliLift", caller, 2, false);
    break;
     
    case 2: //caller = hook / target = object... somehow it works better to have 2 train wagons (disables autorotate) and set the rotation manually
    Vehicle heli(&Game::GetActor(caller->GetUserData()));
    if(!heli.IsValid() || tgt.IsCurrentAction("EActionMoveToPoint"))
    return;
    bool burningVehicle = false;
    if(tgt.GetType() == ACTOR_VEHICLE)
    {
    Vehicle v(target);
    if(v.IsSmoking())
    burningVehicle = true;
    }
    if(heli.IsDestroyed() || burningVehicle)
    {
    heli.RemoveTrainWaggon(caller);
    heli.RemoveTrainWaggon(&tgt);
    heli.SetChildEnabled("hook", true);
    tgt.SetPlacement(PLACEMENT_ALIGNED_CORNERS);
    tgt.EnablePhysicsSimulation();
    tgt.UnfreezePhysics();
    caller->PushActionDeleteOwner(ACTION_NEWLIST);
    }
    Vector fixedZ = tgt.GetPosition();
    fixedZ.z = heli.GetChildPosition("hook").z -LIFTED_HEIGHTOFFSET;
    tgt.SetPosition(fixedZ);
    tgt.SetRotation(&heli);
    caller->PushActionExecuteCommand(ACTION_NEWLIST, "HeliLift", target, 2, false);
    break;
    }
    }
    };
     
    object HeliDrop : CommandScript
    {
    GameObject hook;
    HeliDrop()
    {
    SetPossibleCallers(ACTOR_VEHICLE);
    SetValidTargets(ACTOR_FLOOR | ACTOR_VIRTUAL | ACTOR_OBJECT);
    SetGroupID(CGROUP_CRANE);
    SetIcon("drop");
    SetCursor("drop");
    SetHighlightingEnabled(false);
    }
     
    bool CheckPossible(GameObject *caller) { return !caller->IsChildEnabled("hook"); }
    bool CheckGroupVisibility(GameObject *caller) { return !caller->IsChildEnabled("hook"); }
     
    bool CheckTarget(GameObject *caller, Actor *target, int childID)
    {
    hook = Utils::GetHook(caller->GetID());
    return Game::FindFreePosition(&hook, Game::GetCommandPos(), 0);
    }
     
    void PushActions(GameObject *caller, Actor *target, int childID)
    {
    switch(childID)
    {
    case 0:
    caller->PushActionFlyTo(ACTION_NEWLIST, Game::GetCommandPos(), false, -1);
    caller->PushActionExecuteCommand(ACTION_APPEND, "HeliDrop", NULL, 1, true);
    return;
     
    case 1:
    hook = Utils::GetHook(caller->GetID());
    GameObject lifted = Utils::GetLiftedObject(hook);
    Vector dropPos = caller->GetPosition();
    dropPos.z = Game::GetFloorHeight(dropPos.x, dropPos.y) + DROP_HEIGHTOFFSET;
     
    hook.SetRotation(caller);
     
    caller->SetCommandable(false);
    Vehicle heli(caller);
    heli.RemoveTrainWaggon(&hook);
    heli.RemoveTrainWaggon(&lifted);
     
    hook.SetPlacement(lifted.GetType() == ACTOR_VEHICLE ? PLACEMENT_CUSTOM_PLACEMENT : PLACEMENT_ALIGNED_CORNERS);
    hook.SetPosition(dropPos);
     
    lifted.PushActionMoveToPoint(ACTION_NEWLIST, &hook, LIFT_SPEED);
    lifted.PushActionExecuteCommand(ACTION_APPEND, "HeliDrop", &hook, 2, false);
    break;
     
    case 2:
    Vehicle heli(&Game::GetActor(target->GetUserData()));
    hook = new GameObject(target);
    heli.SetCommandable(true);
    heli.SetChildEnabled("hook", true);
    heli.SetSpeed(hook.GetSpeed());
     
    hook.PushActionDeleteOwner(ACTION_NEWLIST);
    caller->SetPlacement(caller->GetType() == ACTOR_VEHICLE ? PLACEMENT_CUSTOM_PLACEMENT : PLACEMENT_ALIGNED_CORNERS);
    caller->SetCommandable(true);
    caller->RemoveCommand("DummyHeliLifted");
    }
    }
    };
     
    object DummyHeliLifted : CommandScript
    {};

    BTW the CODE tag on the forum is broken, had to use quote tag. :(

  6. Got it! Seems one person doesn't like to connect automatically, and paramedics always have a medic bag somehow if they were created from the script; not sure what's going on there.

    Connecting is  pathing issue and the medic bag is because you have this line somewhere, remove that line and you are all set.

    p1.SetEquipment(EQUIP_EMERGENCY_CASE); //p1 or p2 or p3 or p4 it depends on which proto is the medic
  7. On the scene of a barricaded suspect with multiple hostages and PD establishing a perimeter and EMS staging with backboards and a stretcher.  Credit for backboard model is Dyson of the Manhattan mod and Stryker stretcher is emergency-forum.de . (Screen shot is crappy due to fraps)Em4Deluxe%202013-08-19%2019-11-49-72.jpg

  8. Played fine with zero crashes, only 5 bugs to report.  Zero crashes for me after updating my graphics card drivers just some minor little glitches. Amazing work you guys, keep it up!!

    Bugs:

    • Burn time on car is set too low (Not enough time for FD to respond)
    • For the police events there is no suspect, havent passed one PD event so far.
    • Alley way in the lower right hand portion of the map (has a boiler or something in it) is inaccessible, it looks accessible but it is not (units halt at opening of alleyway).
    • When returning the tower ladder to quarters from a spot on the map, 3 fire fighters got out of the truck and started walking to the station.
    • No icon for spineboard removal
  9. expect I seen performance issue on my system.  I have none of the above.  I have 2GB of dedicated video ram.  The game and the mod are install on SSD drive.   Yet this mod takes longer to load then any other mod.  include winterberg.  

     

    Until i turn all the EM4 graphics setting to load.  I would crash to desktop with in 5 minutes.   Now i cna play for a bit as long as I do not enter a building.   I be trying the SD version today.   

    Can you send me your emergency 4 log file, its found in the directory?

  10. CALL 911

     

    Fire: Find nearest point of egress and make sure women and children make it out before me, dont allow anyone to enter building.

    Shooting: Dig in or run and hope not to get shot.

    Medical Emergency: Render aid by following 4 life saving steps and lessons learned from combat life saving course.

    Large scale disaster/attack: Run the other way.

    Physical altercation: Knock out assailant or both parties, call police.

  11. Performance issues are due to people having onboard/integrated graphics cards. Those cards are actually a portion of the processor devoted to processing graphics, this significantly reduces the amount of processing power avaliable. These processors are made for the everyday computer user (using facebook, checking emails, browsing youtube,etc.) and not high definition gaming.  The reason you thing the processor is the big issue is that AMD's integrated graphics use a AMD Radeon integrated card which draws power from the processor and Intel has their own type called Intel HD Graphics (NAME IS MISLEADING, can in no way run HD graphics.).  Laptops and most moderately priced desktops have integrated graphics. What people need to play this game and this mod is a dedicated graphics card which is basically a second processor that processes graphics.  Only higher end desktops and very high end laptops come with these installed. To upgrade the computer its as simple as getting a graphics card upgrade to their computer from their local computer shop. I dont recommend you making a SD version because people with lower end systems will still experience crashes and FPS lag due to their systems not being up to par. 

  12.  Try putting  the false declaration in brackets like i've done below. (Copy and paste this snippet over the current code.

    	    GameObjectList list = Game::GetGameObjects(NAME_AMBULANCE03)		if (list.GetNumObjects() > 0)                 {                Ambulance03 = false;                }            GameObjectList list = Game::GetGameObjects(NAME_AMBULANCE04)		if (list.GetNumObjects() > 0)                 {                Ambulance04 = false;                }            GameObjectList list = Game::GetGameObjects(NAME_AMBULANCE05)		if (list.GetNumObjects() > 0)                 {                Ambulance05 = false;                {
  13. Ha, I was in 8th grade. We TPed my buddys house as he was out of town for a hockey tournament. Walking home we saw a cop turn the corner about 3 blocks back. We took off running of course! Ran through the first backyard we found. Yeah..we came with in about a foot of a chained up German Shepard. I almost shit a brick!

    Yeah and that was how i got to meet the Gloucester Police's new K9 Mako, after he woke me up and tore some druggy limb for limb. It was a good time.

×
×
  • Create New...