Jump to content
Sign in to follow this  
PSYKO_nz

ammo crate custom load out problems, since update

Recommended Posts

hi there, im having trouble getting an ammo crate to accept custom ammo loads in MP

up until the update today we had a script in the init of the ammobox in question that looked like this

WHOLE LOT OF OTHER STUFF IN REGARDS TO LOADOUTS THAT STILL WORKS FINE then; NULL=[]execVM ""loadouts\loadbox.sqf"";

up until the update today this all worked fine, it found the sqf, completed the sqf and worked perfectly (I have checked with 5 other missions that all worked fine up until today and they all have the same problem, they were working, now they're not)

any body have any ideas on why this is happening?

also everything working fine in single player and in the editor but not on a multiplayer server, this includes manually copying the contents of the sqf, pasting and them in the init (script has no errors) as I said, SP and in the editor this loads fine. MP nothing

what am I missing here?

Share this post


Link to post
Share on other sites

I think I found the problem. The commands clearXCargo and addXCargo, now needs to be Global (i.e: addWeaponCargoGlobal). A script example:

if (isServer) then {

clearweaponcargoGlobal _this;
clearmagazinecargoGlobal _this;
clearitemcargoGlobal _this;


_this addweaponcargoGlobal ["launch_Titan_F",1];
_this addweaponcargoGlobal ["R3F_Minimi_762",1];
_this addweaponcargoGlobal ["LMG_Mk200_F",1];
_this addweaponcargoGlobal ["Rangefinder",2];
};

"Confirmed" http://feedback.arma3.com/view.php?id=17655

Share this post


Link to post
Share on other sites

Thanks heaps, but there's a problem... I've just tested it through the 2 ways mentioned above and the problem is... no prizes for guessing what it is...

both ways (a called .sqf or direct in the box init) it DOES WORK BUT it loads once for the server and once for every player on the server... in other words, 40 FAK's turns into 80 or 120 or 160 etc...

thanks heaps for the suggestion, at least we know its loadable in MP now we just have to figure out how to make it load only ONCE

any more ideas?

Edited by PSYKO_phoenix
fixed the clearing box contents issue

Share this post


Link to post
Share on other sites

removed.

Posted something. changed my mind so removed the post. Scripters prerogative :). Sorry for the confusion.

Edited by whiztler

Share this post


Link to post
Share on other sites

Sorry mate. Updated my post.

<On topic>

Does anyone get japapatramtara comment on the http://feedback.arma3.com/view.php?id=17655 report? Quote:

Hi, there were some heavy arguments why we have decided to modify ClearXXXGlobal commands to work on owner's machine only. But obviously we can't say: "Hi community guys.. sorry for inconvience, but you have to change all your scripts". So within a day I will revert this change and try to find a better solution

So what do they think we'll do next? Just wing it again? Sigh

</On topic>

Share this post


Link to post
Share on other sites

I guess so, last time they updated they broke there "tasks" module now the've fixed that and broken there box customisation

Share this post


Link to post
Share on other sites

Arggggh, just went thru my mission folder. not looking forward to updating all my missions. SO NOT AMUSED!!!

Share this post


Link to post
Share on other sites

I think I've cracked it, although I haven't ran it on the server with more than one player but its now only loading once, for the server, not for the server and then me when I join... ill keep you posted if it works for multiple clients and also jip, but for now this is what I got

I used the "blablablacargoGlobal loadbox" (so I just added "Global" to the end of everything)

that made it work on the server, BUT it loaded for the server and any clients that joined... soooo..

I added this to it (it will only work in MP on a server this way apparently)

if (isServer) then {Stuff from original script};

and it works.... so far....

so heres how the script looks. (this is the SQF called by the box)

if (isServer) then {sleep 10;

clearWeaponCargoGlobal loadbox;

clearMagazineCargoGlobal loadbox;

clearItemCargoGlobal loadbox;

clearBackpackCargoGlobal loadbox;

sleep 2;

loadbox addMagazinecargoGlobal ["20Rnd_mas_762x51_Stanag", 40];

loadbox addMagazinecargoGlobal ["30Rnd_mas_556x45_Stanag", 40];

loadbox addMagazinecargoGlobal ["150Rnd_762x51_Box", 20];

loadbox addMagazinecargoGlobal ["200Rnd_mas_556x45_Stanag", 20];

loadbox addMagazinecargoGlobal ["8Rnd_mas_45acp_Mag", 20];

loadbox addMagazinecargoGlobal ["15Rnd_mas_9x21_Mag",20];

loadbox addMagazinecargoGlobal ["3Rnd_HE_Grenade_shell", 10];

loadbox addMagazinecargoGlobal ["1Rnd_HE_Grenade_shell", 10];

loadbox addMagazinecargoGlobal ["3Rnd_Smoke_Grenade_shell", 10];

loadbox addMagazinecargoGlobal ["1Rnd_Smoke_Grenade_shell", 10];

loadbox addMagazinecargoGlobal ["HandGrenade", 20];

loadbox addMagazinecargoGlobal ["SmokeShell", 20];

loadbox addMagazinecargoGlobal ["SmokeShellRED", 20];

loadbox addMagazinecargoGlobal ["SmokeShellBLUE", 20];

loadbox addMagazinecargoGlobal ["SmokeShellpurple", 20];

loadbox addMagazinecargoGlobal ["SmokeShellGREEN", 20];

loadbox addMagazinecargoGlobal ["SmokeShellORANGE", 20];

loadbox addMagazinecargoGlobal ["Titan_AT", 10];

loadbox addMagazinecargoGlobal ["Titan_Ap", 10];

loadbox addMagazinecargoGlobal ["Chemlight_green", 10];

loadbox addweaponcargoGlobal ["ACRE_PRC148", 10];

loadbox addweaponcargoGlobal ["ACRE_PRC343", 10];

loadbox addweaponcargoGlobal ["ACRE_PRC119", 10];

loadbox additemcargoGlobal ["U_B_GhillieSuit", 2];

loadbox addweaponcargoGlobal ["srifle_LRR_f", 2];

loadbox addMagazinecargoGlobal ["7Rnd_408_Mag", 20];

loadbox additemcargoGlobal ["optic_Hamr", 10];

loadbox additemcargoGlobal ["optic_MRCO", 10];

loadbox additemcargoGlobal ["B_UavTerminal", 2];

loadbox addMagazineCargoGlobal ["ATMine_Range_Mag",10];

loadbox addMagazineCargoGlobal ["APERSMine_Range_Mag",10];

loadbox addMagazineCargoGlobal ["APERSBoundingMine_Range_Mag",10];

loadbox addMagazineCargoGlobal ["SLAMDirectionalMine_Wire_Mag",10];

loadbox addMagazineCargoGlobal ["APERSTripMine_Wire_Mag",10];

loadbox addMagazineCargoGlobal ["ClaymoreDirectionalMine_Remote_Mag",10];

loadbox addMagazineCargoGlobal ["DemoCharge_Remote_Mag",10];

loadbox addMagazineCargoGlobal ["SatchelCharge_Remote_Mag",10];

loadbox addmagazinecargoGlobal ["MAAWS_HEAT_FFV751",20];

loadbox addmagazinecargoGlobal ["MAAWS_HEAT_FFV551",20];

loadbox addmagazinecargoGlobal ["MAAWS_HEDP_FFV502",20];

loadbox addweaponcargoGlobal ["MAAWS",3];

loadbox additemcargoGlobal ["firstaidkit", 50];};

so far Its working...

I guess if you want to run it both single player and multiplayer you could do 2 copies of the script and have the box call both, cause each one will only work in its given setting

one called loadboxSP.sqf - leave that as normal (no global)

and one called loadboxMP.sqf - use the global version and if (isServer) then {}:

ill keep you posted from this end, let us know if you have any luck

...we really shouldn't have to be doing this at all... but it is what it is

---------- Post added at 12:46 PM ---------- Previous post was at 12:36 PM ----------

Arggggh, just went thru my mission folder. not looking forward to updating all my missions. SO NOT AMUSED!!!

I know the feeling..... same here, we've got upwards of 20 missions that we have made with this problem and that's just missions that we've made for our server, now any downloaded mission (upwards of 50) that has a custom ammo box will also be buggered. MAKES IT SO HARD TO ENJOY THE EXCELENT USER CREATED MISSIONS... first tasks, now this. I know there doing there best to give us an epic game but how do they break these things? when they were working great in the first place?

I'm dreading the Zeus release....

Share this post


Link to post
Share on other sites
Sorry mate. Updated my post.

<On topic>

Does anyone get japapatramtara comment on the http://feedback.arma3.com/view.php?id=17655 report? Quote:

So what do they think we'll do next? Just wing it again? Sigh

</On topic>

I love riddles!

If read correctly, clearCargoItemGlobal, clearWeaponCargoGlobal, etc won't work for the person executing it if they don't own it. I.e Player_1 spawns ammobox_1 and Player_2 tries to clear the cargo but since Player_2 didn't spawn ammobox_1 he can't manipulate it. Logical way is the server spawns it and controls it.

However though ownership of stuff like that has been... iffy since ARMA 2... It's what we call locality.. The ownership of something changes for example.. The server spawned offroad_1 but when player_32 gets in the offroad_1 as driver he then takes ownership / locality ownership of that vehicle and the server no-longer owns it until that player 'disconnects'.

You can use owner on an object to get the owners ID and then compare it against players to see what player owns it and if need be you can force ownership to the server with setOwner.

Edited by Tonic-_-

Share this post


Link to post
Share on other sites

after reading that I think I need a cup of tea and a lie down...

Share this post


Link to post
Share on other sites

YEAH, I give up till all these things stop getting broken.. here im trying to learn ... but its changing as im going, and like said above .(lieing down is what im going to do too.). fixing missions more than I get to play them. sucks

Share this post


Link to post
Share on other sites
YEAH, I give up till all these things stop getting broken.. here im trying to learn ... but its changing as im going, and like said above .(lieing down is what im going to do too.). fixing missions more than I get to play them. sucks

+10000000000000000

Share this post


Link to post
Share on other sites

sorry in advance for caps

OOOOOOOOOOH GREAT! THE UPDATE HAS NOT ONLY CAUSED THE (now semi resolved) BOX PROBLEM BUT ITS ALSO RENDERED OUR REVIVE SCRIPT COMPLETELY USELESS... NOW WE HAVE TO FIX THAT..... GREAT

up until now ive been giving benefit of the doubt to BI but this is to much

tasks (now fixed), custom load problems and now respawn script problems

how the hell do they expect people to continue to play there game if they continue to ruin every mission makers mission with there updates???

Zeus is going to be horrific for us mission makers

Share this post


Link to post
Share on other sites

yep that's fixed the load problem (haven't checked but ill take there word for it) but what about the screwed up respawn scripts? or what about the other scripts that are broken that we don't know of yet? most missions have them and they make the game more fun (if like us you are a small team) but now with them not working correctly what are we supposed to do? we cant blame the people who wrote the scripts, why is BI screwing around with what is supposed to be a full version? why did they not sort this stuff in the beta? why have they released a product to the market as a full game and then decided that its a good idea to change how everything is done half way through?

how many times are mission and content makers going to have to re do there missions/content because BI have changed the way a code is written or red?

how many people are going to get pissed off at these constant changes destroying hours and hours of there time and effort befor they just say enough and go play something else?

I love ARMA and I realy respect what bi are doing with this style of game, but surly they can understand that changing things that mess around with scripts, tasks, loads, etc etc etc is going to turn people off of there product...

and heres another question/statement.. this is the second time that they have released an update (that broke things) then done a hotfix a day later to fix some of the more major problems that miss out on some of the minor issues (eg the tasks), why is this not fixed on the DEV build branch? how is content going from a dev build (essentially a beta for up coming things) into the stable game version with these errors?

is the auto update function of steam causing them to be lazy with things?

how many times will we have to repeat this forum?

im all for improving the game and the experience but its hard to enjoy when you build a mission that's working fine, you test it and its fine all is working, then an update comes out the day you have scheduled with your team to play it and the mission is ruined, you don't realise that one of your scripts is buggered until half way through when some one catches one in the leg or chest and you cant perform the medical thing's or revive that were previously working

ARMA is an amazing game, there is nothing else out there that comes even remotely close to it

it is great

but my patience is wearing thin...

please please please BI please get these things right or give some warning or introduce it in a way that preserves the legacy scripts until people can change it

I realy wish I wasn't feeling so compelled to write this post. I really wish I was saying great work BI you've done an amazing job

now back to work trying to figure out how to fix the issues

I sincerely hope the next time I post a thread that it is one of praise for there great work...

keep up the good work BI but remember if it aint broke don't fix it :)

Share this post


Link to post
Share on other sites
....

You can use owner on an object to get the owners ID and then compare it against players to see what player owns it and if need be you can force ownership to the server with setOwner.

The owner command only works on the server, as it states in the wiki.

If someone has trouble with locality of an command, this method here will sort it out:

//	Name: NP_fnc_removeItem.sqf
//	Version: 1.0
//	Author: Na_Palm
//	Description: if local, remove item from unit else give to server
//-------------------------------------------------------------------------------------
private["_unit","_item"];

_unit = _this select 0;
_item = _this select 1;

if (local _unit) then {
_unit removeItem _item;
}else{
if isServer then {
	[_this, "NP_fnc_removeItem", (owner _unit), false] call BIS_fnc_MP;
}else{
	[_this, "NP_fnc_removeItem", false, false] call BIS_fnc_MP;
};
};

greetings Na_Palm

Share this post


Link to post
Share on other sites

Seems the hotfix didn´t solved the problem. My old (1.10) custom ammoboxes (generated with LEA) don't work.

ammoBox.sqf

/**
* Generated by LEA for Arma 3
* Version: 2.0.14
* Mon Feb 17 22:29:57 CET 2014
* 
* Call the script: _dummy = this execvm "caja.sqf";
* 
*/

clearweaponcargo _this;
clearmagazinecargo _this;
clearitemcargo _this;

_this addweaponcargo ["launch_Titan_F",1];
_this addweaponcargo ["R3F_Minimi_762",1];
_this addweaponcargo ["LMG_Mk200_F",1];
_this addweaponcargo ["Rangefinder",2];
_this addweaponcargo ["arifle_MX_Black_F",3];
_this addweaponcargo ["arifle_MXC_Black_F",1];
_this addweaponcargo ["R3F_AT4CS",1];
_this additemcargo ["NVGoggles",10];
_this addweaponcargo ["arifle_MX_GL_Black_F",3];
_this addweaponcargo ["launch_Titan_short_F",1];
_this addweaponcargo ["srifle_EBR_F",1];
_this addmagazinecargo ["1Rnd_SmokeRed_Grenade_shell",5];
_this addmagazinecargo ["1Rnd_SmokeGreen_Grenade_shell",3];
_this addmagazinecargo ["30Rnd_65x39_caseless_mag",42];
_this addmagazinecargo ["SmokeShellGreen",10];
_this addmagazinecargo ["SmokeShell",12];
_this addmagazinecargo ["200Rnd_65x39_cased_Box",1];
_this addmagazinecargo ["Titan_AA",1];
_this addmagazinecargo ["R3F_AT4CS_Mag",1];
_this addmagazinecargo ["1Rnd_SmokeBlue_Grenade_shell",3];
_this addmagazinecargo ["30Rnd_65x39_caseless_mag_Tracer",18];
_this addmagazinecargo ["20Rnd_762x51_Mag",6];
_this addmagazinecargo ["200Rnd_65x39_cased_Box_Tracer",2];
_this addmagazinecargo ["Titan_AT",2];
_this addmagazinecargo ["HandGrenade",10];
_this addmagazinecargo ["1Rnd_Smoke_Grenade_shell",6];
_this addmagazinecargo ["SatchelCharge_Remote_Mag",1];
_this addmagazinecargo ["R3F_100Rnd_762x51_MINIMI",5];
_this addmagazinecargo ["SmokeShellRed",2];
_this addmagazinecargo ["3Rnd_HE_Grenade_shell",22];
_this addmagazinecargo ["DemoCharge_Remote_Mag",2];
_this additemcargo ["x39_bandage",47];
_this additemcargo ["MineDetector",1];
_this additemcargo ["x39_morphine",19];
_this additemcargo ["optic_Hamr",10];
_this additemcargo ["muzzle_snds_B",1];
_this additemcargo ["x39_bloodbag",10];
_this additemcargo ["acc_pointer_IR",10];
_this additemcargo ["optic_MRCO",10];
_this additemcargo ["ItemGPS",10];
_this additemcargo ["x39_medikit",24];
_this additemcargo ["Toolkit",1];
_this additemcargo ["optic_Arco",10];
_this additemcargo ["optic_SOS",1];
_this additemcargo ["x39_epinephrine",19];
_this additemcargo ["ItemRadio",10];
_this additemcargo ["muzzle_snds_H",8];

if (isServer) then {
_this addBackpackCargoGlobal ["B_AssaultPack_rgr",8];
_this addBackpackCargoGlobal ["tf_anprc155",1];
_this addBackpackCargoGlobal ["tf_rt1523g",1];
_this addBackpackCargoGlobal ["tf_mr3000",1];
};

Same script fixed

/**
* Generated by LEA for Arma 3
* Version: 2.0.14
* Mon Feb 17 22:29:57 CET 2014
* 
* Call the script: _dummy = this execvm "caja.sqf";
* 
*/

if (isServer) then {

clearweaponcargoGlobal _this;
clearmagazinecargoGlobal _this;
clearitemcargoGlobal _this;


_this addweaponcargoGlobal ["launch_Titan_F",1];
_this addweaponcargoGlobal ["R3F_Minimi_762",1];
_this addweaponcargoGlobal ["LMG_Mk200_F",1];
_this addweaponcargoGlobal ["Rangefinder",2];
_this addweaponcargoGlobal ["arifle_MX_Black_F",3];
_this addweaponcargoGlobal ["arifle_MXC_Black_F",1];
_this addweaponcargoGlobal ["R3F_AT4CS",1];
_this additemcargoGlobal ["NVGoggles",10];
_this addweaponcargoGlobal ["arifle_MX_GL_Black_F",3];
_this addweaponcargoGlobal ["launch_Titan_short_F",1];
_this addweaponcargoGlobal ["srifle_EBR_F",1];
_this addmagazinecargoGlobal ["1Rnd_SmokeRed_Grenade_shell",5];
_this addmagazinecargoGlobal ["1Rnd_SmokeGreen_Grenade_shell",3];
_this addmagazinecargoGlobal ["30Rnd_65x39_caseless_mag",42];
_this addmagazinecargoGlobal ["SmokeShellGreen",10];
_this addmagazinecargoGlobal ["SmokeShell",12];
_this addmagazinecargoGlobal ["200Rnd_65x39_cased_Box",1];
_this addmagazinecargoGlobal ["Titan_AA",1];
_this addmagazinecargoGlobal ["R3F_AT4CS_Mag",1];
_this addmagazinecargoGlobal ["1Rnd_SmokeBlue_Grenade_shell",3];
_this addmagazinecargoGlobal ["30Rnd_65x39_caseless_mag_Tracer",18];
_this addmagazinecargoGlobal ["20Rnd_762x51_Mag",6];
_this addmagazinecargoGlobal ["200Rnd_65x39_cased_Box_Tracer",2];
_this addmagazinecargoGlobal ["Titan_AT",2];
_this addmagazinecargoGlobal ["HandGrenade",10];
_this addmagazinecargoGlobal ["1Rnd_Smoke_Grenade_shell",6];
_this addmagazinecargoGlobal ["SatchelCharge_Remote_Mag",1];
_this addmagazinecargoGlobal ["R3F_100Rnd_762x51_MINIMI",5];
_this addmagazinecargoGlobal ["SmokeShellRed",2];
_this addmagazinecargoGlobal ["3Rnd_HE_Grenade_shell",22];
_this addmagazinecargoGlobal ["DemoCharge_Remote_Mag",2];
_this additemcargoGlobal ["x39_bandage",47];
_this additemcargoGlobal ["MineDetector",1];
_this additemcargoGlobal ["x39_morphine",19];
_this additemcargoGlobal ["optic_Hamr",10];
_this additemcargoGlobal ["muzzle_snds_B",1];
_this additemcargoGlobal ["x39_bloodbag",10];
_this additemcargoGlobal ["acc_pointer_IR",10];
_this additemcargoGlobal ["optic_MRCO",10];
_this additemcargoGlobal ["ItemGPS",10];
_this additemcargoGlobal ["x39_medikit",24];
_this additemcargoGlobal ["Toolkit",1];
_this additemcargoGlobal ["optic_Arco",10];
_this additemcargoGlobal ["optic_SOS",1];
_this additemcargoGlobal ["x39_epinephrine",19];
_this additemcargoGlobal ["ItemRadio",10];
_this additemcargoGlobal ["muzzle_snds_H",8];

_this addBackpackCargoGlobal ["B_AssaultPack_rgr",8];
_this addBackpackCargoGlobal ["tf_anprc155",1];
_this addBackpackCargoGlobal ["tf_rt1523g",1];
_this addBackpackCargoGlobal ["tf_mr3000",1];
};

Share this post


Link to post
Share on other sites

HA! so it wasn't fixed, because you used the exact same method I used to get it to work around my ones problems... exact same problem, exact same resolution (more or less) even though its supposed to be fixed and work the normal way

Share this post


Link to post
Share on other sites

If I understand right : So far all "additemCargo" type of commands don't work anymore on servers ?

I run a dedi server and custom crates stuff don't spawn anymore (unless I switch to Global and then it spawns too much and lags the server), so what am I supposed to do ? wait for a fix from BI ? So they don't want us to put any item inside vehicles and crates ?

Share this post


Link to post
Share on other sites

I am confused as to what the fuss is about for this. The change requires that you use addItemCargoGlobal, which because it is a Global command, must be executed on one machine, say, server. If anything, this is more efficient then having an addItemCargo command run on each machine.

The downside? No more "client side ammoboxes", meaning it is a shared pool. But so what? Use that to make your mission dynamic. Sorry you can't roll a 5 man squad with 5 sniper rifles. Or, put 5 of everything in the crate, and bump it up for ammo, and you accomplish the same thing. Basically multiply the count to the Global command by the number of players, and you'll be happy again.

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  

×