Home   Help Search Login Register  

Author Topic: transfer weapons and ammo in a MP campaign  (Read 6249 times)

0 Members and 1 Guest are viewing this topic.

Offline fleepee

  • Members
  • *
  • Enter the Matrix!
transfer weapons and ammo in a MP campaign
« on: 06 Feb 2010, 12:17:00 »
I'm making a campaign, and I wish that it can be played in an hosted MP way.
I've got problems transfering weapons and ammo from a mission to the next one... :no:

here are the codes i'm using (you'll see I'm not a good scripter, sorry...):
in the campaign's description.ext:
Code: [Select]
weaponPool=true;
    
class Campaign
{
    name =  "Once upon a time...";
    firstBattle = missions;
//    disableMP = false;


    class missions
...etc...

in a save_status.SQF file launched at first mission's end:
Code: [Select]
if (alive civ1 and primaryWeapon civ1!="") then {addweaponpool [primaryWeapon civ1,1];};
if (alive civ1 and secondaryWeapon civ1!="") then {addweaponpool [secondaryWeapon civ1,1];};
if (alive civ2 and primaryWeapon civ2!="") then {addweaponpool [primaryWeapon civ2,1];};
if (alive civ2 and secondaryWeapon civ2!="") then {addweaponpool [secondaryWeapon civ2,1];};
if (alive civ3 and primaryWeapon civ3!="") then {addweaponpool [primaryWeapon civ3,1];};
if (alive civ3 and secondaryWeapon civ3!="") then {addweaponpool [secondaryWeapon civ3,1];};
if (alive civ4 and primaryWeapon civ4!="") then {addweaponpool [primaryWeapon civ4,1];};
if (alive civ4 and secondaryWeapon civ4!="") then {addweaponpool [secondaryWeapon civ4,1];};
if (alive civ5 and primaryWeapon civ5!="") then {addweaponpool [primaryWeapon civ5,1];};
if (alive civ5 and secondaryWeapon civ5!="") then {addweaponpool [secondaryWeapon civ5,1];};
if (alive civ6 and primaryWeapon civ6!="") then {addweaponpool [primaryWeapon civ6,1];};
if (alive civ6 and secondaryWeapon civ6!="") then {addweaponpool [secondaryWeapon civ6,1];};
if (alive civ7 and primaryWeapon civ7!="") then {addweaponpool [primaryWeapon civ7,1];};
if (alive civ7 and secondaryWeapon civ7!="") then {addweaponpool [secondaryWeapon civ7,1];};
if (alive civ8 and primaryWeapon civ8!="") then {addweaponpool [primaryWeapon civ8,1];};
if (alive civ8 and secondaryWeapon civ8!="") then {addweaponpool [secondaryWeapon civ8,1];};

//{deleteStatus _x} foreach ["civ1", "civ2", "civ3", "civ4", "civ5", "civ6", "civ7", "civ8"];

if (alive civ1) then {civ1 saveStatus "civ1";};
if (alive civ2) then {civ2 saveStatus "civ2";};
if (alive civ3) then {civ3 saveStatus "civ3";};
if (alive civ4) then {civ4 saveStatus "civ4";};
if (alive civ5) then {civ5 saveStatus "civ5";};
if (alive civ6) then {civ6 saveStatus "civ6";};
if (alive civ7) then {civ7 saveStatus "civ7";};
if (alive civ8) then {civ8 saveStatus "civ8";};

addweaponpool ["binocular",5];

addmagazinepool ["30Rnd_762x39_AK47",50];
if (true) exitwith {};
there are more addmagazinepool lines as I don't know yet how to transfer the exact amount of ammo of each playable slots (can be AIs in game)

in a load_status.sqf file launched in the init code of next mission's start:
Code: [Select]
civ1 loadStatus "civ1";
civ2 loadStatus "civ2";
civ3 loadStatus "civ3";
civ4 loadStatus "civ4";
civ5 loadStatus "civ5";
civ6 loadStatus "civ6";
civ7 loadStatus "civ7";
civ8 loadStatus "civ8";

if (true) exitwith {};

When I reach the briefing of the second mission, I've got the weapons added in the weapon pool all right, but I can't select any of them nor magazines... ???

It works perfectly when I'm not hosting the campaign... :dunno:
I've search the forum for answers, but nothing worked... :weeping:

Help me please!!!
« Last Edit: 06 Feb 2010, 12:18:36 by fleepee »

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: transfer weapons and ammo in a MP campaign
« Reply #1 on: 06 Feb 2010, 13:47:18 »
I think the BI a2 campaign uses it too or at the a1?

You could check how they are doing it.  :)

Offline fleepee

  • Members
  • *
  • Enter the Matrix!
Re: transfer weapons and ammo in a MP campaign
« Reply #2 on: 06 Feb 2010, 16:06:07 »
I had a look on A2 missions, but I didnt see anything that could transfer weapons and ammo to next mission, or... I don't understand it!! ;)

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: transfer weapons and ammo in a MP campaign
« Reply #3 on: 06 Feb 2010, 22:32:35 »
BI is using loadStatus and saveStatus too. Search again in ca\missions\campaign\missions.

Offline fleepee

  • Members
  • *
  • Enter the Matrix!
Re: transfer weapons and ammo in a MP campaign
« Reply #4 on: 07 Feb 2010, 07:31:39 »
I couldn't find these directories using eliteness to de-PBO the Arma2/addons/CA file... :scratch:

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: transfer weapons and ammo in a MP campaign
« Reply #5 on: 07 Feb 2010, 12:13:39 »
ca is the name space. You need to check the missions.pbo.

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: transfer weapons and ammo in a MP campaign
« Reply #6 on: 07 Feb 2010, 14:50:19 »
According to the Biki, loadStatus doesn't work in MP - so that probably won't solve your problem, will it?

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: transfer weapons and ammo in a MP campaign
« Reply #7 on: 07 Feb 2010, 18:08:56 »
The note is probably based on OFP/ArmA I.

ArmA II introduced MP campaign via local host.

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: transfer weapons and ammo in a MP campaign
« Reply #8 on: 07 Feb 2010, 19:41:29 »
Ahh, fair enough... I cede to your superior knowledge :good:

Offline fleepee

  • Members
  • *
  • Enter the Matrix!
Re: transfer weapons and ammo in a MP campaign
« Reply #9 on: 07 Feb 2010, 21:18:08 »
I've read the same about loadstatus in mp, and i'm sure there is a way to do what i want...  :D

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: transfer weapons and ammo in a MP campaign
« Reply #10 on: 07 Feb 2010, 22:51:21 »
Well why not try it with a simple setup first in SP and go from the to local host.
Or double check if it does work in the a2 campaign.
From what I recall for some missions you can retain the equipment from the mission before.

Maybe its a MP locality problem. Do you execute it only on the host or also on each client?

PS: This is not needed at the end of file:
Code: [Select]
if (true) exitwith {};
if the script returns a value, can do just
Code: [Select]
true;
« Last Edit: 07 Feb 2010, 22:53:24 by kju »

Offline fleepee

  • Members
  • *
  • Enter the Matrix!
Re: transfer weapons and ammo in a MP campaign
« Reply #11 on: 28 Feb 2010, 13:27:03 »
everything works fine in SP, it doesn't when I host the campaign...
I couldn't find anything about savestatus in the CA missions folder.

Quote
Maybe its a MP locality problem. Do you execute it only on the host or also on each client?
the savestatus script is launched in an outro script launched by a trigger activated by a publicvariabled variable...

in the next mission, the loadstatus script is launched in the init file...
So I think each client runs the scripts... Am I wrong?

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: transfer weapons and ammo in a MP campaign
« Reply #12 on: 28 Feb 2010, 16:44:39 »
init file = init.sqf?

You mean a map placed trigger?
Did you debug MP with diag_log?

Offline fleepee

  • Members
  • *
  • Enter the Matrix!
Re: transfer weapons and ammo in a MP campaign
« Reply #13 on: 28 Feb 2010, 18:28:44 »
Quote
init file = init.sqf?
yes

Quote
You mean a map placed trigger?
yes

Quote
Did you debug MP with diag_log?
I don't know what it is and how to do it... ???
I've just checked arma2server.rpt and arma2.rpt

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: transfer weapons and ammo in a MP campaign
« Reply #14 on: 28 Feb 2010, 18:39:28 »
http://community.bistudio.com/wiki/diag_log

You can log variables (anything you like) to the rpt.
It is very useful for analysis. In addition to Gaia's debug console.  :good: