Home   Help Search Login Register  

Author Topic: FOLLOWING  (Read 435 times)

0 Members and 4 Guests are viewing this topic.

netta1234

  • Guest
FOLLOWING
« on: 16 Apr 2004, 21:37:23 »
how do i make soldiers follow each other with out being in same team ::)
(sry 4 english)
« Last Edit: 16 Apr 2004, 21:37:56 by netta1234 »

GrimMonkey

  • Guest
Re:FOLLOWING
« Reply #1 on: 17 Apr 2004, 00:53:22 »
Except for puncuation, your English is fine (Even spelled 'being' correct.)

Unit1 DoFollow Unit2

Unit1 = Unit you want following, Unit2 = The unit you want followed.
Not completely sure if that works.


Beware the GrimMonkey

csde-PiLLe

  • Guest
Re:FOLLOWING
« Reply #2 on: 18 Apr 2004, 06:36:57 »
DoFollow does NOT make one unit follow another.

DoFollow is to be understood "Do Follow His Command", join his group.

To have one unit follow another unit as in "trace his steps", you could create either a series of waypoint in parallel, which are activated by conditions set by triggers the unit followed will pass on its path. e.g. have identical waypoints, then have - on each waypoint - a trigger for the followed unit's side, which activates the PREVIOUS waypoint for the following unit.

The problem with that is, it pretty much only looks good with vehicles, pretty much like a highway pursuit in a movie where the pursuing units never catch their target.


Then their is another possibility: You want an anti-tank team, for a limited time, to follow another unit's command. You can merge the groups with "join and lead" for the commanding unit and "join" for the following unit. Put these waypoints right next to each other and connect them using the "Synchronize" Tool in the In-Game-Editor. Make sure you give names to the following units, so you can identify them in the next step:

Then, at some point along the path, place a trigger, or use the "on activation" field of a waypoint, to assign the following unit to grpNull. That removes them from the commanding unit's group, allowing you to delete them after they get out of sight, or to assign them to a new group and have them do another assignment.


The third option, if you - for example - want one unit to shadow another group:

Use a script. In this script, have a loop and check for two conditions periodically: if the distance to the leading group is larger than, lets say, 200 Game Units, execute a "doMove" or "Move" for the group leader on the position obtained by "getpos leader followedgroup". On the other hand, if the unit is less than 150 meters away, let the leader HALT.

That would look pretty choppy though. You could (though I have not gotten it to work yet) simply change between behaviours. A unit "walking" in AWARE is faster than a unit "walking" in SAFE. Have the groups alternate behaviours, so the followed group can pace up, then slow down and the following group can catch up...

I hope that wasn't too difficult to understand ;)

Cheers
PiLLe