OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: C0LDSt33L on 28 Jan 2008, 15:34:08

Title: SetWPPos giving me trouble
Post by: C0LDSt33L on 28 Jan 2008, 15:34:08
Hey guys,

Here's the beef:
1) the squad leader of a group has the init code: "MatSqd1 = group this"
2) I have a trigger that when activated does: "[MatSqd1,1] setWPPos GetPos AmmoTruck"

The squad has three move waypoints and I thought those commands would move one of the waypoints (the first or second) to the position of AmmoTruck but it doesn't seem to do anything  >:(

I'm using ArmA vanilla 1.08. What am I doing wrong?
Title: Re: SetWPPos giving me trouble
Post by: Mandoble on 28 Jan 2008, 16:18:57
That will change the position of your first waypoint, but I understand that this happens once the group is already moving to its first waypoint. Havent tested it, but probably moving waypoints has no effect if the waypoint being moved is the current waypoint of the group.
If this happens, you might try the following for the activation code of the trigger:

Code: [Select]
MatSqd1 lockWP true;MatSqd1 move getPos vehicle leader MatSqd1;[MatSqd1,1] setWPPos GetPos AmmoTruck;MatSqd1 lockWP false
Title: Re: SetWPPos giving me trouble
Post by: Wolfrug on 28 Jan 2008, 18:38:55
Actually, you just need to re-move it.

Code: [Select]
[MatSqd1,1] setWPPos GetPos AmmoTruck;
[MatSqd1,1] setWPPos GetPos AmmoTruck;

That should do it. Why? Beats the hell out of me. Try Mandoble's too if you want :)

Wolfrug out.

Title: Re: SetWPPos giving me trouble
Post by: C0LDSt33L on 29 Jan 2008, 22:30:53
Good advice guys. I worked your ideas into the script, rehashed it a bit and it's working now  :D