Pausing OPCOM error.

  1. 8 years ago

    The error is quite lengthy on the server, however it seems to boil down to this.

    init.sqf segment:

    waitUntil {!isNil "ALIVE_profileSystemInit"};
    ["ALIVE_MIL_OPCOM","ALIVE_MIL_C2ISTAR"] call ALiVE_fnc_PauseModule;

    That then gives me this error, which looks like a typo possibly?

    if (typeName _mainClass == "STRING") then {_mainclass>
    10:22:14   Error position: <_mainClass == "STRING") then {_mainclass>
    10:22:14   Error Undefined variable in expression: _mainclass
    10:22:14 File x\alive\addons\main\fnc_pauseModule.sqf, line 44
  2. Edited 8 years ago by SpyderBlack723

    Ok, just setup a simple repro mission and I could get it to work via an addAction that would pause the modules and then allow you to unpause the modules. That worked flawlessly so I guess the problem may still lie with it being called too early.

    Edit: Tried that init.sqf code in my mission and I can get the debug message saying that the module is paused
    "ALiVE Pausing state of .... instance set to true"
    However, it does not actually pause the modules. OPCOM then shoots out orders 20 seconds later and I am tasked by C2ISTAR. I can only get that error you posted with this method, the addAction method works without any error. Only thought is we need a variable farther down the initialization list for ALiVE modules to use with waitUntil before beginning to execute the pausing since _mainClass might remain undefined.

  3. Edited 8 years ago by SpyderBlack723

    Alright, got it working using this in my init.sqf

    waituntil {player == player};
    sleep 2;
    ["ALIVE_MIL_OPCOM","ALIVE_MIL_C2ISTAR"] call ALiVE_fnc_PauseModule;

    Using only waituntil {player == player}; wasn't working so I added a small sleep command to it and it seemed to pause everything as soon as I spawned in. The amount of time you might need to put on the sleep command might vary from mission to mission based on loading times but I'm not sure. If anyone can get it worked using only a waitUntil without a sleep command after it, it would be very helpful.

    Edit 1: This init.sqf code seemed to work for the mission you sent me as well. Let me know if you have any problems with it.

    Edit 2: I am actually noticing C2ISTAR proceeds to task me even if it is paused. I am not sure if pausing ALIVE_MIL_C2ISTAR only stops battlefield intelligence from being displayed or if it is supposed to stop tasking as well.

    Edit 3: Perhaps ALIVE_MIL_C2ISTAR is unable to be paused. ALIVE_MIL_OPCOM and ALiVE_SYS_PROFILE both display a debug message when paused but ALIVE_MIL_C2ISTAR doesn't when attempting to pause it. How far will the edit tree go?

  4. I've actually rewritten a lot of that mission based on what I know now ;)

    I am still keen to know how to do this however as I'm a fan of intro's ;)

 

or Sign Up to reply!