Heigou 10 Posted July 28, 2012 So, basically, I made custom scripts to fill boxes and crates with various shits. Only problem here is, once I host it online, my friends don't see anything that's in the crate. I can see everything in the crates fine but all my friends see is like a few basic snipers and nothing else in all of the crates. Basically, it's like the .sqf files I have included in the map don't sync up to anybody except for me. Share this post Link to post Share on other sites
clydefrog 3 Posted July 28, 2012 So, basically, I made custom scripts to fill boxes and crates with various shits.Only problem here is, once I host it online, my friends don't see anything that's in the crate. I can see everything in the crates fine but all my friends see is like a few basic snipers and nothing else in all of the crates. Basically, it's like the .sqf files I have included in the map don't sync up to anybody except for me. I don't know but I'd recommend the Fill Ammo Box script. Share this post Link to post Share on other sites
mikie boy 18 Posted July 28, 2012 its a locality issue - make sure you are using the addWeaponCargoglobal - may have to make the create locally for each player Share this post Link to post Share on other sites
Muzzleflash 111 Posted July 28, 2012 (edited) There is only a couple of ways to properly make MP and JIP proper ammo boxes. You cannot use the non-global commands for it. The only reason people don't notice is because a typical ammo scripts fills up the box with enormous amounts of stuff and refills very often. The general template that I would recommend is the following: if (!isServer) exitWith {}; _box = _this select 0; _delay = if (count _this > 1) then {_this select 1} else {3600}; while {!isNull _box} do { clearWeaponCargoGlobal _box; clearMagazineCargoGlobal _box; //Add stuff using // addWeaponCargoGlobal // addMagazineCargoGlobal //instead of the non-global commands //E.g. _box addWeaponCargoGlobal ["Binocular", 5]; _box addMagazineCargoGlobal ["HandGrenade_west", 10]; //wait and refill sleep _delay; }; This puts the server in charge of the ammo boxes and everything changed is synced with everybody else. Edited July 28, 2012 by Muzzleflash Share this post Link to post Share on other sites
clydefrog 3 Posted July 28, 2012 There is only a couple of ways to properly make MP and JIP proper ammo boxes. You cannot use the non-global commands for it. The only reason people don't notice is because a typical ammo scripts fills up the box with enormous amounts of stuff and refills very often.The general template that I would recommend is the following: if (!isServer) exitWith {}; _box = _this select 0; _delay = if (count _this > 1) then {_this select 1} else {3600}; while {!isNull _box} do { clearWeaponCargoGlobal _box; clearMagazineCargoGlobal _box; //Add stuff using // addWeaponCargoGlobal // addMagazineCargoGlobal //instead of the non-global commands //E.g. _box addWeaponCargoGlobal ["Binocular", 5]; _box addMagazineCargoGlobal ["HandGrenade_west", 10]; //wait and refill sleep _delay; }; This puts the server in charge of the ammo boxes and everything changed is synced with everybody else. I don't really get that, I've played coop insurgency missions that use the fillammobox script and it works properaly for everybody e.g. i unloaded my medic bag into it which made it the only bag in the box, but other people saw it in there. Thanks for that script anyways. Share this post Link to post Share on other sites
Muzzleflash 111 Posted July 28, 2012 I don't really get that, I've played coop insurgency missions that use the fillammobox script and it works properaly for everybody e.g. i unloaded my medic bag into it which made it the only bag in the box, but other people saw it in there.Thanks for that script anyways. All boxes works fine when you interact with them ingame. It is not the interacting with crates that cause issues. It is addWeaponCargo and addMagazineCargo (the non-global variants) that are practically impossible to work correct. The reason you may not have seens problems with it is if it load quite a bit of stuff into the crate and has a low refill time. Let say you have players, Abe, Bo, Charlie playing on server Sierra, and you run the ammo scripts from the init line, and the ammo scripts uses the non global variants: 1. Sierra (the server) runs the ammo script. The ammo script removes all stuff and and then adds some stuff. Let's say 2 GPS'es. So now the server thinks there are 2 GPS'es in the box. 2. Abe joined with the server (he was in the lobby when the game started). The script runs for him too - so he thinks there are 2 GPS'es in the box too. He takes one of the GPS'es. Now as said interacting with crates directly works fine. So now the server thinks there are 1 GPS in the box and Abe thinks there are 1 GPS in the box. 3. Now Bo joins in progress (JIP). When he gets in the game his machine runs the init scripts. Now since the scripting commands used in the box are not global it only affects his view. So the ammo box removes everything (locally) and add the stuff. What happens is that the scripting commands "forces" his machine to think there are 2 GPS in the box. But both Sierra and Abe only thinks there are 1. He picks up a GPS from the box, since the server thinks there still is 1 GPS it allows him to do so. So now Sierra and Abe thinks there are 0 GPS'es in the box whilst Bo thinks there are 1. 4. Now Charlie joins the server (also JIP). Again the script forces him to think there are 2 GPS in the box. So Sierra and Abe thinks there are 0 GPS'es left, Bo thinks 1 is left, and Charlie sees 2 when he looks in the box. Now Charlie tries to pick up a GPS. Weird he can't seem to do it. Why? Well the server is not letting him. The server thinks there are 0 GPS'es left in the box, what are you trying to cheat or something Charlie: "You can't pick up a GPS when there is nothing left!". Basically that is the issue. Again most never notice since from what I've seen a typical ammo scripts dumps like 100 rifles of each type and refill every 30min or so. Share this post Link to post Share on other sites