Home   Help Search Login Register  

Author Topic: Moveincargo troubles in MP  (Read 1776 times)

0 Members and 1 Guest are viewing this topic.

Offline M!StAkE id11479

  • Members
  • *
Moveincargo troubles in MP
« on: 05 Oct 2009, 15:23:11 »
Hi ofpec community.  :)
I maked a big MP para mission but sometimes it start wrong...
I have 2 player squads starting in 2 differents ch-47 choppers with the classic command "moveincargo heli foreach units mygroup", it work fine when i try in solo or with 2 or 3 friends on my pc as server, but when i try it on a ded server with full players the first time one full squad started out of chopper and the second time 3 players, i think its due to desynch and lag troubles, am i right?
If yes is there any solution for making sure the both squads start in choppers??   :dunno:
« Last Edit: 05 Oct 2009, 15:25:53 by M!StAkE id11479 »

Offline tcp

  • Members
  • *
    • Violator Gaming
Re: Moveincargo troubles in MP
« Reply #1 on: 07 Oct 2009, 22:07:19 »
Yes, probably due to not all players initializing at same time.
Either, put <this moveInCargo heli;> in each unit's init

Or, in init.sqf:
Code: [Select]
sleep 1;
waitUntil{alive squadleadername};
if(group player == group squadleadername) then {player moveInCargo heli};

If you have AI enabled, you might have to do this:
Code: [Select]
sleep 1;
waitUntil{alive squadleadername};
if(isServer) then {
{if(!isPlayer _x) then {_x moveInCargo heli}} forEach units group squadleadername;
};
if(group player == group squadleadername) then {player moveInCargo heli};

Offline M!StAkE id11479

  • Members
  • *
Re: Moveincargo troubles in MP
« Reply #2 on: 08 Oct 2009, 18:30:55 »
Thanks for your help!  :good:
Ill try tonight.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Moveincargo troubles in MP
« Reply #3 on: 19 Nov 2009, 16:58:02 »
tcp's code is for ArmA, not OFP.

Two things.
1) In MP best to always assign every unit to a group name in each unit's init.
Code: [Select]
grpCheese = group this2) Move your all your unit initialisation code to the init.sqs
Code: [Select]
{_x moveInCargo heliCheese} forEach units grpCheeseI have often had problems in MP with code in units init fields. Sometimes the code never executes. However, the group assignment always does.
urp!