Jump to content
Sign in to follow this  
wiggum2

[How To] Transfer gear from one mission to another

Recommended Posts

Hi,

currently im working on a campaign where it is very important that the player has at the beginning of mission 2 the gear/loadout he had as mission 1 ended.

I searched but i only found that command:

addWeaponPool

It is not good enough explained for me to understand it and im not sure if it does what i need (gear end of mission 1 = gear beginning of mission 2).

Can someone help me ?

Share this post


Link to post
Share on other sites

Havn't done this since OFP, but if I remember correctly, it should be something like this.

exit.sqf (Mission 1):

_weap = weapons player;
_mags = magazines player;

for "_i" from 0 to (count _weap - 1) do
{
   _w = _weap select _i;
   addWeaponPool [_w, 1];
};
for "_i" from 0 to (count _mags - 1) do
{
   _m = _mags select _i;
   addMagazinePool [_m, 1];
};

xx = player saveStatus "01Player";

init.sqf (Mission 2):

xx = player loadStatus "01Player";
fillWeaponsFromPool player;

Share this post


Link to post
Share on other sites

Thanks Clayman, i will try it that way !:thumb:

Share this post


Link to post
Share on other sites
SaveStatus will might work as well. ;)

That would mean:

End of mission 1

player saveStatus "playerstate"

Beginning of mission 2 (init.sqf)

_ok= [[player]] '''loadStatus''' "playerState"

...ah, it cant be that easy... :D

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  

×