setObjectTextureGlobal – Talk
Jump to navigation
Jump to search
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)