Home   Help Search Login Register  

Author Topic: Trouble with units in cargo  (Read 3210 times)

0 Members and 1 Guest are viewing this topic.

Offline trooper543

  • Members
  • *
Trouble with units in cargo
« on: 29 May 2008, 22:16:28 »
Hi there all

i am busy making a cutscene where a chinook choppers arrives at airfield and drops off 3 teams so far this works okay
the problem i am having is when the teams trasnfer from the chinook to Be32k plane

the plane has a waypoint to load and the teams have a getout waypoint to get out the chinook then a move waypoint and then a another getin waypoint.

the problemis that the plane just keeps moving along its waypoints and does not load any of the teams

i have the getin wapoints synchronised with the planes load waypoint

cold anyone please point me in the right direction

thanks in adavance

Offline Ironman

  • Former Staff
  • ****
    • {GSF} Home Page
Re: Trouble with units in cargo
« Reply #1 on: 29 May 2008, 22:27:45 »
Waypoints = PUKEAGE

bad idea to use WP in this scenario. Just have ur normal WP's for the plane, then on activation of a WP (before it takes off) have a script activate and also put that WP at a 360 sec timeout....

So script should assign everyone in the three groups to the plane and command them to get in. Use the "for each unit group1" thingy...At the end of the script just use NextWp command, I believe there is a command like that at least, this will void the 360 sec pause
TS3 IP: tor.zebgames.com:9992

Offline Rommel92

  • Members
  • *
Re: Trouble with units in cargo
« Reply #2 on: 29 May 2008, 22:35:51 »
If the planes having trouble stopping, set its fuel to 0 (this setfuel 0) until everyones in, then set it back to one (or its original value if it is of importance.)

This should cause the plane to stop until everythings set.  :whistle:

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Trouble with units in cargo
« Reply #3 on: 29 May 2008, 23:08:13 »
Waypoints can work, but yes : using a little script (or just a trigger with the necessary assignas/ordergetin components) might also be useful. And what Rommel92 is suggesting is indeed the classical way of grounding those damned flyboys in ArmA as it was in OFP : note however that the pilot will probably disembark the plane while it's useless (=fuelless), but once it's refueled he'll get in and get going...

Mess around. If it's for a cutscene you can always cheat too : a quick little "fade to black", a camera pan, and whoops! Everyone's inside already! Or alternatively having a static plane that fills up, which is then deleted and replaced with a plane that actually moves...etc etc. Harder to do when it's all live action, of course.

Good luck!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline schuler

  • Contributing Member
  • **
Re: Trouble with units in cargo
« Reply #4 on: 30 May 2008, 08:13:26 »
Quote
the problemis that the plane just keeps moving along its waypoints and does not load any of the teams

@Wolfrug, sounds like my tricks. Good advice there mate!
@Rommel  :good:
@Ironman he might just need a script  :yes:

one more thing to help you , I am not sure about Arma but in Ofp the plain would take off from the west side of the air strip, so if you place a waypoint at the east side it would taxie to the west side before take off. They also needed a w/p at the west side to land and disembark on the east side. you might be suprised at how moving one little thing changes something, for good or bad!!!!!!!!!!!!!

Conlution; you might want to move w/p.s It really shouldn't make a difference but the game does funny things
And your pilot must be set to         this setbehaviour "CARELESS";   because he is AI they have a mind of there own,, CARELESS makes them into a zombie, more or less
Cheers schuler   play around and mostly have fun!
Semper Fi

Offline trooper543

  • Members
  • *
Re: Trouble with units in cargo
« Reply #5 on: 30 May 2008, 20:36:37 »
@ All

Gents many thanks for the help , it is most appreciated

the script option sounds really good, i am trying to find the bit of code that i have seen somewhere and maybe use that with a trigger

the piece of code i am looking for is somtheing along the lins of ?

({alive _x} count units team1,team2 ,team3) == ({_x in plane} count units team1,team2 ,team3)

so when the condition is true the plane would then move on

well this is my thought anyway

i tried the above code and it dont work but hey ho i keep on trying

but that said all and done ..........Gents i thank you all not just for the help but for the encouragement as well

Cheers

Offline trooper543

  • Members
  • *
Re: Trouble with units in cargo
« Reply #6 on: 30 May 2008, 23:18:11 »
Hi there all

I think i have found the solution to my problem after a long search and again Mr Mandoble i owe to you and those wonderful sqf scripts that you keep coming up with

I found the solution in this thread: Half SOLVED:Group Board Empty Vehicle 1x1

However i have a problem when running the script it generates the following error

Quote
...mptyPostion "cargO")} :
#
Error invalid number in expression

Line 26
Code: [Select]
waitUntil {(_unit in _veh) || (!alive _unit) || (!canMove _veh) || ((_veh emptyPositions "cargo") == 0)};

the script

Quote

// board.sqf, execute with execVM.[[grp1,grp2,grp3],[plane1,plane2,plane3]]execVM"board.sqf"; 

_groups = _this select 0;
_vehicles = _this select 1;
for [{_i = 0},{_i < count _groups},{_i=_i + 1}] do
{
   [_groups select _i, _vehicles select _i] spawn
   {
      _grp = _this select 0;
      _veh = _this select 1;
      _nunits = count units _grp;
      for [{_j = 0},{_j < _nunits},{_j = _j + 1}] do
      {
         _unit = units _grp select _j;
         _unit assignAsCargo _veh;
         [_unit] orderGetIn true;
         Sleep 1;
         waitUntil {(_unit in _veh) || (!alive _unit) || (!canMove _veh) || ((_veh emptyPositions "cargo") == 0)};
      };
   };
}:

Please could somebody help me solve this little problem

Thanks in advance

Offline Ironman

  • Former Staff
  • ****
    • {GSF} Home Page
Re: Trouble with units in cargo
« Reply #7 on: 31 May 2008, 00:50:21 »
Quote
...mptyPostion "cargO")} :
#
Error invalid number in expression

maybe you need a lower case "O".... maybe I am retarded and it doesn't matter either lol
TS3 IP: tor.zebgames.com:9992

Offline schuler

  • Contributing Member
  • **
Re: Trouble with units in cargo
« Reply #8 on: 31 May 2008, 18:36:03 »
Ironman you might be right ,,,,,,, one typo can reck the whole script
Code: [Select]
...mptyPostion "cargO")} :
#
Error invalid number in expression
you put an O there,,,,,,, not 0 redo it mate,,,,, ;)
but yet check it all :) thats carg0 part refer to ironman's post and he is right


cheers schuler
Semper Fi

Offline trooper543

  • Members
  • *
Re: Trouble with units in cargo
« Reply #9 on: 31 May 2008, 19:42:44 »
@ironman /schuler

Gents i have checked that and all is right but i am  still getting the error


Offline Ironman

  • Former Staff
  • ****
    • {GSF} Home Page
Re: Trouble with units in cargo
« Reply #10 on: 31 May 2008, 23:28:18 »
well, maybe one of those listed commands in Line 26 will never equal zero. Maybe double check that, also, see if there is another command you can use, might not be the same idea but can still work.....
TS3 IP: tor.zebgames.com:9992

Offline trooper543

  • Members
  • *
Re: Trouble with units in cargo
« Reply #11 on: 31 May 2008, 23:40:41 »
@ Ironman

Thanks for the response, i tried change the 0 to 1 and still got the same error
, when it comes to sqf i am way out my league mate

Thansk in advance

Offline schuler

  • Contributing Member
  • **
Re: Trouble with units in cargo
« Reply #12 on: 01 Jun 2008, 03:06:11 »
hey sorry just checking
// board.sqf, execute with execVM.[[grp1,grp2,grp3],[plane1,plane2,plane3]]execVM"board.sqf";

_groups = _this select 0;
_vehicles = _this select 1;
for [{_i = 0},{_i < count _groups},{_i=_i + 1}] do
{
   [_groups select _i, _vehicles select _i] spawn
   {
      _grp = _this select 0;
      _veh = _this select 1;
      _nunits = count units _grp;
      for [{_j = 0},{_j < _nunits},{_j = _j + 1}] do
      {
         _unit = units _grp select _j;
         _unit assignAsCargo _veh;
         [_unit] orderGetIn true;
         Sleep 1;
         waitUntil {(_unit in _veh) || (!alive _unit) || (!canMove _veh) || ((_veh emptyPositions "cargo") == 0)};
      };
   };
}:
Semper Fi

Offline Rommel92

  • Members
  • *
Re: Trouble with units in cargo
« Reply #13 on: 01 Jun 2008, 03:37:26 »
Code: [Select]
_groups = _this select 0;
_vehicles = _this select 1;
for [{_i = 0},{_i < count _groups},{_i=_i + 1}] do
{
   [_groups select _i, _vehicles select _i] spawn
   {
      _grp = _this select 0;
      _veh = _this select 1;
      _nunits = count units _grp;
      for [{_j = 0},{_j < _nunits},{_j = _j + 1}] do
      {
      player globalchat format["_unit: %1 --- _grp: %2 --- _veh: %3 --- emptyPos _veh: %4",_unit,_grp,_veh,_veh emptyPositions "cargo"];
         _unit = units _grp select _j;
         _unit assignAsCargo _veh;
         [_unit] orderGetIn true;
         Sleep 1;
         waitUntil {(_unit in _veh) || (!alive _unit) || (!canMove _veh) || ((_veh emptyPositions "cargo") == 0)};
      };
   };
}:

Please tell us what it returns.  :)
Should show whether its an execution problem or not.

EDIT: I'm going to guess here you currently have [[Grp1,Grp2],PLANE1]execVM "board.sqf"; instead of [[Grp1,Grp2],[PLANE1]]. Just double check that, else tell us what the above debug(edited)script returns.

 :good:
« Last Edit: 01 Jun 2008, 03:39:37 by Rommel92 »

Offline trooper543

  • Members
  • *
Re: Trouble with units in cargo
« Reply #14 on: 01 Jun 2008, 04:01:02 »
@Rommel

Many thanks for the assistance, it is greatly appreciated

i have done as you have said and i still get the same error

invalid number in expression  Line 25

My knowledge of sqf/scripting in general is not very good
but i get the impression that it got be something with this line here;

 waitUntil {(_unit in _veh) || (!alive _unit) || (!canMove _veh) || ((_veh emptyPositions "cargo") == 0)};

Again many thanks in advance

Offline Rommel92

  • Members
  • *
Re: Trouble with units in cargo
« Reply #15 on: 01 Jun 2008, 04:07:06 »
Did anything come up on screen? No values to tell us...  :dunno:
Delete that line then tell us what it returns then, and if possible could you show how your executing the script!

Thanks, Romm.

Code: [Select]
_groups = _this select 0;
_vehicles = _this select 1;
for [{_i = 0},{_i < count _groups},{_i=_i + 1}] do
{
   [_groups select _i, _vehicles select _i] spawn
   {
      _grp = _this select 0;
      _veh = _this select 1;
      _nunits = count units _grp;
      for [{_j = 0},{_j < _nunits},{_j = _j + 1}] do
      {
      player globalchat format["_unit: %1 --- _grp: %2 --- _veh: %3 --- emptyPos _veh: %4",_unit,_grp,_veh,_veh emptyPositions "cargo"];
         _unit = units _grp select _j;
         _unit assignAsCargo _veh;
         [_unit] orderGetIn true;
         Sleep 1;
      };
   };
}:

Offline schuler

  • Contributing Member
  • **
Re: Trouble with units in cargo
« Reply #16 on: 01 Jun 2008, 04:24:48 »
Quote
My knowledge of sqf/scripting in general is not very good
same here but are sure it should be sqf?  :dunno:
@ Rommel Victoria rules dude,,,,,,,, notice i said dude not mate  :P
@ trooper keep up the good work ,,,,,,  ;)
i think Cheetah had a sqf tute, i looked but didnt find it  :weeping:
Semper Fi

Offline trooper543

  • Members
  • *
Re: Trouble with units in cargo
« Reply #17 on: 02 Jun 2008, 08:59:49 »
eish no i am totallty lost   ::)

Still get an error i honestly dont know what i am doing here


Offline schuler

  • Contributing Member
  • **
Re: Trouble with units in cargo
« Reply #18 on: 02 Jun 2008, 14:47:14 »
i think!?!?!?!? you can add the sqf with the cutscene sqs and more scripts too sqs, inserted at the right time
sorry i might be wrong with what your doing ,,,,
but best to solve all the troops boarding first;)one thing at a time

Quote
eish no i am totallty lost   Roll Eyes

Still get an error i honestly dont know what i am doing here

 
Semper Fi

Offline Rommel92

  • Members
  • *
Re: Trouble with units in cargo
« Reply #19 on: 02 Jun 2008, 21:12:53 »
Ok mate, step by step.
Go into the editor or wherever you have "executed" this script from, in other words, where you put:
Code: [Select]
[[grp1,grp2,grp3],[plane1,plane2,plane3]]execVM"board.sqf"; and what were the parameters (were they grp1, grp2, grp3, or were they bravoGRP1 etc, what did you put in the brackets).

Second step.
Code: [Select]
_groups = _this select 0;
_vehicles = _this select 1;
for [{_i = 0},{_i < count _groups},{_i=_i + 1}] do
{
   [_groups select _i, _vehicles select _i] spawn
   {
      _grp = _this select 0;
      _veh = _this select 1;
      _nunits = count units _grp;
      for [{_j = 0},{_j < _nunits},{_j = _j + 1}] do
      {
      player globalchat format["_unit: %1 --- _grp: %2 --- _veh: %3 --- emptyPos _veh: %4",_unit,_grp,_veh,_veh emptyPositions "cargo"];
         _unit = units _grp select _j;
         _unit assignAsCargo _veh;
         [_unit] orderGetIn true;
         Sleep 1;
      };
   };
}:
Backup the original script (the one posted originally) and replace it with the one above. Play the mission and it should come up with a bunch of text, when that comes up, thats this line of code:
Code: [Select]
player globalchat format["_unit: %1 --- _grp: %2 --- _veh: %3 --- emptyPos _veh: %4",_unit,_grp,_veh,_veh emptyPositions "cargo"];This code make the player, speak over globalchat expressing the variables (values) of: _unit, _grp, _veh and how many emptyPositions in _veh 's cargo.

This data can help us come to a conclusion (if provided) as to what the problem may be...

Hope this helps mate.  :yes:

Offline trooper543

  • Members
  • *
Re: Trouble with units in cargo
« Reply #20 on: 06 Jun 2008, 02:13:10 »
Thanks Rommel

I will try out your solution and come back to you with the results
many thanks agains