Jump to content
Sign in to follow this  
Stirls

Is there a way of changing a texture dynamically within ArmA 3?

Recommended Posts

As part of a HALO mod, we need to create the ammo counters seen on many of the weapons. To do this, we need a way of creating this without taking up too much space or too much time. Using a series of individual planes to cycle through will really just eat up unnecessary space. Is there a way of changing a texture dynamically?

Share this post


Link to post
Share on other sites

I don't think you should use the global ones, as your ammo status and everything on the weapon only needs to be seen by you. Just put the selections and change the texture for the player only with code running on his machine. Just an idea for higher server performance.

Share this post


Link to post
Share on other sites

Apparently hidden selections don't work on weaponry. So that's a problem.

Share this post


Link to post
Share on other sites

hiddenSelections do work on weaponry, it's only that the setobjecttexture and setobjectmaterial commands do not work, because weapons are not a class cfgVehicles Object.

hiddenSelections on class cfgweapons items is limited to using the hiddenSelectionsTextures[] and hiddenSelectionsMaterials[] arrays in the config.

To do an ammo counter on weapons your best bet would probably be to do some voodoo with the revolving animation source; hiding and unhiding and the numbers on the counter in loops of sorts. It's the same source used to hide rounds in MG belts, but obviously the anim written to get digits to hide and unhide in order would be quite fiddly.

Share this post


Link to post
Share on other sites

Maybe use attachTo to attach a small object (some simple transparent square) on to the weapon and do the texturing on that?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×