Jump to content

Recommended Posts

So with these new VR suits having colourable stripes I'm trying to make units have setObjectTexture applied to them and it seems to be only be local, every player can see their own avatar be the correct colour but everyone else appears with white stripes.

Right now it's set up in the same script where the unit gets their weapons and kit and the unit gets all the correct equipment when respawning.

_unit adduniform "U_B_Protagonist_VR";
_unit setObjectTexture [0,'#(rgb,8,8,3)color(1,0,0,1)'];

The following is in the init field of the unit.

[this] call compile preprocessFile "VRRED.sqf"; this  addEventHandler ["Respawn", {_this execVM "VRRED.sqf"}];

The first part is how I normally load loadout scripts for my MP missions. The second part loads the same script again but locally I guess?

Would making it run server-side do it?

If so how do I go about doing that?

Share this post


Link to post
Share on other sites

Run on the server:

_unit setObjectTextureGlobal [0,'#(rgb,8,8,3)color(1,0,0,1)'];

Share this post


Link to post
Share on other sites

I thought I was.

Not very good with MP scripting.

What's wrong in my code?

Share this post


Link to post
Share on other sites

I'm guessing that setObjectTexture has local effect, where setObjectTextureGlobal has global, net synched effect.

Share this post


Link to post
Share on other sites

Wow, actually didn't spot the added Global at the end, focused on the first part.

That's what you get for being tired.

Switched to

_unit setObjectTextureGlobal [0,'#(rgb,8,8,3)color(1,0,0,1)']

in the script but players still see eachother as white when they have respawned.

Is it the way I load the respawn gear script that's causing it?

Share this post


Link to post
Share on other sites

I'm not sure if this is causing your issue or not but; uniforms are side restricted. I.e. side WEST cannot wear side EAST uniforms, etc. Players are usually exempt from this rule but it can still cause strange issues.

Share this post


Link to post
Share on other sites
Wow, actually didn't spot the added Global at the end, focused on the first part.

That's what you get for being tired.

Switched to

_unit setObjectTextureGlobal [0,'#(rgb,8,8,3)color(1,0,0,1)']

in the script but players still see eachother as white when they have respawned.

Is it the way I load the respawn gear script that's causing it?

Put this as each unit's init in the editor.
this setObjectTextureGlobal [0,'#(rgb,8,8,3)color(1,0,0,1)'];this addMPEventhandler ["MPRespawn",{_this setObjectTextureGlobal [0,'#(rgb,8,8,3)color(1,0,0,1)'];

Share this post


Link to post
Share on other sites

Hello,
How to use this function on the laptop item?
My idea is to create a script, two images that appear in the background.

 

little apprentice in script...

Share this post


Link to post
Share on other sites
6 hours ago, ricoarma said:

Hello,
How to use this function on the laptop item?
My idea is to create a script, two images that appear in the background.

 

little apprentice in script...

 

If the laptop does have a texture you can change then you just need to use setObjectTexture on it.

_laptop setObjectTexture [0,"your/path/to/texture.paa"];

This will run locally on all those who run it. If you want to ensure all players see the same, add Global after Texture (as per example earlier in post) and ensure it only runs on server (or one client).

Share this post


Link to post
Share on other sites
On 19/02/2018 at 6:33 PM, JasonO99 said:

 

If the laptop does have a texture you can change then you just need to use setObjectTexture on it.


_laptop setObjectTexture [0,"your/path/to/texture.paa"];

This will run locally on all those who run it. If you want to ensure all players see the same, add Global after Texture (as per example earlier in post) and ensure it only runs on server (or one client).

thanks

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

×