Jump to content
Sign in to follow this  
vulcan

Multiple supports

Recommended Posts

if I have a tank out of fuel and a vulcan out of fuel, (support truck has support wp) how do i make the AI driver fuel the tank and then go to the vulcan and fuel it, then return to the fuel station?? ???

Share this post


Link to post
Share on other sites

You can use the "setWPPos" -method to dynamically set waypoint position. Try for example the following:

name of the tank: WTank1

name of the fuel truck: WTruck1

Fuel truck's first waypoint is of type "SUPPORT"

[WTruck1,1] setWPPos (getPos WTank1)

This could be executed by a trigger that meets the condition:

(fuel WTank1) == 0

Again, it should be noted that only one vehicle at a time executes the script. Otherwise another vehicle (here, Vulcan) might "steal" the support truck before it even gets to the tank... One solution to this might be to use a boolean variable to indicate if support truck is already reserved. Or maybe playing around with synchronization?

Share this post


Link to post
Share on other sites

Hmmm, can't it be done by giving the truck just 3 Waypoints? First one for supporting the tank, second one for supporting the Vulcan and the third for moving back to the fuel Station???

Share this post


Link to post
Share on other sites

Of course, if the two vehicles are already out of fuel. The above script can be used when it is not known beforehand which vehicle runs out of fuel first. I mean, WTruck1 waits near fuel station and goes for the support mission only when some vehicle is requesting it. I have a habit to see everything in more complicated way smile.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×