setObjectTextureGlobal – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
 
No edit summary
Line 16: Line 16:
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- DISCONTINUE Notes -->
:: Let me explain where you gone wrong.
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 unit, 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 unit, 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 ones, 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 ones, ONLY once. How do you do this? Like this:
<code>if (local this)_ then {this setObjectTextureGlobal [0,"mypaafile.paa"]};</code>
<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:58, 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 unit, 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 ones, 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)