Jump to content
Sign in to follow this  
Tankbuster

setposATL on naval mines not broadcase to clients

Recommended Posts

Guys,

I'm creating some naval mines that the player team is to defuse.

When I made it in MP editor preview, everything went (ahem) swimmingly. :) Using createMine the mines spawn on the water surface and that's great.

But I wanted some of these mines to be submerged, so I set about using setposatl to put them just above the sea bed. Having discovered a naval mine is actually 45m tall and it's datum point is at the lower end of the tethering chain, I managed to get them to spawn on the surface, then setposatl them onto the seabed. In MP editor preview, this worked great. Mines on the surface, then they drop to the seabed.

So I got a mate in to my preview server to show how how 1337 I am, but he reported the mines spawn on the surface and remain there. I checked with another client machine on my desk joining the preview server and yes, the mines stay floating. I moved the mission to a dedi server with similar results.

After lots of really boring testing and peering at the biki, I've come to a conclusion; on naval mines, setposATL (and indeed setpos) isn't broadcast to clients. Here's the code.

if (!isServer) exitwith {hint "server runs scripts, client exits!";};
dude1 globalchat format ["makemines.sqf running!"];
sleep 1;
mc = ceil random 5;
dude1 globalchat format ["making %1 mines", mc];
sleep 1;
for [{_i=0}, {_i < mc}, {_i=_i+1}] do
{
dude1 globalchat format ["mine %1 created", _i];
mine = createMine ["UnderwaterMine", getMarkerPos "marker1", [], 8];
minepos = getPos mine;
sleep 2;
//mine setPos [(minepos select 0), (minepos select 1),(46)];
mine setPosATL [(minepos select 0), (minepos select 1),(-45+0)];
sleep 2;
};
//monitor mines
while {true} do 
{
sleep 1;
//_minelist = nearestObjects [(getmarkerpos "marker1"), "UnderwaterMine", 15]
minelist = (getmarkerpos "marker1") nearObjects ["MineBase",50];
dude1 globalchat format ["active mines %1",{mineActive _x} count minelist];
};

Before I go embarrassing myself on the feedback page, am doing something wrong? Am I expecting behaviour that isn't possible with this code, or is it a genuine bug?

Edited by Tankbuster

Share this post


Link to post
Share on other sites

Nope, that's a genuine bug.

I'm having the exact same issue

Share this post


Link to post
Share on other sites

I wonder if this is related to the flying vehicles :)

Anyone check if setpos is being broadcasted for *any* vehicle?

Share this post


Link to post
Share on other sites

yep - hey @tankbuster let us know when you write your ticket so we can upvote it!

---------- Post added at 01:45 ---------- Previous post was at 01:43 ----------

by the way - why (-45 +0)? or is that just leftover from tuning?

Share this post


Link to post
Share on other sites

The -45 is because the datum point of the mine is at the bottom of it's chain which is 45 meters long.

Share this post


Link to post
Share on other sites
The -45 is because the datum point of the mine is at the bottom of it's chain which is 45 meters long.

yes but why +0?

Share this post


Link to post
Share on other sites

As you say, tuning.

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
Sign in to follow this  

×