Not all 'PushAction" commands executing

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

Information: The EMERGENCY community board is completely free and is financed by advertisement. Please deactivate adblocker if you use this site. Thank you!

Attention: During the night of the 8th March a spam bot has sent spam e-mails to users of this message board. The e-mail function was disabled and the spam bots were suspended.

  • Not all 'PushAction" commands executing

    I'm trying to add some functionality to a mod, but I'm running into an Issue I can't get past.
    First of all: I'm an experienced coder, I'm not familiar with C++ though.


    So I've got the following setup:

    C Source Code

    1. void PushActions(GameObject *Caller, Actor *Target, int childID) {
    2. Vehicle myVehicle(VehicleList(Caller->GetName()).GetVehicle(0));
    3. int myVehicleID = myVehicle.GetID();
    4. PersonList myCrew(myVehicle.GetName());
    5. System::Log("Start loop");
    6. for (int i=myCrew.GetNumPersons()-1; i > -1; i--)
    7. {
    8. Person *person = myCrew.GetPerson(i);
    9. person.PushActionWait(ACTION_NEWLIST, 0.1f);
    10. person.PushActionLeaveCar(ACTION_APPEND, &myVehicle);
    11. person.PushActionExecuteCommand(ACTION_APPEND, "GetFirehose", &myVehicle, 0, false);
    12. person.PushActionWait(ACTION_APPEND, 1.0f);
    13. person.PushActionExecuteCommand(ACTION_APPEND, "AttachFireHose", Target, 0, false);
    Display All
    Odly, the person does get out of the vehicle, and does grab the firehose, but after that, he simply doesn't do anything anymore. If I manually tell him to attach the firehose to the target, it works just fine.

    Now comes the really strange part: If I take the code from GetFireHose and replace person.PushActionExecuteCommand(ACTION_APPEND, "GetFirehose", &myVehicle, 0, false); with that code, the person gets out, grabs the hose and does attach it to the target. I haven't got the slightest idea what could be causing this, does anyone else have an idea?

    To clarify, I'm utterly confused by all the different pointers and doodads that C++ uses, so it's very possible I got a & or * wrong somewhere. If someone could explain those to me in EM4 terms that would be great.

    The post was edited 1 time, last by Timmiej93: Added how I get the person variable for clarity. ().