Jump to content
Prejudice

Server side execution of the "hideobject" command

Recommended Posts

Hello, 

 

So i've been making a multiplayer mission for my friends and myself and i've run into a snag. For one of the missions I needed a way to transport vehicles via the c130j, mv-22 and Ch-47. I found an old script that worked and edited a bit (Don't worry I still gave credit to the original creator) to make is so i could fit a tank in any of the given 3 transporters. Unfortuantly these vehicles are too big and stick out the side of the aircraft while flying and it looks rather silly, I found the following line of code 

objectName hideObject true; 

This hid the given object from site once loaded in, however upon testing the mission with my friends. only the person who executes the loading command will not see the vehicle, everyone else can see the vehicle still sticking out the top. I reasearched a bit but am still unsure as to how to execute this command globally. I found this command.

_nic = [nil, mantohide, "per", rHideObject, true ] call RE;

Which looks like this in my actual script

	if ((_Transporter isKindOf "CH47_base_EP1") ) then {
	if (_Object isKindOf "Car") then {
		_object = [nil, mantohide, "per", rHideObject, true ] call RE;
			_Object attachTo [_Transporter,[0,1.5,-0.5]];
	} else {
		_Object[nil, mantohide, "per", rHideObject, true ] call RE;
		_Object attachTo [_Transporter,[0,1.4,-0.8]];
	};
	
	} else {
		_Object = [nil, mantohide, "per", rHideObject, true ];
		_Object attachTo [_Transporter,[0,1.4,-0.2]];
	};

This doesn't do anything it actually pausing the script past a certain point pretty much meaning it breaks it.

my original code using just the Hideobject looked like this, and I just replaced the objectName hideObject true;  with     _Object[nil, mantohide, "per", rHideObject, true ] call RE;

if ((_Transporter isKindOf "CH47_base_EP1") ) then {
	if (_Object isKindOf "Car") then {
		_Object hideObject true;
		_Object attachTo [_Transporter,[0,1.5,-0.5]];
	} else {
		_Object hideObject true;
		_Object attachTo [_Transporter,[0,1.4,-0.8]];
	};
	
	} else {
		_Object hideObject true;
		_Object attachTo [_Transporter,[0,1.4,-0.2]];
	};

Can anyone help and maybe suggest or tell me what im doing wrong thanks.

Share this post


Link to post
Share on other sites
1 hour ago, gc8 said:

Use https://community.bistudio.com/wiki/hideObjectGlobal

 

Oops it maybe not available on arma 2, not sure

Yes I looked in the Global Hide, that is only usable in Arma 3 editor. Im literally just stuck on how to implement the hide object to all clients, I don't know how or where to position the code in the script to make it work properly

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

This is where I found the code, they state that the HideObject will only execute on client, if you want to make it execute on server side you need to put in the following code.

_nic = [nil, mantohide, "per", rHideObject, true ] call RE;

But i have no clue as to where to position it

Share this post


Link to post
Share on other sites

@Prejudice instead of 

 

_Object hideObject true;

try

 

_nic = [nil, _Object, "per", rHideObject, true ] call RE;

in the same place

 

if it works on SP it should work on MP too...

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

×