Jump to content

anto.fra88

Members
  • Posts

    104
  • Joined

  • Last visited

Posts posted by anto.fra88

  1. I've been playing with some of the LA Mod scripts in order to set up a "sub station" in another part of the freeplay map. The issue I'm having is within the "ToFireStation" script by Hoppah, though I've heavily modified it for use at this sub station. At one point, I had it working except that once the truck returned to the sub station, it turned around and headed for the main station. I believe I fixed it, but now I get a "Parenthesis does not match" error and I can't figure it out. It gives my LINE 177 which is the closing brackets at the end of this block of code:


    object DummyCheckParkedSub : CommandScript
    {
    DummyCheckParkedSub()
    {
    SetGroupID(DummyGroup);
    }

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

    void PushActions(GameObject *Caller, Actor *Target, int ChildID)
    {
    bool ParkinglotFound = false;

    Vehicle v(Caller);
    if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 0)
    {
    GameObjectList l3;
    Game::CollectObstaclesOnVirtualObject(VO_ENGINE05, l3, ACTOR_VEHICLE);
    if(l3.GetNumObjects() > 0)
    {
    Mission::PlayHint(HINT_NOSPACE);
    v.PushActionReturnToBase(ACTION_NEWLIST);
    return;
    } else
    {
    ParkinglotFound = true;
    ActorList l1 = Game::GetActors(VO_ENGINE05);
    v.AssignCommand(DUMMY_ENGINE);
    }
    }

    if(ParkinglotFound)
    {
    if(l1.GetNumActors() > 0)
    Vector Park = l1.GetActor(0)->GetPosition();
    if (v.HasCommand(DUMMY_VCALLED))
    v.RemoveCommand(DUMMY_VCALLED);
    if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02)
    {
    v.PushActionWait(ACTION_APPEND, 10.0f);
    v.PushActionMove(ACTION_APPEND, Park);
    v.PushActionWait(ACTION_APPEND, 0.5f);
    PersonList passengers = v.GetPassengers();
    if (passengers.GetNumPersons() > 0)
    v.PushActionExecuteCommand(ACTION_APPEND, DUMMY_SUBSTATION, Caller, 0, false);
    }
    }
    }
    };

    I figured since this doesn't seem to be specific to the code itself but rather a syntax error, someone could help? I've checked and double checked all the brackets and parenthesis, but I can't figure it out. And like I said, this code is credited to Hoppah and his LA Mod. I simply modified it for my personal use.

    see if it do :)

    object DummyCheckParkedSub : CommandScript
    {
    DummyCheckParkedSub()
    {
    SetGroupID(DummyGroup);
    }

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

    void PushActions(GameObject *Caller, Actor *Target, int ChildID)
    {
    bool ParkinglotFound = false;

    Vehicle v(Caller);
    if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 0)
    {
    GameObjectList l3;
    Game::CollectObstaclesOnVirtualObject(VO_ENGINE05, l3, ACTOR_VEHICLE);
    if(l3.GetNumObjects() > 0)
    {
    Mission::PlayHint(HINT_NOSPACE);
    v.PushActionReturnToBase(ACTION_NEWLIST);
    return;
    }
    else
    {
    ParkinglotFound = true;
    ActorList l1 = Game::GetActors(VO_ENGINE05);
    v.AssignCommand(DUMMY_ENGINE);
    }
    }

    if(ParkinglotFound)
    {
    if(l1.GetNumActors() > 0)
    Vector Park = l1.GetActor(0)->GetPosition();
    if (v.HasCommand(DUMMY_VCALLED))
    v.RemoveCommand(DUMMY_VCALLED);
    if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02)
    {
    v.PushActionWait(ACTION_APPEND, 10.0f);
    v.PushActionMove(ACTION_APPEND, Park);
    v.PushActionWait(ACTION_APPEND, 0.5f);
    PersonList passengers = v.GetPassengers();
    if (passengers.GetNumPersons() > 0)
    v.PushActionExecuteCommand(ACTION_APPEND, DUMMY_SUBSTATION, Caller, 0, false);
    }
    }
    };

  2. I learned it myself, I bet I am not the only one who can. :)

    How? By comparing my work to other work alot and trying things out.

    And, of course, starting with basics, easier things.

    People who want to immediatly build a script for a fire station will never learn C++ with that state of mind.

    And having patience is the key to it.

    How long have you made to learn all c++? :)

  3. Are there any other modelling programs, other than Zmodel, that I can use to make vehicles? And where are the best sites to learn C++. I want to make some Mods, but i dont know where to start. Thanks

    c++ is not easy to learn and it takes time you must first learn the basic functions and after the object-oriented programming that is the most complex, however, the scripting language is inherited from c++. :)

    I'm a programmer c++ and c#, if you need help send me a pm :)

  4. Yeah, I know, it's all about trial and error. There are nearly 0 sources to learn from.

    You just have to use what you know.

    Yes, you are right.

    I was seeing the script of the arrest hoppah, want that the gangster lies down on the ground when the officer points him with the gun instead of he kneels.

  5. It should be pretty easy for you when you know the languages you mentioned.

    There is no tutorial (yet) for scripting, I am working on one.

    Until then, you'll have to learn from the existing scripts, preferably the LA mod ones.

    yes, there are functions that are not in the script but in the game and in the script are called.

    I just do not understand that for the rest of the script I understand everything.

×
×
  • Create New...