Comrades in Arms Discussion Board
co06_spike_team - Printable Version

+- Comrades in Arms Discussion Board (http://forum.ciahome.net)
+-- Forum: Comrades in Arms Life (http://forum.ciahome.net/forumdisplay.php?fid=3)
+--- Forum: CiA Coop Nights (http://forum.ciahome.net/forumdisplay.php?fid=6)
+--- Thread: co06_spike_team (/showthread.php?tid=1969)



co06_spike_team - Nikiller - 01-17-2011

hi,

I get error when I JIP.

[Image: mini_365173spiketeam.jpg]

cya.

Nikiller.


Re: co06_spike_team - Nephris - 01-18-2011

I received the sam error.
And i know those "not defined variable error" by my own init files.
Although the variable is defined, but not in the init.itself.
A short sleep 0.01 did the trick for me.


Re: co06_spike_team - Nikiller - 01-18-2011

hi,

I think it is because the player doesn't exist yet before the mission is initialized then his name or the name of the group is undefined for the game engine and it create an error.

I made a little script at start of the init.sqf to prevent this problem:

init.sqf
Code:
//init.sqf proper init by Nikiller
if (isServer) then {
    if(isNil "nik_mission_init") then {
        nik_mission_init = false;
        publicVariable "nik_mission_init";
    };
} else {
    waitUntil{!isNil "nik_mission_init"};
};

processInitCommands;
//put your init stuff (i.e setViewDistance)
finishMissionInit;

if (isServer) then {
    nik_mission_init = true;
    publicVariable "nik_mission_init";
} else {
    waitUntil{nik_mission_init};
};

// init.sqf continue (i.e the BIS function module initialization)
waitUntil{!isNil "BIS_fnc_init"};

if (true) exitWith {};

Execute the briefing.sqf like this:

initjipcompatible.sqf
Code:
// proper execution of the briefing JIP compatible by Nikiller
//wait until the player exist
if (!(isNull player)) then
    {
       execVM "briefing.sqf";
    };
//for JIP players
if (!isServer && isNull player) then
    {
    waitUntil {!isNull player};

       execVM "briefing.sqf";
    };
if (true) exitWith {};

cya.

Nikiller.