Jump to content
pierremgi

SetObjectTextureGlobal : path in MP?

Recommended Posts

Hi all, I'm struggling with a problem of unrecognized path for custom texture.

I put a paa file in mission directory (the one with mission.sqm) and I call my own texture for an helo with setObjectTextureGlobal in the init file of the helo.

No problem in SP. All work fine!

From my eden editor, I decided to publish on steam the mission (friend yeyes) then have a test.

I open a LAN session for my 2 PCs , one hosting the scenario, one client, both subscribed for the mission.

 

I've an error message and I can't see the helo texture (no more texture on it in fact) because the path mpMission... paa is not found !

 

So my question is: How to make this custom texture visible in SP, MP, preview, hosted server, dedicated... in every cases!!!!

 

:banghead: :banghead: :banghead: :banghead: :banghead:

Share this post


Link to post
Share on other sites

What file path are you using. Post your code, cause it could be something as easy as having the correct file path

Share this post


Link to post
Share on other sites

Code is simple:

In init field of my helo:

this setObjectTextureGlobal [0,"heli_light_01_ext_gendarmerie_co.paa"]

 

IN SP, no problem.

In EDEN MP session, as far as the mission wasn't in PBO format , no problem.

 

Since I published (PBOed)  the scenario:

- in EDEN MP:

    - my host player can see  the helo texture and there is no error msg as far as he's alone;

    - receive an error msg (box) if any JIP coming: cannot load texture mpMission\__cur_mp.tanoa\heli_light_01_ext_gendarmerie_co.paa (on host)

    - the JIP client PC has this message: c:\users\.....\heli_light_01_ext_gendarmerie_co.paa where ... is the full path on the host! (not the local PC)

 

From Steam upload/downloaded mission, (out of EDEN scope)

   - my host player can see  the helo texture and there is no error msg as far as he's alone;

    - receive an error msg (box) if any JIP coming: cannot load texture mpMission\__cur_mp.tanoa\heli_light_01_ext_gendarmerie_co.paa (on host). Texture disappears.

    - the JIP client PC receive the same message now.

 

So, it's not a problem of texture,

it's not a problem of pbo or missing file (pbo has all mission files, paa included)

 

It's a matter of relative path. And probably my init field of helo runs twice: one for server, one for client.

 

I'd like to know how to match relative path (mission root) in all cases.

Share this post


Link to post
Share on other sites

So, I've haven't really dealt with JIP but it might work to try using setObjectTexture (local result) in an initServer.sqf and in an initPlayerLocal.sqf. Or potentially much better, use https://community.bistudio.com/wiki/remoteExecin initServer.sqf:

[_helo,[0,"heli_light_01_ext_gendarmerie_co.paa"]] remoteExec ["setObjectTexture", 2, true];

I'm not really sure on how people handle JIP related stuff though so hopefully someone else contributes, especially if this doesn't help.....

Share this post


Link to post
Share on other sites

Yes! Thank you very much beno. I made it work in init field (or as you wrote in intServer.sqf) with remoteExec. Just target 0 (all) instead of 2 (server) as 2 is not JIP compatible (true as last param).

So:

[my_helo,[0,"heli_light_01_ext_gendarmerie_co.paa"]] remoteExec ["setObjectTexture", 0, true]; Works fine!

 

 

.....

 

 

Now, I'm struggling for BIS_fnc_setUnitInsignia.

Same thing, works in SP, fail for path in MP (class found but not the paa file):

 

In description.ext:

class CfgUnitInsignia
{
  class GBGM
  {
    displayName = "Groupement Blindé Gendarmerie Mobile"; // Name displayed in Arsenal
    author = "Pierre MGI"; // Author displayed in Arsenal
    texture = "logoGend.paa"; // Image path
    textureVehicle = ""; // Does nothing currently, reserved for future use
  };
};

in initServer.sqf :

{
  _x spawn {
    _unit = _this;
    _uniform = uniformContainer _this;
    while {true} do {
       [[_unit,"GBGM"] , BIS_fnc_setUnitInsignia] remoteExec ["call",0,true];      // doesn't work for JIP
      // [_unit,"GBGM"] call BIS_fnc_setUnitInsignia;                                          // doesn't work for JIP 
       waitUntil {sleep 3; uniformContainer _unit != _uniform};
       _uniform = uniformContainer _unit;
    };
  }
} forEach units GBGM;

Any idea?

NB:  the loop is just for adding insignia in case of choosing another uniform.

Share this post


Link to post
Share on other sites

Good pickup on the remoteExec with 0 ;) Definitely meant to write that lol.

Unfortunately though I tried unit insignia recently and the small amount of effort i put into it didn't work, so it went down the priority list for the time being.

Share this post


Link to post
Share on other sites

Yes, found in Fx viewer. BIS_fnc_setUnitInsignia uses setObectTextureGlobal. So, there is no chance to make it work fine... at developers good will. ^_^

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

×