Jump to content

Kookas

Members
  • Posts

    486
  • Joined

  • Last visited

Posts posted by Kookas

  1. Hmm, I'm not sure how the groups work.

    Although now it's complaining that I'm using the wrong member access operator. I tried both . and ->. I think it's just the same thing as when they say "Expected ;", just a way of saying it doesn't know quite what's wrong but something is :\

    //**************************************************************************************************
    // #Version 2.0# ****
    // ****
    // Changes: - Disables Sirens after arriving targetpoint. ****
    // - Enables Sirens if vehicle has VCmdAutoSirenOff. ****
    // ****
    // ****
    // DO NEVER REPLACE ORIGINAL SCRIPTS USED BY EM4 IN YOUR DATA-FOLDER! ****
    //**************************************************************************************************

    /*

    const char CMD_SIREN[] = "VCmdSiren";
    const char CMD_AUTOSIREN_OFF[] = "VCmdAutoSirenOff";
    const char DUMMY_HASSIREN[] = "DummyHasSiren";
    const char DUMMY_DISABLE[] = "DummyDisableSiren";

    object MoveTo : CommandScript
    {
    MoveResult mr;

    MoveTo()
    {
    SetValidTargets( ACTOR_FLOOR | ACTOR_OBJECT | ACTOR_VIRTUAL | ACTOR_HOUSE | ACTOR_OPEN_HOUSE | ACTOR_PERSON );
    SetHighlightingEnabled(false);
    SetDeselectCaller(false);
    //SetActivationByLeftClick(true);
    }

    bool CheckPossible(GameObject *Caller)
    {

    if( Caller->GetType()==ACTOR_VEHICLE )
    {

    Vehicle v = Caller;

    if( v.GetNumPassengers() == 0 )
    return false;
    else
    return true;

    }
    else
    {

    return true;

    }

    }

    bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
    {
    mr = Commands::CheckMoveConditions(Caller, Target, childID);
    if ( mr.Mode == MOVE_ABORT )
    return false;

    return true;
    }

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

    // test variable
    Vector personpos = Target->GetPosition();

    if (mr.Mode == MOVE_ABORT)
    return;

    if( Target->GetType()==ACTOR_PERSON )
    {

    System::Log("Human target found.");

    }

    switch(mr.Mode)
    {
    case MOVE_TO_POSITION:
    {
    if (Caller->GetFirehoseID() > 0)
    {
    Caller->PushActionMoveWithHose(ACTION_NEWLIST, mr.Target);
    return;
    }
    if (Caller->GetType()==ACTOR_VEHICLE && Target->GetType()==ACTOR_PERSON)
    {
    Caller->PushActionMove(ACTION_NEWLIST, personpos, true);
    return;
    }
    Caller->PushActionMove(ACTION_NEWLIST, mr.Target, true);
    //Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_DISABLE, Caller, 2, false);
    break;
    }

    case MOVE_INTO_HOUSE:
    {
    Caller->PushActionMove(ACTION_NEWLIST, mr.Intermediate1, true);
    Caller->PushActionEnterHouse(ACTION_APPEND, &mr.EnterHouse);
    Caller->PushActionMove(ACTION_APPEND, mr.Target, true);
    break;
    }

    case MOVE_HOUSE_TO_HOUSE:
    {
    Caller->PushActionMove(ACTION_NEWLIST, mr.Intermediate1, true);
    Caller->PushActionLeaveHouse(ACTION_APPEND, &mr.LeaveHouse);
    Caller->PushActionMove(ACTION_APPEND, mr.Intermediate2, true);
    Caller->PushActionEnterHouse(ACTION_APPEND, &mr.EnterHouse);
    Caller->PushActionMove(ACTION_APPEND, mr.Target, true);
    break;
    }

    case MOVE_HOUSE_TO_POSITION:
    {
    Caller->PushActionMove(ACTION_NEWLIST, mr.Intermediate1, true);
    Caller->PushActionLeaveHouse(ACTION_APPEND, &mr.LeaveHouse);
    Caller->PushActionMove(ACTION_APPEND, mr.Target, true);
    break;
    }
    }

    if (Caller->GetType() == ACTOR_VEHICLE)
    {
    Vehicle v(Caller);
    if (v.IsLightOn())
    {
    Caller->PushActionLightOn(ACTION_INSERT, false);
    }
    if (!v.HasCommand(DUMMY_HASSIREN) && v.HasCommand(CMD_AUTOSIREN_OFF))
    {
    Game::ExecuteCommand(CMD_SIREN, &v, &v);
    }
    }

    // Special code for fgrr (Bergefahrzeug). Deinstalls itself automatically
    if (mr.UnInstall)
    {
    Vehicle v(Caller);
    if (v.GetVehicleType() == VT_THW_FGRR_BKF)
    {
    //System::Print("FGRR: Mode 1 - DeInstall");
    Caller->PushActionDeinstall(ACTION_INSERT);
    }

    else if (v.GetVehicleType() == VT_FIREFIGHTERS_DLK)
    {
    if (mr.BasketDown && mr.UnInstall)
    {
    Caller->PushActionDeinstall(ACTION_INSERT);
    Caller->PushActionBasketDown(ACTION_INSERT, Vector(0.f, 0.f, 0.f));
    }
    else if (mr.BasketDown)
    Caller->PushActionBasketDown(ACTION_INSERT, Vector(0.f, 0.f, 0.f));
    else if (mr.UnInstall)
    Caller->PushActionDeinstall(ACTION_INSERT);
    }
    }
    //Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_DISABLE, Caller, 2, false);
    }
    }; */

    const char CMD_SIREN[] = "VCmdSiren";
    const char CMD_AUTOSIREN_OFF[] = "VCmdAutoSirenOff";
    const char DUMMY_HASSIREN[] = "DummyHasSiren";
    const char DUMMY_DISABLE[] = "DummyDisableSiren";

    object MoveTo : CommandScript
    {

    MoveTo()
    {
    SetValidTargets( ACTOR_FLOOR | ACTOR_OBJECT | ACTOR_VIRTUAL | ACTOR_HOUSE | ACTOR_OPEN_HOUSE );
    SetIcon("dispatch");
    SetHighlightingEnabled(false);
    SetDeselectCaller(false);
    SetPossibleCallers( ACTOR_PERSON );
    }

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


    return true;
    }

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

    Vector gotoTarget = Game::GetCommandPos();

    Vehicle *kingCar = NULL;

    VehicleList carPol(VT_POLICE_MTW, VT_POLICE_STW);

    for (int i = 0; i < carPol.GetNumVehicles(); i++)
    {

    Vehicle *ourCar = carPol.GetVehicle(i);

    float Distance = Math::dist(gotoTarget.x, gotoTarget.y, ourCar->GetPosition().x, ourCar->GetPosition().y);

    if(kingCar == NULL || (Distance < Math::dist(gotoTarget.x, gotoTarget.y, kingCar->GetPosition().x, kingCar->GetPosition().y)))
    kingCar = ourCar;

    }

    kingCar.PushActionMove(ACTION_NEWLIST, gotoTarget, true);

    }
    };

  2. Yeah, how to model, skin, etc, it's not exactly something you can answer just like that... everyone has their own way of doing modelling and it takes lots of practice to create a model from scratch that is of a nice quality. As a little example, I have used Blender frequently for over a year and my models still have quite a few flaws and imperfections.

  3. Yeah. If someone has collapsed and fractured their leg, it will tell you if they are conscious with a command, then you must inject 5cc Morphine and treat any bleeding, whilst clicking on the "comfort person" command every 5 seconds. Then you must click the "Apply Splint" command to immobilise the leg, and then Get Equipment -> Get Stretcher. Then "Lower Stretcher", and click on the person to place it underneath him/her... then you just click on the Ambulance, and it turns into a Driving Simulator.

    That the idea?

  4. On the way back from Kings Heath today, I saw two PRLs responding. I noted two things:

    - they used anti-speeding and pro-seatbelt posters on the sides, not fire safety advertisements.

    - they have proper airhorns, which I can't find on the Internet.

    Scrivs, would you be able to record a fire engine airhorn? Even though they use them all the time around here due to the heavy traffic, it's hard to get a recording because:

    a - can't get to my phone in time

    +

    b - the sound of the other sirens messes up the quality

    +

    c - the phone's audio quality sucks

  5. What do you mean with "they all look like the London cars and trucks"? I have never seen a British police car that looks like a Met police car, or a fire engine that looks like an LFB engine outside of London. Ambulances, however, are all pretty much the same, except that London only has box-van ambulances, whereas other places tend to have normal vans as ambulances.

    I don't mean to be argumentative or offensive, just saying :P

    Also, I hope this mod carries on. It would be neat, imagine the capital as a mod. If you added custom scripts it would be even better. Imagine having an extra event "Suspected Terrorist - provide evidence for a warrant". Then you would have to send in a couple of covert MI5 operatives to spy on them, and to do that, after sending them, you click on the suspect, and they will eavesdrop and whatnot. A random variable (75% chance you get a warrant) will decide whether he's a terrorist or not, and if he is, you must send in the armed cops fast!

  6. Regarding the stretcher becoming two separate paramedics, here's my idea, using my fairly basic scripting knowledge:

    P1: Prototype of 2 paramedics with a stretcher

    P2: Prototype of one paramedic

    The ambulance would be dispatched containing two P2s, but when you click on one of them and press the "Get Stretcher" command, then:

    - a PersonList would be created (or maybe you should create it on dispatch, or when the paramedics leave the ambulance).

    (the PersonList would be named after the ambulance the contents came from, eg, PersonList pl38 would contain the personnel of the vehicle whose ID is 38)

    - using a for loop, you would get the two paramedics and add them to the PersonList.

    - get the paramedics from the PersonList and have them enter their ambulance.

    - as soon as their ambulance contains them, remove them from the PersonList, delete them, and create a P1 (stretcher carrying medics) at the back of the ambulance. The final step is adding the P1 to the PersonList created earlier.

    Splitting up - you would do the same thing but with a P1 into two P2s.

    A little suggestion (in case the paramedics' ambulance is destroyed or something), instead of having the paramedics always get the stretcher from whence they came, have them get it from an ambulance you select when using the command.

    I hope this helps for your actual mod :)

    You could also use the PersonList method when sending the vehicle home. Get all people from the PersonList and single out the ones that aren't injured or contaminated. Send those into the vehicle. Check if all the PersonList members are in the vehicle. If not, check who isn't. If it's an injured person who is missing, leave them for dead! But if it's a contaminated person, wait, because they might be ready to go home soon.

  7. I can kind of guess how that Hamburg vehicle works, but it's a bit complicated and I might be wrong (I don't quite know how HPs work in EM4 anyway). If it works by using an animation of the ladder rotating/raising and then plays through the animation until it reaches the desired frame (probably not), then you would just animate both parts of the HP.

  8. I thought the textures looked a bit wrong but I wouldn't post it because it's considered to be impolite on the Internet to pick out flaws in the work of others on forums.

    Mind you, even in truth, the skins don't look that bad, but then, I don't know what the real life counterparts look like.

  9. Very nice work with the vehicles, but can I make a small suggestion (no intention of seeming like a dick or anything) - you might want to learn about polygon lights. It means you only need to use one corona instead of four for each LED piece, meaning a better appearance. Basically, you go into Polygon Edit mode, click on Add Poly, and then click on four places around your grille lights, numberplate lights, wherever. if it's an irregular shape (circles and ovals can be done with four vertices) then you might want to click on multiple places. When clicking, leave a good distance (3d distance, not time) between each click so it does create a new vertex instead of moving an existing one. Each square you see as you click is a vertex (of course), and when you have more than three, it automatically creates a polygon, marked with a white outline on the truck. Move it around until you have the white outline positioned right to match the part of the vehicle.

    Changing the lightmap with a polygon selected will change the texture of the polygon. For grille lights, you might want to use rectangle, but experiment with all of them of course, to get the best result.

    One advantage is that you only usually need one reasonably-sized corona (generally in the middle) for it to look good, so it takes alot less time and effort.

    It is just a suggestion, I hope you don't take offence, I am not saying your work is bad, I am just saying if you added polygon lights, it would take alot less effort and still look good.

  10. No, he is right, there are more job positions for WMFS than I've listed.

    By the way, I am a bit busy, so progress might be slow or halted for a couple of days. I will try to get back onto it soon.

    EDIT: Turns out it's quite the opposite, from today progress will actually be going at a much greater rate as long as my computer works when I plug it all in now...

  11. I'm starting to get a feel for the scripting of EM4 now, so I'm now moving onto creating my own chase command out of the Move command (the one for Siren Script by Hoppah). I know how to control vectors, and how to send vehicles to given vectors now. The issue I'm having, however, is that in-game, the Move command will not work on people, despite the fact that I have added ACTOR_PERSON to the SetValidTargets. Here is my script so far:

    //**************************************************************************************************
    // #Version 2.0# ****
    // ****
    // Changes: - Disables Sirens after arriving targetpoint. ****
    // - Enables Sirens if vehicle has VCmdAutoSirenOff. ****
    // ****
    // ****
    // DO NEVER REPLACE ORIGINAL SCRIPTS USED BY EM4 IN YOUR DATA-FOLDER! ****
    //**************************************************************************************************

    const char CMD_SIREN[] = "VCmdSiren";
    const char CMD_AUTOSIREN_OFF[] = "VCmdAutoSirenOff";
    const char DUMMY_HASSIREN[] = "DummyHasSiren";
    const char DUMMY_DISABLE[] = "DummyDisableSiren";

    object MoveTo : CommandScript
    {
    MoveResult mr;

    MoveTo()
    {
    SetValidTargets( ACTOR_FLOOR | ACTOR_OBJECT | ACTOR_VIRTUAL | ACTOR_HOUSE | ACTOR_OPEN_HOUSE | ACTOR_PERSON );
    SetHighlightingEnabled(false);
    SetDeselectCaller(false);
    //SetActivationByLeftClick(true);
    }

    bool CheckPossible(GameObject *Caller)
    {

    if( Caller->GetType()==ACTOR_VEHICLE )
    {

    Vehicle v = Caller;

    if( v.GetNumPassengers() == 0 )
    return false;
    else
    return true;

    }
    else
    {

    return true;

    }

    }

    bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
    {
    mr = Commands::CheckMoveConditions(Caller, Target, childID);
    if ( mr.Mode == MOVE_ABORT )
    return false;

    return true;
    }

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

    // test variable
    Vector personpos = Target->GetPosition();

    if (mr.Mode == MOVE_ABORT)
    return;

    if( Target->GetType()==ACTOR_PERSON )
    {

    System::Log("Human target found.");

    }

    switch(mr.Mode)
    {
    case MOVE_TO_POSITION:
    {
    if (Caller->GetFirehoseID() > 0)
    {
    Caller->PushActionMoveWithHose(ACTION_NEWLIST, mr.Target);
    return;
    }
    if (Caller->GetType()==ACTOR_VEHICLE && Target->GetType()==ACTOR_PERSON)
    {
    Caller->PushActionMove(ACTION_NEWLIST, personpos, true);
    return;
    }
    Caller->PushActionMove(ACTION_NEWLIST, mr.Target, true);
    //Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_DISABLE, Caller, 2, false);
    break;
    }

    case MOVE_INTO_HOUSE:
    {
    Caller->PushActionMove(ACTION_NEWLIST, mr.Intermediate1, true);
    Caller->PushActionEnterHouse(ACTION_APPEND, &mr.EnterHouse);
    Caller->PushActionMove(ACTION_APPEND, mr.Target, true);
    break;
    }

    case MOVE_HOUSE_TO_HOUSE:
    {
    Caller->PushActionMove(ACTION_NEWLIST, mr.Intermediate1, true);
    Caller->PushActionLeaveHouse(ACTION_APPEND, &mr.LeaveHouse);
    Caller->PushActionMove(ACTION_APPEND, mr.Intermediate2, true);
    Caller->PushActionEnterHouse(ACTION_APPEND, &mr.EnterHouse);
    Caller->PushActionMove(ACTION_APPEND, mr.Target, true);
    break;
    }

    case MOVE_HOUSE_TO_POSITION:
    {
    Caller->PushActionMove(ACTION_NEWLIST, mr.Intermediate1, true);
    Caller->PushActionLeaveHouse(ACTION_APPEND, &mr.LeaveHouse);
    Caller->PushActionMove(ACTION_APPEND, mr.Target, true);
    break;
    }
    }

    if (Caller->GetType() == ACTOR_VEHICLE)
    {
    Vehicle v(Caller);
    if (v.IsLightOn())
    {
    Caller->PushActionLightOn(ACTION_INSERT, false);
    }
    if (!v.HasCommand(DUMMY_HASSIREN) && v.HasCommand(CMD_AUTOSIREN_OFF))
    {
    Game::ExecuteCommand(CMD_SIREN, &v, &v);
    }
    }

    // Special code for fgrr (Bergefahrzeug). Deinstalls itself automatically
    if (mr.UnInstall)
    {
    Vehicle v(Caller);
    if (v.GetVehicleType() == VT_THW_FGRR_BKF)
    {
    //System::Print("FGRR: Mode 1 - DeInstall");
    Caller->PushActionDeinstall(ACTION_INSERT);
    }

    else if (v.GetVehicleType() == VT_FIREFIGHTERS_DLK)
    {
    if (mr.BasketDown && mr.UnInstall)
    {
    Caller->PushActionDeinstall(ACTION_INSERT);
    Caller->PushActionBasketDown(ACTION_INSERT, Vector(0.f, 0.f, 0.f));
    }
    else if (mr.BasketDown)
    Caller->PushActionBasketDown(ACTION_INSERT, Vector(0.f, 0.f, 0.f));
    else if (mr.UnInstall)
    Caller->PushActionDeinstall(ACTION_INSERT);
    }
    }
    //Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_DISABLE, Caller, 2, false);
    }
    };

    I will be very grateful for any help :)

×
×
  • Create New...