Home   Help Search Login Register  

Author Topic: locking some waypoints  (Read 998 times)

0 Members and 1 Guest are viewing this topic.

Offline Seven

  • Members
  • *
  • Am I a llama?
locking some waypoints
« on: 09 Nov 2007, 01:53:57 »
Hi,

I've been wondering for long but never thought of asking here (or read it):
is it possible to lock "some" waypoints instead of all?

Let's say for example I would have a patrol with 5 waypoints, 4 move WP's & 1 cycle WP, to f.e. lock their 2nd & 3rd WP?

If so it would make life easyer to have a search & destroy WP locked from the start untill some trigger activates that would lock all other and unlock that one for certain time, before making them return on the patrolling route.

Thx
Seven

Offline Surdus Priest

  • Members
  • *
  • Only I can Forgive You!
Re: locking some waypoints
« Reply #1 on: 09 Nov 2007, 02:07:34 »
you can i beleive, but its fiddly.

you would have to first get the current waypoint that the group is on using getWPPos believe.

then change its condition with [grp, 2] setWaypointStatements ["true", ""], u'd have to make a variable for the waypoint number.

then setWaypointType to SAD (search and destroy), but also setWaypointPosition to the enemy forces (or current position), if on current position they should attack the enemy forces straigh away, but if you can set a search and destroy waypoint on the enemy by having a trigger that follows the patrol, gaining a list of all enemies,  then (im not entirely sure how this bit works) using _x, select 0 (should select the first unit in the enemy group), get its position, and plonk the waypoint on it.

then, when ready to continue the patrol, meet the condition for that waypoint, and hopefull they should continue normally.

you'd have to reset all the bahviours of the group ofcourse.

hope this helps,
surdus
Campaigns are hard, I'll stick with scripting for now!

Offline Seven

  • Members
  • *
  • Am I a llama?
Re: locking some waypoints
« Reply #2 on: 09 Nov 2007, 03:43:05 »
Thx for ur input Surdus Priest!

So basicly, I could make an extra (let's say the 5th waypoint) and set it to false, have a trigger that would set 0,1,2,3,4 wp to false (1-5+wp's+cycle) and 4wp (5) true?
I wouldn't mind about going into straight as you can set a radius on a trigger;
the thing that might bother me then would be the (_this select 0) << global variable error thingy I think

If you'd have it all worked out in mind a demo would be great!  :)

Cheers!

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: locking some waypoints
« Reply #3 on: 09 Nov 2007, 09:39:52 »
You can also mess around with the setCurrentWaypoint command. For instance, if you have four Move Wps and one Cycle waypoint that makes the unit cycle around the four WPs, you could for instance put a single S&D waypoint AFTER the cycle waypoing (that wouldn't normally be activated due to the cycle) and then use selectCurrentWaypoint to select the S&D waypoint when needed. Then the units would immediately turn towards that waypoint and go at it for as long as you want. When you want them to return to patrolling, just use selectWaypoint to have them start at one of the WPs inside the loop again.  :good:

That is, if that's what you wanted to do.  :dunno:

Good luck!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Seven

  • Members
  • *
  • Am I a llama?
Re: locking some waypoints
« Reply #4 on: 09 Nov 2007, 17:08:45 »
Yup that seems to be the answer I was looking for!
Thx Wolfrug! I'll try it out