Jump to content
Mirek

Getting "Error in Expression" But see no reason for such error.

Recommended Posts

Hallo arma coders, i have an issue.

I have plane Caled Valk_1, with driver called Valk_1D, i have trigger on radio foxtrot and markers "WPM_1 - WPM_3 . I have  code in On act field of the trigger:

WPV_1 = Valk_1D addWaypoint [getMarkerPos "WPM_1",0];
		           WPV_1 setWaypointType "MOVE";
				   WPV_1 setWaypointCompletionRadius 30;
WPV_2 = Valk_1D addWaypoint [getMarkerPos "WPM_2",1];
		           WPV_2 setWaypointType "TR UNLOAD";
				   WPV_2 setWaypointCompletionRadius 30;
WPV_3 = Valk_1D addWaypoint [getMarkerPos "WPM_3",2];
		           WPV_3 setWaypointType "MOVE";
				   WPV_3 setWaypointCompletionRadius 300;
				   WPV_3 setWaypointStatements ["true", "{ deleteVehicle _x }forEach units Valk_1D;"];

But when i fire the trigger i get error in expression, wich doesnt make sense cause i have the code correct or at least i cannot see any problem in my code. It is exactly as in the wiki.  "_wp =_grp addWaypoint [position player, 0];"

i tried to have all zeroes at the end and i tried to have 0-2 as seen above. doesnt work. Maybe iam just tired, it is after midnight here, but i cannot see what the hell is wrong.

Share this post


Link to post
Share on other sites

@Mirek, try to pass to addWaypoint command group not unit:

WPV_1 = (group Valk_1D) addWaypoint [getMarkerPos "WPM_1", 0];

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Also, the second parameter is waypoint spawn radius, not index. Waypoints are indexed correctly as they are created, no need to use the third (index) param unless you are adding new waypoints between existing ones. You can use a value of -1 if you want the waypoint exactly where the marker's center is.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Ok guys, i owerlooked the group thing. Thank you all a million.

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×