Taxen0 15 Posted August 15, 2013 I have a coop mission and i try to add some magazines to all the players backpacks at start with the following in their respective inits. (unitBackpack this) addmagazine ["30Rnd_65x39_caseless_mag",6]; but it does not work well with multiplayer. only me (server) gets the magazines, and I can see the magazines in my friends backpacks, but they can't. so it's obviously some locality issue, but how should I fix it? Share this post Link to post Share on other sites
Valixx 11 Posted August 15, 2013 (edited) As far as i know you have to use playableUnits to add the magazine to all playable units. Sry i'm not a pro in scripting, you have to wait for more experienced users for a ready-to-go script^^ Maybe: if (side playableUnits == WEST) then { your code } forEach playableUnits; Again, it's just a suggestion. Edited August 15, 2013 by Valixx Share this post Link to post Share on other sites
kylania 568 Posted August 15, 2013 When do you add backpacks to your players? Only a few units start with backpacks by default, so just add the magazines when you add the backpacks. Share this post Link to post Share on other sites
Von Quest 1163 Posted August 15, 2013 drop (unitbackpack this) this only works for you. just use on other players in MP: this addMagazines ["30Rnd_65x39_caseless_mag",6]; Took me FOREVER to catch this in my Map setup. Share this post Link to post Share on other sites
cuel 25 Posted August 15, 2013 They are basically ammoboxes, use addMagazineCargo Share this post Link to post Share on other sites
kylania 568 Posted August 15, 2013 Use backpack unit for the classname and unitBackpack unit for the object. Share this post Link to post Share on other sites
Taxen0 15 Posted August 21, 2013 revisiting this in case someone else needs it in the future. the new command "addMagazineCargoGlobal" works! so in this case (unitBackpack this) addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag",6]; Share this post Link to post Share on other sites
cuel 25 Posted August 21, 2013 That's what I wrote above :rolleyes: Share this post Link to post Share on other sites
atlantisthief 2 Posted August 21, 2013 If your fellow member have a backpack on start, just get player addMagazines ["30Rnd_65x39_caseless_mag",6]; into the init.sqf and you should be fine. If they don't have a backpack, you should add one with player addbackpack "backpackclassname"; for example "B_AssaultPack_khk". So it would be: player addbackpack "backpackclassname"; player addMagazines ["30Rnd_65x39_caseless_mag",6]; in the init.sqf If you don't want to have to do a init, you should be able to use these 2 commands in the init of the units, just replace "player" with "this". Share this post Link to post Share on other sites
Taxen0 15 Posted August 21, 2013 your way worked, but it only worked for the server for some reason. The players had empty backpacks, but if the server had a look the magazines were there. the addition of Global made it MP-syncronized. Share this post Link to post Share on other sites
atlantisthief 2 Posted August 21, 2013 The players had empty backpacks, but if the server had a look the magazines were there. Do you mean the unit had magazines in his backpack, but the unit itself couldn't see it? So only you (the server), could see them? Share this post Link to post Share on other sites
cuel 25 Posted August 21, 2013 Yeah if you run it only on the server, only the server will see it indeed. If it ran from the init line of the unit, you would not need Global Share this post Link to post Share on other sites
Taxen0 15 Posted August 21, 2013 Do you mean the unit had magazines in his backpack, but the unit itself couldn't see it? So only you (the server), could see them? Yes, exactly like that. Yeah if you run it only on the server, only the server will see it indeed.If it ran from the init line of the unit, you would not need Global But I did have it in the unit init-field =/ this is my init: this addvest "V_RebreatherB"; this addbackpack "B_Carryall_ocamo"; (unitBackpack this) addMagazineCargoGlobal ["100Rnd_65x39_caseless_mag",3]; (unitBackpack this) addWeaponCargoGlobal ["FirstAidKit",2]; (unitBackpack this) addMagazineCargoGlobal ["HandGrenade",2]; and without global only "me" (server) can see is as content. Share this post Link to post Share on other sites
cuel 25 Posted August 21, 2013 Weird. Normal addMagazineCargo; The arguments do not have to be local to the unit and the effects are only local on where it was executed. Which would mean that every player that connects will add more stuff to the backpack. Share this post Link to post Share on other sites