Jump to content
Sign in to follow this  
Thirster

unit init problems in MP

Recommended Posts

I have an sqf that deletes most of the objects on the player on init and then adds back what i want them to have. works perfectly in preview,

but when playing it in MP it seems to forget to give certain objects to the players. I'm unsure what is going on.

example

Unit Init

removeAllWeapons _this;

removeHeadgear _this;

removeGoggles _this;

removeBackpack _this;

_this addUniform "CombatUniform_DPCU";

_this addVest "DPCU_vest1";

_this addHeadgear "DPCU_Helmet";

_this addMagazine "R3F_200Rnd_556x45_MINIMI";

_this addWeapon "R3F_Minimi";

_this addPrimaryWeaponItem "optic_MRCO";

_this additem "FirstAidKit";

_this additem "FirstAidKit";

_this addMagazine "R3F_200Rnd_556x45_MINIMI";

_this addMagazine "R3F_200Rnd_556x45_MINIMI";

_this addMagazine "SmokeShell";

_this addMagazine "SmokeShell";

_this addMagazine "HandGrenade";

it seems to forget the uniform/rucksack and or ammo/grenades

thanks for any help

Share this post


Link to post
Share on other sites

I don't see an add backpack in there. Then, make sure the classnames are right for the uniform. The rest of the stuff probably isn't added due to space.

Share this post


Link to post
Share on other sites

I think you need to wait for player initialization then execute your script. This might help if you add it before your code:

T_INIT = false;
T_Server = false; T_Client = false; T_JIP = false;

if (playersNumber east + playersNumber west + playersNumber resistance + playersNumber civilian > 0) then { T_MP = true } else { T_MP = false };

if (isServer) then
{
 T_Server = true;
 if (!(isNull player)) then { T_Client = true };
 T_INIT = true;
} else {
 T_Client = true;
 if (isNull player) then
 {
     T_JIP = true;
     [] spawn { waitUntil { !(isNull player) }; T_INIT = true };
 } else {
     T_INIT = true;
 };
};
waitUntil { T_INIT };

Share this post


Link to post
Share on other sites

sorry this one doesn't actually have a rucksack but it happens with the ruck with other sqf's that do add a ruck. It still happens with the uniforms, they get added when previewing and not when playing it in MP. it's very strange, also it only seems to be MP when other people are in, not if I start the map myself in MP.

ahhh wait for player, yeah that would explain it, thanks

Share this post


Link to post
Share on other sites

Oh wait, you don't use scripts. Maybe you should.

Share this post


Link to post
Share on other sites

would

waitUntil {!isNull player};

work in each units init before the execvm?

or maybe in the sqf as the first line?

Edited by Thirster

Share this post


Link to post
Share on other sites
would

waitUntil {!isNull player};

work in each units init before the execvm?

You can try it. Though you better off putting it in your script, I think

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  

×