Synide – User talk
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> | <code><nowiki>/* | ||
Synide | |||
11/6/2007 | |||
v1.0 | |||
Things to note... | |||
Context = | 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 | if (isServer) then | ||
Line 25: | Line 39: | ||
}; | }; | ||
call | call common; | ||
switch (Context) do | switch (Context) do | ||
{ | { | ||
case "MP_SERVER": {call | case "MP_SERVER": {call mp_server;}; | ||
case "SP_SERVER": {call | case "SP_SERVER": {call sp_server;}; | ||
case " | case "MP_CLIENT": {call mp_client;}; | ||
case " | 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.