Home   Help Search Login Register  

Author Topic: moveincargo help  (Read 1894 times)

0 Members and 4 Guests are viewing this topic.

GaryP

  • Guest
moveincargo help
« on: 21 Aug 2003, 16:52:33 »
I wanted 4 guys to walk over to a chopper and get in.
I found this script somewhere:
mygroup = group this; "_x moveincargo" for each units mygroup

I get this error:
'_x moveincargo|#': ERROR invalid number in expression.

What did I do wrong?  What is the error telling me?

And points to tutorials will get you brownie points. :D


GrimMonkey

  • Guest
Re:moveincargo help
« Reply #1 on: 21 Aug 2003, 17:00:29 »
I don't what you did wrong. But I use a different way of putting soldiers in.
Here's what you do:

1: Name the chopper
2: Name everybody you want to ride as cargo
3: Put this into all the soldeirs' init. lines:
                 unitName moveincargo chopperName

Hope it helps :).


Or if you want the soldiers to start out of the chopper. Have the chopper make a waypoint called 'Load' and have the soldiers move near it and make a WP for them called 'Get In'. Now synchrnize (or however you spell it) the two waypoints and the soldeirs will get in.
« Last Edit: 21 Aug 2003, 17:03:43 by GrimMonkey »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:moveincargo help
« Reply #2 on: 21 Aug 2003, 17:09:23 »
Two points.

Firstly, forEach is one word, not two.    (You don't need the capital E, it just makes it easier to read.)    And also you need to tell the game which vehicle you want the loons to get into, thus

"_x moveincargo chopper1" forEach units mygroup

Invalid number in expression usually means that the game has no idea what's going on.    However the # often correctly identifies the location of the error in the line of script.


Secondly, although this is a perfectly good way of getting a loon into a vehicle, it's not the best way for this particular circumstance.    The loons will teleport magically from wherever they are straight into the chopper, which isn't very realistic.   As GrimMonkey implies, it's often used when you want the loons to start the mission in the vehicle.

In this case you'd might be better off with the commands:

assignAsCargo
orderGetIn

Understanding how to use them is left as an exercise for the reader.   ;D    As an aside, helicopters are nasty bustards in OFP and there are a couple of specific tutes on helping you deal with them.

Depending on circumstances it might be easier to get the loons into the chopper using waypoints.






Plenty of reviewed ArmA missions for you to play

GrimMonkey

  • Guest
Re:moveincargo help
« Reply #3 on: 21 Aug 2003, 17:17:58 »
Yeah,

Thanks Macguba, you answer my question about using the 'mygroup' command. I didn't even have to ask.
My last post was sloppy and rushed.
My apologies.


Thy Greatest Fear Is Fear Itself, If A Giant Nuclear Monkey Was Named Fear...

GaryP

  • Guest
Re:moveincargo help
« Reply #4 on: 21 Aug 2003, 18:07:32 »
I'm starting to make a bunch of little test maps with just one thing going on prefixed with test.  That way I can refer to them and learn the basic steps before I make a real mission.

Where I got mixed up is the chopper is sitting on the ground, and not coming in for a landing.  If it was then I could use the tutorial I was reading.

And I think I did use foreach and not for each.   Been in VB too long. ;D

I'll look up those keywords.  Thanks.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:moveincargo help
« Reply #5 on: 21 Aug 2003, 18:32:20 »
@GaryP,

In case you were using foreach as one word, your mistake was:

Quote
mygroup = group this; "_x moveincargo" for each units mygroup

You didn't specify the vehicle here.

"_x moveincargo ??????" foreach units my_loons

off course in case you were using for each as two words, still
there was no vehicle to mount specified  ;)


@Mac,

you really sure forEach is easier to read than foreach  ;D
(just kiddin)  ;)


:edit -  :o i didn't realize that you already told him about the
missing vehicle specification - must have been too busy with
thinking about what's easier to read  :-[  :-X

~S~ CD
« Last Edit: 21 Aug 2003, 18:35:11 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:moveincargo help
« Reply #6 on: 21 Aug 2003, 19:17:24 »
lol  ;D
Plenty of reviewed ArmA missions for you to play

GaryP

  • Guest
Re:moveincargo help
« Reply #7 on: 21 Aug 2003, 21:04:22 »
I can't wait to go home and try this out.  I was so mad this morning that I could not get it right.  And I got it from a tutorial.  I'm going to check the tutorial and see if the typo is in there and write to the author and ask that they correct it for the next poor person who tries to read it. ;)

Thanks for the help.

so this is better, and should work:
"_x assignAsCargo chopper1" forEach units mygroup
Still not sure why the quotes though.

Or:
mygroup orderGetIn true
And this should work too, because it's expecting an array on the front end.  And a group is an array, right?

Example:
[unitOne, unitTwo] orderGetIn true


Am I getting this?  ::)


Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:moveincargo help
« Reply #8 on: 21 Aug 2003, 21:36:15 »
Quote
mygroup orderGetIn true
And this should work too, because it's expecting an array on the front end.  And a group is an array, right?

If i remember correctly, group is seen as an object by the
game engine. Object/Group i think it says in the comref.

What i'm always using is: units mygroup orderGetIn true

Just try your way first, and keep in mind that (units mygroup)
thingy, to be prepared, if yours doesn't work.

Also on a sidenote: if you are the groupleader, they won't
enter the vehicle just upon these commands (at least in my last
tries they didn't). But this also could have been because of
my mixture of scripts and waypoints - you'll see.

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:moveincargo help
« Reply #9 on: 21 Aug 2003, 22:32:56 »
The quotes in forEach are just to mark out what the forEach command is referring to.   In many commands (not sure if this is one) the game will accept curly brackets { } instead of " ".   Sometimes this is essential, for example when you have a line of code that uses quotes within quotes sometimes it will only work if one pair are brackets.

I don't think a group is truly an array, though sometimes it does behave a bit like one.  A lot of commands will take either a group or an object as an argument, as Chris says.
Plenty of reviewed ArmA missions for you to play

GaryP

  • Guest
Re:moveincargo help
« Reply #10 on: 21 Aug 2003, 23:34:08 »
Nope, that does not work either.  This is starting to get to me.

I have a trigger that I walk over.  It is synchronized to Bills group of 4 guys.  It tells them to move to the waypoint near the chopper.  That works.

In the 'on activation' box in the waypoint I have:

mygroup = group this; units mygroup orderGetIn true

And they stand around like loons.  Where do I tell them WHAT to get in?? ???

This can't be this hard.  It's funny. ;D  Now I am going to make this work if it takes me all night.  Any and all help would be welcomed.  (please). :P

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:moveincargo help
« Reply #11 on: 21 Aug 2003, 23:46:27 »
OK,

into Bills init field you type:

mygroup = group this

Then you make your waypoint, to let them walk to
the chopper (type: move)

onActivation:

"_x assignascargo chopper1" forEach units mygroup

:note - this will tell them that they have to mount chopper1
as cargo, once they get ordered to GETIN

Now you can either use a simple GETIN waypoint as next
wayopint of Billy and his guys (no need to syncronize the
waypoint to anything, nor don't you need to put the
waypoint exactly onto the chopper),

or you just use the: units mygroup orderGetin true
(or: units Bill orderGetin true)
in any onActivation field which is activated after the
assignment one.

hope this solves and enlights u

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

GaryP

  • Guest
Re:moveincargo help
« Reply #12 on: 22 Aug 2003, 00:27:35 »
Chris Death, can you, or someone take a look and see what I am doing wrong?  I set it up like you told me.  I even tried a 'get in' waypoint.  No go.  I am including the file.  It's tiny.

To get it going, just load it in the editor and take 4 steps forward to start the trigger and watch the 4 guys to your left run to the chopper and stop and stand there link fools.

Thanks a million. ;D  I have no hair left as it is. :P


Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:moveincargo help
« Reply #13 on: 22 Aug 2003, 00:32:55 »
Sorry, but i can't load anything into the editor right
now (i'm at work).

What i can do is:

I'll have a look into your mission.sqm and may see what's
goin wrong  ;)

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:moveincargo help
« Reply #14 on: 22 Aug 2003, 00:43:52 »
GaryP,

could it be you have two groups of name "mygroup"?

look here:

Code: [Select]
class Item0
            {
               position[]={5346.002441,19.394999,9979.026367};
               azimut=280.000000;
               id=2;
               side="WEST";
               vehicle="SoldierWB";
               leader=1;
               rank="CORPORAL";
               skill=0.200000;
               text="Bill";
               init="mygroup = group this";

and here:

Code: [Select]
class Item0
            {
               position[]={5329.306152,19.394999,9985.690430};
               azimut=180.000000;
               id=0;
               side="WEST";
               vehicle="SoldierWB";
               player="PLAYER COMMANDER";
               leader=1;
               skill=0.600000;
               init="mygroup = group this";
            };

OK, first you name Billies group: mygroup

later you reassign mygroup to the player's group

example:

a = 0

assigns the value 0 to a

if you say later then:

a = 1

you assign the value 1 to a

result at the end: a = 1

You need to change:

mygroup = group this
in the player's init field to another groupname

like: myothergroup = group this


And then i found a trigger where you do another mistake:

Code: [Select]
class Sensors
   {
      items=1;
      class Item0
      {
         position[]={5332.638672,19.394999,9973.138672};
         a=10.000000;
         b=10.000000;
         activationBy="WEST";
         age="UNKNOWN";
         expActiv="HINT ""Everyone get in the Chopper""; ""_x moveincargo"" foreach units BillsGroup";
         class Effects
         {
         };
         synchronizations[]={0};
      };
   };
};

units BillsGroup

doesn't exist, as you said in Bills init field: mygroup = group this

hope this helps now

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted