Jump to content
gogus12

[Scripting] Issues with destoying buidlings in MP

Recommended Posts

Hi,

I've been trying to do this for a while and I can't seem to get it right.

 

It is quite simple, it is a function that destoys a certain part of the buidlings in a array of buildings. 

 

params["_houses","_amount"];

private _number = (count _houses) * _amount;

for [{private _i = 0}, {_i < _number}, {_i = _i + 1}] do {
	(_houses select _i) setdamage [1, false];
};

It works in SP without issues, however in multiplayer weird stuff starts happening. It will work as intended for some players, but other with see both the wrecked building and the original building, most of the time flickering. 

I thought it was a JIP issue, and it probably is.

But I've read a lot a posts and the wiki about a dozen of times and setDamage is global, and should work with the JIP queue (as said here http://killzonekid.com/arma-scripting-tutorials-scripted-charges-v2/ at the end)

And I trust bohemia with what they do, it usually works. So I guess I am missing something

 

I could just do everything with a remoteExec[0,true] but that seems a little brutal and will generate a lot of unecessary traffic, I would rather not include that feature if that is the only solution.

i could also store the buidlings somewhere and destoyThem whenever someone enters the server, it is less worse than the remoteExec but it still is a bit nasty since their is no local version of setDamage.

 

So the question is, has anyone ever managed to do that in a "performance friendly" way?  
Thank you for your time :)

Share this post


Link to post
Share on other sites

Thanks for the answer, I'll try that

Is it not going to generate a lot of traffic when a player connects since the command is global? Because essentially it is the same thing as remoteExec[0,true]

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

×