setObjectTextureGlobal: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame( +[0-9])?|Game [Vv]ersion( +[0-9])?|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|MP[Aa]rg|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects...) |
||
Line 7: | Line 7: | ||
|eff= global | |eff= global | ||
|gr1= Object Manipulation | |gr1= Object Manipulation | ||
|descr= Set the texture of the given selection on all computers in a network session.<br> | |descr= Set the texture of the given selection on all computers in a network session.<br> |
Revision as of 11:09, 18 January 2021
Description
- Description:
- Set the texture of the given selection on all computers in a network session.
Not all objects can be textured this way. See getObjectTextures for supported texture selections. - Multiplayer:
- The effect is JIP compatible.
- Problems:
- If executed from a vehicle's init field (going against the above note), execution may happen too early and fail to broadcast over the network and to be JIP compatible.
- Groups:
- Object Manipulation
Syntax
- Syntax:
- obj setObjectTextureGlobal [selection, texture]
- Parameters:
- obj: Object
- [selection,texture]: Array
- selection: Number
- texture: String
- Return Value:
- Nothing
Examples
- Example 1:
player setObjectTextureGlobal [0, "\MyAddon\blue.paa"];
- Example 2:
// Set up a persistent texture keeper player addEventHandler ["Take", { (getObjectTextures player + [uniformContainer player getVariable "texture"]) params ["_texUniform", "_texInsignia", "_texCustom"]; if (isNil "_texCustom") exitWith {}; if (_texUniform == _texCustom) exitWith {}; player setObjectTextureGlobal [0, _texCustom]; false }]; // Example: make current uniform persistently blue private _texture = "#(rgb,8,8,3)color(0,0,1,1)"; // blue texture player setObjectTextureGlobal [0, _texture]; // set it on player uniformContainer player setVariable ["texture", _texture, true]; // store it on uniform
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Notes
- Posted on December 29, 2015 - 18:13 (UTC)
- Elch2070
- In some cases the ".paa" files do not work. Instead you can try ".jpg" files.
- Posted on October 24, 2016 - 12:13 (UTC)
- Killzone Kid
- Sometimes it could be necessary to set default material on an object for the texture to take effect:
private _block = createVehicle ["Land_VR_Block_02_F", player getPos [20, getDir player], [], 0, "CAN_COLLIDE"]; _block setObjectMaterialGlobal [0, "\a3\data_f\default.rvmat"]; _block setObjectTextureGlobal [0, "#(rgb,8,8,3)color(1,0,0,1)"];
Courtesy of Larrow