setObjectTextureGlobal – Talk
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) No edit summary |
Killzone Kid (talk | contribs) No edit summary |
||
Line 19: | Line 19: | ||
* You never ever ever ever ever ever put a global command into init field and then try to make it work in Multiplayer. Init filed is executed for every joining player, therefore your global command will be multiplied millions of times and no surprise it will fail eventually. This is why you have local commands for that. | * You never ever ever ever ever ever put a global command into init field and then try to make it work in Multiplayer. Init filed is executed for every joining player, therefore your global command will be multiplied millions of times and no surprise it will fail eventually. This is why you have local commands for that. | ||
* There is one exception when you can use global command in init field, you need to make sure it is executed only once, ONLY once. How do you do this? Like this: | * There is one exception when you can use global command in init field, you need to make sure it is executed only once, ONLY once. How do you do this? Like this: | ||
<code>if (local | <code>[[if]] ([[local]] this) [[then]] {this [[setObjectTextureGlobal]] [0,"mypaafile.paa"]};</code> | ||
* There is no need for remote execution of local command, when you can put local command into init field and it will do EXACTLY this, execute it everywhere and for JIP too. | * There is no need for remote execution of local command, when you can put local command into init field and it will do EXACTLY this, execute it everywhere and for JIP too. | ||
Hope I explained it well [[User:Killzone Kid|Killzone Kid]] ([[User talk:Killzone Kid|talk]]) 00:58, 28 November 2016 (CET) | Hope I explained it well [[User:Killzone Kid|Killzone Kid]] ([[User talk:Killzone Kid|talk]]) 00:58, 28 November 2016 (CET) |
Revision as of 01:05, 28 November 2016
Misleading notes from main page
- Posted on November 27, 2016 - 21:12 (UTC)
- Pierre MGI
- This command is not really JIP compatible. On Hosted server:
this setObjectTextureGlobal [0,"mypaafile.paa"]; // fails. The texture disappears and a warning message: //Cannot load texture mpmissions\__cur_mp.yourWorld\mypaafile.paa.is displayed. if (isServer) then {this setObjectTextureGlobal [0,"mypaafile.paa"]}; // only works on (hosted) server
At this time (Arma III v 1.64), it's preferable to remote the local command in the init field of the object:if (isServer) then {[this,[0,"mypaafile.paa"]] remoteExec ["setObjectTexture,0,true]}; // works for hosted server and JIP clients
Let me explain where you gone wrong.
- You never ever ever ever ever ever put a global command into init field and then try to make it work in Multiplayer. Init filed is executed for every joining player, therefore your global command will be multiplied millions of times and no surprise it will fail eventually. This is why you have local commands for that.
- There is one exception when you can use global command in init field, you need to make sure it is executed only once, ONLY once. How do you do this? Like this:
if (local this) then {this setObjectTextureGlobal [0,"mypaafile.paa"]};
- There is no need for remote execution of local command, when you can put local command into init field and it will do EXACTLY this, execute it everywhere and for JIP too.
Hope I explained it well Killzone Kid (talk) 00:58, 28 November 2016 (CET)