Home   Help Search Login Register  

Author Topic: Questions on script commands  (Read 764 times)

0 Members and 1 Guest are viewing this topic.

Offline Blacknite

  • Members
  • *
  • Chiefs runs the navy!
Questions on script commands
« on: 19 Nov 2005, 19:39:20 »
Hi, my first question is:  how do you make an ai follow the player (especially the enemy), I have made a trigger with activation stating:  p1 dofollow player (p1 being the ai, player is the player).  When I try to test it out, ai just stands there looking dumb while I will get an error message up on the top.  (also, the trigger has been set so that it activates when West is present).

And my other question is, how do you set it up so that time is against you?  Like you have 5 mins to get to this destination or you will fail or something.

Thanks.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Questions on script commands
« Reply #1 on: 19 Nov 2005, 19:47:43 »
doFollow does not mean "follow this guy".   It means "follow the group leader".    It is sometimes used after a doStop command, to make the loon fall back into formation.

Actually making a loon follow another loon around is much trickier than it looks.   Use a looping script with distance commands to check the distance between target and follower:  if it's too great then follower doMove getPos target.   Don't issue doMove commands too frequently or they will stack up and cause confusion.

For time pressure, you can use a pair of triggers:-

Countdown:     300     300     300
Condition:  true
On activation:   outOfTime=true


Type:   End#6
Condition:  outOfTime and objectiveNotDone


Plenty of reviewed ArmA missions for you to play

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Questions on script commands
« Reply #2 on: 20 Nov 2005, 11:31:30 »
an alternative to the first question would be to give the ai a 'move' waypoint, followed by a 'cycle' waypoint, both at the end of the ai's existing waypoints. when you want the ai to start following the player, activate a switch trigger which is synchronised with the waypoint before 'move', and then use setwppos in a looping script to put the last 'move' and 'cycle' waypoints at the player's position.

then if you want to stop the ai following the player, repeat the process with more waypoints after the 'move' and 'cycle', using another switch trigger to activate them.
« Last Edit: 20 Nov 2005, 11:32:16 by bedges »

Offline Blacknite

  • Members
  • *
  • Chiefs runs the navy!
Re:Questions on script commands
« Reply #3 on: 20 Nov 2005, 17:08:12 »
Thanks all, but those "Following" commands didnt work, however, I found one that does from this site:  http://ofp.toadlife.net/scripts.php  and that one does work.

The time one worked though, but you should of told me it was in Secs.  cuz I was wondering what the 300 meant.  Thanks all!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Questions on script commands
« Reply #4 on: 20 Nov 2005, 18:42:00 »
If you are ever unsure of what an answer means, or want clarification, always ask.     ;)
Plenty of reviewed ArmA missions for you to play