Synide – User talk

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
It correctly identifies in what context the init.sqf file is being run.
It correctly identifies in what context the init.sqf file is being run.


<code><nowiki>init_common    = compile preprocessfile "scripts\init_common.sqf";
<code><nowiki>/*
init_server    = compile preprocessfile "scripts\init_server.sqf";
        Synide
init_client    = compile preprocessfile "scripts\init_client.sqf";
        11/6/2007
init_jip      = compile preprocessfile "scripts\init_jip.sqf";
        v1.0
       
Things to note...


Context = objNull;
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 a continuing mission
and select a new playable character or the same 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.
*/
//init.sqf
debug=false;


// for use with v1.05, requires... GameLogic called 'SERVER' to be present on map.
common      = compile preprocessfile "scripts\common\init.sqf";
//isServer = call {if (local SERVER) then {true} else {false};};
mp_server    = compile preprocessfile "scripts\mp_server\init.sqf";
sp_server    = compile preprocessfile "scripts\sp_server\init.sqf";
mp_client    = compile preprocessfile "scripts\mp_client\init.sqf";
jip_client  = compile preprocessfile "scripts\jip_client\init.sqf";


if (isServer) then
if (isServer) then
Line 25: Line 39:
};
};


call init_common;
call common;


switch (Context) do
switch (Context) do
{
{
     case "MP_SERVER": {call init_server;};
     case "MP_SERVER": {call mp_server;};
      
      
     case "SP_SERVER": {call init_server; call init_client;};
     case "SP_SERVER": {call sp_server;};
      
      
     case "JIP_CLIENT": {call init_jip;};
     case "MP_CLIENT": {call mp_client;};
   
 
     case "MP_CLIENT": {call init_client;};
     case "JIP_CLIENT": {call jip_client;};
};
};
processInitCommands;
finishMissionInit;
</nowiki></code>
</nowiki></code>



Revision as of 00:15, 15 June 2007

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.

/* Synide 11/6/2007 v1.0 Things to note... 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 a continuing mission and select a new playable character or the same 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. */ //init.sqf debug=false; common = compile preprocessfile "scripts\common\init.sqf"; mp_server = compile preprocessfile "scripts\mp_server\init.sqf"; sp_server = compile preprocessfile "scripts\sp_server\init.sqf"; mp_client = compile preprocessfile "scripts\mp_client\init.sqf"; jip_client = compile preprocessfile "scripts\jip_client\init.sqf"; 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 common; switch (Context) do { case "MP_SERVER": {call mp_server;}; case "SP_SERVER": {call sp_server;}; case "MP_CLIENT": {call mp_client;}; case "JIP_CLIENT": {call jip_client;}; }; processInitCommands; finishMissionInit;

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.