Jump to content
Sign in to follow this  
Impavido

Setpos not working on client

Recommended Posts

Just a thought, but if your executing createVehicle on every client and server, everyone who JIP's. Won't that create multiple copies of the same object on all the clients and server?

If it's doesn't lag then I guess it's not a problem, but might be worth considering. You might be able to get away with adding locality checks, so you only create them on the server.

You don't need to execute the createvehicle. Just the init line has to be set and when they JIP it will update the object. Really you want it created on the server so it is in sync. Other wise you get some funky results and other players cannot see your cool buildings. smile_o.gif

Oh yeah, forgot to add that this information is downloaded at the start and shows a neat green process bar saying receiving

data so there inst really any lag created.

On another note, why can't the server and client stay in sync. I have floating items now on some clients and not others. Whaaa, i give up. Putting my buildings up and making them so no one can blow them up until it's fixed.

Share this post


Link to post
Share on other sites
Quote[/b] ]You don't need to execute the createvehicle. Just the init line has to be set and when they JIP it will update the object. Really you want it created on the server so it is in sync. Other wise you get some funky results and other players cannot see your cool buildings.

Just to clarify things, what code are we talking about. The lines you originally posted?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_bldg = createvehicle ["Land_hospoda_mesto",[12231.96,17612.2,0],[],0,"FORM"];

_bldg setVehicleInit "this setdir 225;this setpos [12231.96,17612.2,0];";

Those had no effect that I could see, but I can only test certain mission types with one client.

Or the script HitmanFF posted?

HitmanFF's script certainly creates duplicate objects. One for the server and one for the person that started the persistent battlefield. One of the objects was set at the correct height, the other wasn't. Also one was remote and the other was classed as local to my client.

BTW I used this to double check the number of crates, just in case they are created on top of each other:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Player SideChat Format ["List %1",nearestObjects [GL01, [],20]]

GL01 is just a game logic positioned near the ammo crates.

If I quit out and rejoined using JIP. I could only see one Ammo crate (probably two stacked) and that was sat on the ground, not at the specified height. The nearest object command returned two Ammo crates, this time both were classed as remote. I expected three crates with the addition of JIP, I need to do some more tests.

That said, I'm running the Arma server exe on the same PC I'm running the game exe. That’s why I have to use a persistent battlefield if I want to check JIP. So I can't say for sure what will happen under a different setup.

BTW I did a check for locality with:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">If (Local Server) Then {[this, 0.95] execVM "setposz.sqs"}

Then only one Ammo box was created, but that remained at ground level. Which I half expected anyway.

Quote[/b] ]Oh yeah, forgot to add that this information is downloaded at the start and shows a neat green process bar saying receiving

data so there inst really any lag created.

The lag that worries me with the above scripts in say a 40 player MP game is, 39 extra objects for every one object placed my the mission designer, if that turns out to be the case.

Quote[/b] ]On another note, why can't the server and client stay in sync. I have floating items now on some clients and not others.

I think it's because some objects are local to the clients and others the server. But like I said, I can't test it with multiple clients so it's only a guess.

Share this post


Link to post
Share on other sites

Oh i miss understood laugh. I was thinking just the init line. Smack me with a wet chicken. Grin.

I am now having issues with set damage as it does not transfer over the network. Guess the static objects might be local or something. Cause my guy runs off and repairs a phone pole. Opps other pc connected to the dedicated server cant see the change. gurrrr does nothing work in multi or is it just the dedicated 1.05?

Share this post


Link to post
Share on other sites
I think it's because some objects are local to the clients and others the server. But like I said, I can't test it with multiple clients so it's only a guess.

Looks like you're spot on. Seems the setpos still isn't transmitted, so only locally created objects are being setpos'd. In my case it's good enough, since it only concerns static sandbags, but it's not good enough e.g. for buildings that need to keep a consistent state for all clients

I'll test some more to confirm with two (or more) clients later tonight.

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  

×