Jump to content
maxjoiner

"setObjectTextureGlobal" doesn't work

Recommended Posts

Hi all,

does someone know why the command "setObjectTextureGlobal" doesn't work? 😰

It's a little time I try to fix it but It seems unusable 😖

 

 

Share this post


Link to post
Share on other sites

Do you have an error?

Do you run it from one PC only?  The "Global" command doesn't like to be fired from everywhere. arguments_global.gifeffects_global.gif... yes, but keep it local. Server only is the best place, most of the cases.

Did you try with setObjectMaterialGlobal as shown in notes?

Share this post


Link to post
Share on other sites

No Error

I tried in local and in MP game

I also tried to add "setObjectMaterialGlobal" as shown in notes

Nothing It doesn't work 😭

 

Share this post


Link to post
Share on other sites

Next obvious phase: do you have a reproducible scenario, or at least a code? Because "doesn't work" is vague.

  • Like 1

Share this post


Link to post
Share on other sites
  private["_D"];

	_D = _this select 0;
	
	while {alive _D} do {

	if (speed _D == 0) then {
			_D setObjectMaterialGlobal [0,"\a3\data_f\default.rvmat"];
		    _D setObjectTextureGlobal [0,"zombie\zdog\zdog_co.paa"];
			_D setObjectTextureGlobal [1,""];
			_D setObjectTextureGlobal [2,""];
			_D setObjectTextureGlobal [4,""];
			_D setObjectTextureGlobal [5,""];
			_D setObjectTextureGlobal [6,""];
			_D setObjectTextureGlobal [7,""];
			_D setObjectTextureGlobal [9,""];
			_D setObjectTextureGlobal [10,""];			
			};
	if (speed _D > 10 && !(_D getvariable ["JUMP", false])) then {

	_D setObjectTextureGlobal [0,""];
	_D setObjectTextureGlobal [6,""];	
	_D setObjectTextureGlobal [4,""];	
	_D setObjectTextureGlobal [7,""];	
	_D setObjectTextureGlobal [5,"zombie\zdog\zdog_co.paa"];
	_D setObjectMaterialGlobal [5,"\a3\data_f\default.rvmat"];
	sleep 0.15;

	_D setObjectTextureGlobal [6,""];	
	_D setObjectTextureGlobal [5,""];		
	_D setObjectTextureGlobal [7,"zombie\zdog\zdog_co.paa"];
	_D setObjectMaterialGlobal [7,"\a3\data_f\default.rvmat"];
	sleep 0.15;
	};
	
	if (speed _D < 10 && speed _D > 0 && !(_D getvariable ["JUMP", false])) then {

	_D setObjectTextureGlobal [0,""];
	_D setObjectTextureGlobal [4,""];	
	_D setObjectTextureGlobal [7,""];
	_D setObjectTextureGlobal [6,""];	
	_D setObjectTextureGlobal [2,"zombie\zdog\zdog_co.paa"];
	_D setObjectMaterialGlobal [2,"\a3\data_f\default.rvmat"];
	sleep 0.2;

	_D setObjectTextureGlobal [2,""];
	_D setObjectTextureGlobal [6,""];	
	_D setObjectTextureGlobal [9,"zombie\zdog\zdog_co.paa"];
	_D setObjectMaterialGlobal [9,"\a3\data_f\default.rvmat"];
	sleep 0.2;

	_D setObjectTextureGlobal [9,""];
	_D setObjectTextureGlobal [6,""];		
	_D setObjectTextureGlobal [1,"zombie\zdog\zdog_co.paa"];
	_D setObjectMaterialGlobal [1, "\a3\data_f\default.rvmat"];
	sleep 0.2;

	_D setObjectTextureGlobal [1,""];
	_D setObjectTextureGlobal [6,""];		
	_D setObjectTextureGlobal [4,"zombie\zdog\zdog_co.paa"];
	_D setObjectMaterialGlobal [4,"\a3\data_f\default.rvmat"];
	sleep 0.2;
	};
		
		sleep 0.1;	
		  };

		  	_D setObjectTextureGlobal [0,""];
			_D setObjectTextureGlobal [1,""];
			_D setObjectTextureGlobal [2,""];
			_D setObjectTextureGlobal [4,""];
			_D setObjectTextureGlobal [5,""];
			_D setObjectTextureGlobal [6,""];
			_D setObjectTextureGlobal [7,""];
			_D setObjectTextureGlobal [9,""];
			_D setObjectTextureGlobal [10,"zombie\zdog\zdogd_co.paa"];	
			_D setObjectMaterialGlobal [10,"\a3\data_f\default.rvmat"];
		


					 			   

Here is the code 🙄

Share this post


Link to post
Share on other sites

OK, let's say this code runs only where _D is defined (and probably created) , so not a code running everywhere (called from init.sqf as example),

in other words, I suggest you to wrap the code with:

if (local _D) then {...

first of all, apply the material (if necessary) before the texture.

Then :

check the selection numbers.

check the path: "zombie\zdog\zdogd_co.paa"  should be: "\yourMod\....\zdog_co.paa" where \yourMod is the root directory of your addon.

 

Share this post


Link to post
Share on other sites

Thanks for Your Help I appreciated but I already had tried also all that tests....😩

I think Bohemia has changed something with the last Updates

  • Like 1

Share this post


Link to post
Share on other sites

In the end, I fixed with the old:

Setobjecttexture

I had to use an MP function.

The problem is I used very much the command "SetobjecttextureGlobal " in my scripts/Functions into my mods,

now I have to fix all of them.
So SetobjecttextureGlobal (At least for me) doesn't work it's a broken command.

I hope Bohemia doesn't release another update Command Killer!

Share this post


Link to post
Share on other sites

setObjectTextureGlobal  must run just locally. From server   (isServer condition),   or from local PC where the object is   (local _object  condition).

 

setObjectTexture is fine because there is no need to broadcast anything, as far as the code runs on all PCs.

 

A second point, not very clear imho, and I didn't read any real solution, is that for custom textures:

All textures from pboed addon can easily work (config.cpp or included hpp is fine for folder paths) On the other, that can fails for shared scenario in MP running only with description.ext and texture folder (different relative paths perhaps?). This kind of topic has few devs' explanation.

Share this post


Link to post
Share on other sites

Mate, I'm a modder until 2005 Operation flashpoint era, so If I say there is a problem with that command, surely I didn't drink my brain.

What's not clear?!

I said I tried all your suggestions, I posted also my script.

The real solution is to use Setobjecttexture with a MP function to broadcast the textures in all the clients.

We can talk on the theory about the SetobjecttextureGlobal to the infinite but practically it for me doesn't work.

Share this post


Link to post
Share on other sites
14 minutes ago, maxjoiner said:

Mate, I'm a modder until 2005 Operation flashpoint era, so If I say there is a problem with that command, surely I didn't drink my brain.

What's not clear?!

I said I tried all your suggestions, I posted also my script.

The real solution is to use Setobjecttexture with a MP function to broadcast the textures in all the clients.

We can talk on the theory about the SetobjecttextureGlobal to the infinite but practically it for me doesn't work.


And?

- you're on a forum, and not in a private place, even if you started the topic. Be ready for discussions;

- the title is excessive, but, if you can reproduce a bug (without missing some recommendation from BIKI), the good practice is to write or implement a feedback ticket;

- on the other hand, the setObjectTextureGlobal is not a broken command. I'm using it, in my MGI Respawn Vehicle module which work in MP as well, for textures precisely. Here, you can  find a light scripted version.

- the setObjectTexture is not mandatory to be remote executed if the code runs on each PC (see very basic example 4). Remote exec it, only if you need to run this command locally, for broadcast the result;

- I hope I added some good remarks  or tracks for future readers. Your solution works but that doesn't mean we can't dig into these two commands a little bit.

 

 

  • Like 2

Share this post


Link to post
Share on other sites

Only one thing I want to clear...

My scripts/Functions before the Last Update worked fine, I didn't change anything, so without a doubt, It's logical to think Bohemia has changed something,

I repeat, for me, the command "SetObjecttextureGlobal" doesn't work like before the Update.

I will change not the Discussion Title.

Thanks for your suggestions

Share this post


Link to post
Share on other sites
11 hours ago, maxjoiner said:

My scripts/Functions before the Last Update worked fine, I didn't change anything, so without a doubt, It's logical to think Bohemia has changed something,

I repeat, for me, the command "SetObjecttextureGlobal" doesn't work like before the Update.

 

As said, my script, and  addon (10,000+ subscribers) are working as usual, using setObjectTextureGlobal, even if you didn't test them by your own....

But, on the contrary of you, a doubt stays permitted. So, if you have time, do not hesitate to open a feedback ticket with step by step reproducible bug.

  • Like 1

Share this post


Link to post
Share on other sites

....

Edited by Twiznak
I don't know enough to help, but I still want to. So I wrote basic information that in hindsight, I am sure you already knew. Sorry.

Share this post


Link to post
Share on other sites
Quote

is fixed in internal will be able to use empty texture again with next update

Quote

no need to do anything, next hotfix should fix it

I dont believe we have had a hotfix since 2.00 yet?

Share this post


Link to post
Share on other sites

@Larrow Thank You, very appreciated!, Your post demonstrated I right

@Twiznak Thanks for your interest and don't worry every help is welcome.

@pierremgi I'm very surprised to see your post:

https://forums.bohemia.net/forums/topic/231239-setobjecttextureglobal-not-working-after-update-20/?do=findComment&comment=3420741

into the discussion "setObjectTextureGlobal not working after update 2.0",

but mate if You knew of the Bug why didn't You say before?!

And without to do polemics, also my Addons/Mods (30,000+ subscribers) work partially using setObjectTextureGlobal,

but the bug exists and doesn't let to work at 100% with that command.

 

Share this post


Link to post
Share on other sites

I forgot this (old) point. And as no impact on my work, I doubted of your code as you didn't uploaded it in integrality. And perhaps, there are some conditions for experiencing the bug or not (custom textures, specific textures...). That's why the forum is fine. And without polemic, your title pushed me in a wrong way. I focused on the absolute systematic issue for nuts.

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

×