Home   Help Search Login Register  

Author Topic: SetWPPos doesn't want to work  (Read 456 times)

0 Members and 1 Guest are viewing this topic.

Rocko Bonaparte

  • Guest
SetWPPos doesn't want to work
« on: 10 Jan 2005, 07:39:48 »
I'm trying to get SetWPPos to work, and I've never used it before.  I believe I'm using it correctly, but the units just don't care where I reposition their waypoints -- they ALWAYS go to the predetermined one instead.  Here's the script where I use it:
Code: [Select]
_crash_site = [[Rescue1, Rescue2, Rescue3, Rescue4, Rescue5, Rescue6, Rescue7, HeliWreck, DeadPilot], CrashBoundTL, CrashBoundBR] call randomly_position

hint format["Crash site is (%1, %2)", _crash_site select 0, _crash_site select 1]

; Initial orders
[group CaptureCrew, 2] SetWPPos _crash_site
I'm using a randomized position there -- the function generates a random position to all those units in that array, and then gives me the base position, which is stored in _crash_site.  That hint statement prints it out correctly.  Because it's random, I get different results each time, but I get things like:

"Crash site is (3288.4543, 4103.4903)"

To me it sounds like those two coordinates represent a valid position, so I should be able to use it with setWPPos; it doesn't work.  Any ideas what I could be doing wrong?

Edit: I feel I left out too much.  "CaptureCrew" is defined in the mission.sqm like so:
Code: [Select]
      class Item41
      {
         side="EAST";
         class Vehicles
         {
            items=7;
            class Item0
            {
               position[]={4630.314941,39.599998,3466.399658};
               azimut=130.000000;
               id=209;
               side="EAST";
               vehicle="JAM_EBOfficer";
               leader=1;
               rank="SERGEANT";
               skill=1.000000;
               text="CaptureCrew";
            };

                                                                ; Lots more items listed here.

         };
         class Waypoints
         {
            items=3;
            class Item0
            {
               position[]={4629.698730,39.599998,3473.443848};
               id=210;
               type="GETIN";
               class Effects
               {
               };
               showWP="NEVER";
            };
            class Item1
            {
               position[]={5105.652832,219.321716,4109.590332};
               type="GETOUT";
               combatMode="RED";
               formation="LINE";
               combat="COMBAT";
               class Effects
               {
               };
               showWP="NEVER";
            };
            class Item2
            {
               position[]={5105.652832,222.190323,4149.777832};
               type="SAD";
               class Effects
               {
               };
               showWP="NEVER";
            };
         };
      };
and that code block is in init.sqs
« Last Edit: 10 Jan 2005, 07:43:26 by Rocko Bonaparte »

StonedSoldier

  • Guest
Re:SetWPPos doesn't want to work
« Reply #1 on: 10 Jan 2005, 11:31:05 »
just make sure your trying to place a waypoint that already exsits, ive had trouble with the SetWPPos b4 when ive tried to Setpos waypoint 2 and the group only has 1 waypoint,

try

[(group CaptureCrew), 0] setWPPos _crash_site

and if not try,

{_x commandmove _crash_site} foreach units (group CaptureCrew)
« Last Edit: 10 Jan 2005, 11:31:51 by StonedSoldier »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:SetWPPos doesn't want to work
« Reply #2 on: 10 Jan 2005, 11:47:36 »
Also check that you have the right index number for the waypoint.

Make a test missionette on Desert Island just to see if you can get the command to work.     I frequently do this with commands I haven't used before, having discovered the hard way that it usually saves time in the long run.
Plenty of reviewed ArmA missions for you to play

Rocko Bonaparte

  • Guest
Re:SetWPPos doesn't want to work
« Reply #3 on: 10 Jan 2005, 23:12:23 »
I think I am referring to waypoint numbers correctly.  I included the waypoints with that missions.sqs snippet.  If something seems wrong, let me know.  I recall reading waypoint 0 is not the first waypoint, so I start from 1 and work up.  So I'm trying to reposition the "GETOUT" waypoint.

Something I haven't tried is using the class name instead of the text field for the unit.  Is this what I am supposed to do?
Code: [Select]
[Item41, 2] SetWPPos _crash_siteWhere Item41 is the name of the class.  I'm at work and can't test it out right now.  The code I've included has one of the vehicles named, and I use the group that corresponds to that unit.  I've also tried placing a "text=" field right underneath "side=EAST;" and that doesn't work either.

Rocko Bonaparte

  • Guest
Re:SetWPPos doesn't want to work
« Reply #4 on: 11 Jan 2005, 06:05:42 »
I figured out my fundamental problem.  I wasn't assigning group names correctly.  I thought you could assign a group's name like you would a unit, using a "text=name;" field.  I've since learned that no such thing works on groups, and that you need to make the assignment in the init field of a group member.