Home   Help Search Login Register  

Author Topic: Can't do for/while loops - can you help?  (Read 2501 times)

0 Members and 1 Guest are viewing this topic.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Can't do for/while loops - can you help?
« Reply #15 on: 13 Jun 2005, 15:50:34 »
they still do hunt the player down... i agree sometimes one of them seems to disappear off in another direction, but whoever it is soon comes running... ;)

on a side-note, the jeep with the general in it doesn't need so many waypoints to get where it's going. you'd be surprised how few the ai needs to get it to its destination...

Corben Dallas

  • Guest
Re:Can't do for/while loops - can you help?
« Reply #16 on: 13 Jun 2005, 16:20:19 »
Hmmm....

The original 'set all waypoints' script set them after me at once, which was far more realistic.  Why is this different..?

As to the General's jeep - if I set less waypoints the idiot AI driver crashes into trees, etc., and then the meeting messes up as they don't arrive on time.  I've spent many hours messing with this - if there's an easier way to set up a meeting please tell me!

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Can't do for/while loops - can you help?
« Reply #17 on: 13 Jun 2005, 16:38:59 »
to make sure two parties meet at a certain time, synchronise the two waypoints. that will make whoever gets there first wait for the stragglers before moving on.

Corben Dallas

  • Guest
Re:Can't do for/while loops - can you help?
« Reply #18 on: 13 Jun 2005, 17:35:42 »
Ah!  That easy?  Geez... ;)

Corben Dallas

  • Guest
Re:Can't do for/while loops - can you help?
« Reply #19 on: 14 Jun 2005, 10:05:52 »
I'm still having awful trouble with this hunt-me-down stuff. Well, trouble if I try to use the -seek-and-destroy/cycle final wp method.

I've tried every combination of seek/cycle, synchonisation, etc., and all I get is them running in the wrong direction when I kill one of the three in the group. In other words, they still follow the original wp sequence for a short time. They then don't even hunt me down very well.

However, if I set all their wps to 'getpos player' in the script loop, as soon as one is shot they come after me like a pack of terriers on amphetamines.

Confused. I can make it work the shabby way, but would rather have a flexible 'pass the group name and last wp number' to get hunted by any unit I choose.

Perhaps it's because I'm on 1.46 and something doesn't work the same as 1.9x ???
« Last Edit: 14 Jun 2005, 10:06:07 by Corben Dallas »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Can't do for/while loops - can you help?
« Reply #20 on: 14 Jun 2005, 11:36:35 »
it may well be a version discrepancy, but i doubt it. attached is a version which seems to work - they come straight for the player.

Corben Dallas

  • Guest
Re:Can't do for/while loops - can you help?
« Reply #21 on: 14 Jun 2005, 12:10:14 »
Not for me they don't!  I set seek and cycle wps away from the last main cycle, then sync'd the trigger to the one before the seek (ie., the last in the main wp set).  I then pass [this, 9, 10] to the script, and kill one of the group.  The others run away from me combat mode, ie., to the next wp in the main set.

I tried passing [this, 8, 9] - no change.
Tried setting the wp in the script loop 'manually' - no change.
Tried sync'ing the trigger to the seek wp - no change.

The script runs when the trigger fires - I put a hint in to test it.

So the only way I've got it to work correctly so far, and get them to hunt me immediately, is to set every flaming wp to getpos player.

This is doing my head in.  ???  Perhaps I'll just leave it setting all wps to get me, but I'd rather have a flexible script to use with other units.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Can't do for/while loops - can you help?
« Reply #22 on: 14 Jun 2005, 12:15:52 »
what does 'this' refer to? the way the script is set up, you need to pass it the name of the group leader. that way it knows whose waypoints you mean. if it's in a trigger, i'm not sure what 'this' will refer to, most likely the trigger itself... which won't have any waypoints.

Corben Dallas

  • Guest
Re:Can't do for/while loops - can you help?
« Reply #23 on: 14 Jun 2005, 12:31:23 »
Aha!  Thank you yet again.  Changed it from 'this' to 'TheMajor' and it it now works.  They still don't come for me immediately though, as they do if you set all wps to getpos player.  No noob idea at all why, but it looked better that way - as though when you shot him in the back they saw where the bullets had come from.

This'll do fine though!  :)  Perhaps I should consider this solved - you folks must be yawning a lot...

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Can't do for/while loops - can you help?
« Reply #24 on: 14 Jun 2005, 12:34:26 »
it does seem a weird one, and like i say - the zip i sent seems to work fine for me - they come straight at the player. to be honest i'm a bit curious myself as to what may be going on with your version that they go off to another waypoint first. logically, if the switch trigger points to the 'seek & destroy' waypoint, that's where they should go, immediately....  :-\

Corben Dallas

  • Guest
Re:Can't do for/while loops - can you help?
« Reply #25 on: 14 Jun 2005, 13:37:34 »
Well, wouldn't you know it - it's my fault.  When I looked at the one you sent (cheers for that) I thought I'd set my latest added-to version up the same way.  However, I didn't have the trigger set as a Switch.  Now it's all fine :)

I'll put this thread to sleep now, and many thanks.  I'm starting to get the hang of triggers and scripts at least, and now have the group in the car go combat if they turn up and find someone dead.  Shame OFP's AI doesn't do that sort of thing already - I can't see any reason why any armed forces would casually stand about when there are bodies all over the place!