Synide – User talk
The following is temporary...
This is my init.sqf file I use in all my missions. It correctly identifies in what context the init.sqf file is being run.
init_common = compile preprocessfile "scripts\init_common.sqf";
init_server = compile preprocessfile "scripts\init_server.sqf";
init_client = compile preprocessfile "scripts\init_client.sqf";
init_jip = compile preprocessfile "scripts\init_jip.sqf";
Context = objNull;
// for use with v1.05, requires... GameLogic called 'SERVER' to be present on map.
//isServer = call {if (local SERVER) then {true} else {false};};
if (isServer) then
{
Context = "SP_SERVER";
if (isnull player) then {Context = "MP_SERVER";};
}
else
{
Context = "MP_CLIENT";
if (isnull player) then {Context = "JIP_CLIENT";};
};
call init_common;
switch (Context) do
{
case "MP_SERVER": {call init_server;};
case "SP_SERVER": {call init_server; call init_client;};
case "JIP_CLIENT": {call init_jip;};
case "MP_CLIENT": {call init_client;};
};
Things to note about the above for MP only.
- If you are there at mission launch from that point on your 'Context' will always be 'MP_CLIENT' and will stay as such even when you respawn.
- If you are an 'MP_CLIENT' then you 'disconnect' from the continuing mission and select a new playable character you will become a 'JIP_CLIENT'.
- If you join an inprogress mission you will be a 'JIP_CLIENT' from that point till the mission ends.