Jump to content
Sign in to follow this  
Horrace

Ammo crate gear problem

Recommended Posts

Hi,

I have some code that executes only on the server that randomly moves ammo crates around the map every 3 - 5 minutes.

But for some reason once they've moved you can no longer access their contents.

Any ideas?

Regards,

EDIT : Looks like I can't access the crates anyway. Even if I just drop a crate in from the editor. This only happens from a Dedi server by the way.

Edited by Horrace

Share this post


Link to post
Share on other sites

I suggest you post your code. Being unable to access an ammo crate you've placed in the editor is a serious mission breaker!

=]

Share this post


Link to post
Share on other sites

Even without any code I can't access the crate but only when the mission is running on a dedicated server.

If I start a new mission from scratch in the editor and place a player soldier and a US Basic Weapon crate, no init line or anything. When I preview it I can access the weapons that come default with that crate.

If I then run the mission on a dedicated server I get no option to access the crate... The funny thing is, if I add an AI unit he will run over to the crate and crouch as if he is accessing the crate!?

Are the crate contents only registered server side?

Share this post


Link to post
Share on other sites

Not as far as I'm aware.

If the crate is placed in the editor, then a local version of the crate is created on the server and all client machines.

I'm unable to determine what might cause inaccessability to the crate on a dedi. Have you tried approaching the crate from different angles etc?

Share this post


Link to post
Share on other sites

Yeah i've tried different angles.

Can anyone confirm they have added crates and managed to access them whilst running the mission on a dedi server?

Many thanks,

Share this post


Link to post
Share on other sites

I was using a script.

Then I tried just adding weapons through the init line of the crate.

Then I just left the crate with it's standard loadout.

No luck with all of the above on a dedi. No option to access gear on the crate.

Share this post


Link to post
Share on other sites

I've tried USBasicWeaponsBox, USBasicAmmunitionBox and GuerillaCacheBox

Share this post


Link to post
Share on other sites

I dunno. What's the problem exactly? Is the create empty or can you not even access the gear menu with it?

Share this post


Link to post
Share on other sites

The problem is that I can't access the contents of a crate that i've placed in the editor when the mission is running on a dedicated server.

I get no icon to say rearm at crate or anything.

It looks like the AI can get things from the crate however because they will run over to it and crouch then get up and reload.

Share this post


Link to post
Share on other sites

Sounds like a dedicated server bug to me.

Have you tried a VERY basic test, like just one guy, one AI in the same group and the ammo crate, compile it and run it with a dedi server to replicate the problem?

Share this post


Link to post
Share on other sites

Its a multiplayer synchronicity issue.

Addition of equipment using "addweapon" and "addmagazine" is reliable LOCAL ONLY as far as I recall. That's not a bug, its been that way for a long time. You may see the equipment on other clients, but you will not be able to grab it. And if each client add's weapons and magazines it gets pretty funky and doesn't work reliably.

For weapons crates I use createVehicleLocal to create the crate locally, then populate it locally for that client. This can be done in the init.sqf.

Share this post


Link to post
Share on other sites

I thought that objects like ammo crates were already created locally on MP servers if they were present in the editor?

Can the problem not be solved by running the restocking script locally instead?

Share this post


Link to post
Share on other sites

If the are in the editor, they are synchronized objects. Using createVehicleLocal means the object is not synchronized and is ONLY local. That means that each client has their own local copy, and its contents can be different than every other one.

I presume there are plenty of scripts out there that do manage to stock crates sync'd across multiplayer, but the only reliable method I have used... is to create the crate locally, and stock it locally, not to have it a synchronized object.

Share this post


Link to post
Share on other sites

So the difference between createVehicle and createVehicleLocal is that createVehicle will propagate said object accross all MP machines? Will that be regardless of the machine it was called from?

I also found this info on the Biki for createVehicleLocal "If the object that is created is of the type ammo, then it will created on all clients (tested only on VBS2)." Does that mean it will be created on all clients if run from the server or does it not matter which machine?

MP Scripting = :confused: ;)

Share this post


Link to post
Share on other sites

I think type ammo there refers to projectiles/ordinance (bullets, grenades, rockets, missiles, objects of type CfgAmmo), which makes sense considering you don't want unsynchronized bullets and stuff (how strange would that be?). Weapons and magazines inside of ammo crates aren't objects (and thus can't be createVehicled), and ammo holders are type CfgVehicle.

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  

×