Jump to content
Herr_Pinkman

Multiplayer script question on SetPos

Recommended Posts

Hi all,

 

the following code snipset is working well wihtin a local mission but not on a dedicated server.

Assuming i may need to use global or even public variables instead of local ?

 

As far as i understood the door should move but only be visible to me if I am using local variables, but even for me its not moving on MP.

As mentioned in local mission all is working as expected.

 

Would be great to receive the confirmation and a litlle hint. Code as below:

//Opening door if player left early stop opening door
for "_i" from 1 to 100 do 
  {
  scopeName "opendoor";
  	if ((_player distance player) < 2)  then 
		{
		_y =_i;
		_myglassposx = _myglassposx + 0.02;
		_mytextureposx = _mytextureposx + 0.02;
		diag_log ["DBGLog: Window position:", _myglassposx, _myglassposy, _myglassposz];
		_glass setPos [_myglassposx, _myglassposy, _myglassposz];
		_texture setPos [_mytextureposx, _mytextureposy, _mytextureposz];
		_playerleft = false;
		}
	else
		{
		_playerleft = true;
		_texture setObjectTexture [0,"images\PD2_doorlock_red.paa"];
		breakOut "opendoor";
		};
  sleep 0.01;
  };

The glass windows is not moving in MP, but on local mission ist working perfectly. Even within the .RPT log all is showing fine as per snip below:

21:59:07 ["DBGLog: Window position:",66bccf00# 607850: glass_250_0025_300.p3d REMOTE]
21:59:07 ["DBGLog: Window position:",906.251,476.583,0.000236511]
21:59:07 ["DBGLog: Window position:",906.271,476.583,0.000236511]
21:59:07 ["DBGLog: Window position:",906.291,476.583,0.000236511]
21:59:07 ["DBGLog: Window position:",906.311,476.583,0.000236511]
21:59:07 ["DBGLog: Window position:",906.331,476.583,0.000236511]

Appreciate some hints to point me to the right direction.

Many thanks in advance.

Share this post


Link to post
Share on other sites

Without having the time to test it right now, I'd say your "images" folder needs to be on the same side (client resp. server) where this script is executed. If you execute this script on the server while the "images" folder is in the mission, this won't work. Assumingly not the other way round either.

 

If that's complete nonsense, it might be because I'm tired...

 

Try this:

https://community.bistudio.com/wiki/setObjectTextureGlobal

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

×