Jump to content

Crotchety_Old_Buzzard

Member
  • Content Count

    3
  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About Crotchety_Old_Buzzard

  • Rank
    Rookie

Profile Information

  • Location
    Virginia, United States
  1. Crotchety_Old_Buzzard

    Error with SetCurrent Waypoint.

    I figured it out. While the syntax for the command says "groupname setCurrentWaypoint waypoint", the example shows "_grp setCurrentWaypoint [_grp, 1];". I removed the waypoint variable from "_grpLiftHeli setCurrentWaypoint [_wpHeli1, 1];" and changed it to the group variable: "_grpLiftHeli setCurrentWaypoint [_grpLiftHeli, 1];". No more error.
  2. Crotchety_Old_Buzzard

    Error with SetCurrent Waypoint.

    Thanks for the response, beno. At one point I did have the "join" command in place, but since it didn't seem to make a difference, I took it back out. Based on your reply, I changed the code to: _vehLiftHeli = createVehicle ["O_Heli_Transport_04_F", getMarkerPos "wpHeli_1", [], 0, "FLY"]; _grpLiftHeli = createVehicleCrew _vehLiftHeli; _vehLiftHeli setDir 240; _grpLiftHeli addVehicle _vehLiftHeli; _wpHeli1 = _grpLiftHeli addWaypoint [getPos wp6, 0]; //Newly changed line _wpHeli1 waypointAttachObject TempTarget; _wpHeli1 setWaypointType "HOOK"; _grpLiftHeli setCurrentWaypoint [_wpHeli1, 1]; It returned the same error. The syntax for setCurrentWaypoint is showing "Group/Object setCurrentWaypoint waypoint", so I have _grpLiftHeli in the Group/Object position and _wpHeli1 in the waypoint position, which fits the wiki's syntax. Yet the error shows "Error Type Array, expected Group", which I'm reading as the compiler seeing _grpLiftHeli as an array instead of a group. In another of my scripts (which I used as a template for this script), I use the same setup, with the line "grpConvoy1 setCurrentWaypoint [_wp1, 1];" and it works without the error. I tried using a global variable in place of the local in this attempt, also, but no change. This just doesn't make sense to me. Hoping for further insights. Edit: After posting this, I tried changing the line to "grpConvoy1 setCurrentWaypoint [_wpHeli1, 1];" since grpConvoy1 is a global group variable, and I received the error again. Also, in case it makes a difference, in the grpConvoy1 script, I used createUnit and added them to the group, instead of createVehicleCrew. I don't think it should matter since using grpConvoy1 gave the same error, but thought I ought to mention it.
  3. I am getting "Error Type Array, expected Group" when attempting to use setCurrentWaypoint, even though I am putting a group class variable in the correct position in the following script: _grpLiftHeli = createGroup east; _vehLiftHeli = createVehicle ["O_Heli_Transport_04_F", getMarkerPos "wpHeli_1", [], 0, "FLY"]; createVehicleCrew _vehLiftHeli; _vehLiftHeli setDir 240; _grpLiftHeli addVehicle _vehLiftHeli; _wpHeli1 = _grpLiftHeli addWaypoint [getPos wp6, 0]; _wpHeli1 waypointAttachObject TempTarget; _wpHeli1 setWaypointType "HOOK"; _grpLiftHeli setCurrentWaypoint [_wpHeli1, 1]; //group _vehLiftHeli setCurrentWaypoint [_wpHeli1, 1]; The error always gives the setCurrentWaypoint line number with the above listed explanation. I use prefixes that tell me the data type of the variables to avoid these kinds of trouble. As you can see, _grpLiftHeli is the created group I am using. addVehicle and addWaypoint require a Group Data Type for their opening parameters, as does setCurrentWaypoint. I used the same variable "_grpLiftHeli" for all three statements, yet, while addVehicle and addWaypoint give no errors, setCurrentWaypoint gives the "Error Type Array, expected Group" message. In the debug console I watched "xxx = groupID _grpLiftHeli;" and got back "Alpha 2-1", so it seems to be a proper group. I also tried replacing the last code line with the commented code line below it with the same results. I believe my syntax is correct based on BIS wiki, but know I still make mistakes. If anyone can explain this to me, I would be greatly appreciative. EDIT: I forgot to mention that I used the same general setup for creating a vehicle convoy and had no problems with the error. setCurrentWaypoint worked fine.
×