multiple tank paths.....

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
grb
Warrant Officer
Posts: 136
Joined: Fri Jun 06, 2003 12:22 am
Location: USA Philadelphia

multiple tank paths.....

Post by grb »

two part question:

Q1. Can someone tell me if one can set up multiple waypoint paths (groups of waypoints), where a tank can be told to drive to a given
waypoint then change course on another set of waypoints.
For instance lets say I have five waypoints assigned to the tank (I know how to do this....and then after the tank reaches the last waypoint....come to a complete stop (treads stop moving etc.......no problem can do), then
lets say fire on a flak gun.
Then ...once the flak gun is destroyed, back up the tank to some designated waypoint on the FIRST set of waypoints it has traveled forward on..................then change paths and move to another area of the map, to do other things.

So ....if you where to look at my map, you would see a number of green paths for a given set of waypoints assigned to the given tank. These paths can touch at some point....have no problem with that BUT then diverge to another part of the map. Or put another way..... have a number of BRANCHED waypoint paths for the tank to maneuver around by various scripts, based on on current conditions within the mission.


Q2. What is the best way to script a tank so that once the turret stops moving...........where I tell the tank to "setaimtarget $some_object",
THEN and only THEN, fire at the target?
I know how to aim the tank turret at objects and then fire at them. That
is no problem.
But my problem is...for realism, I would like to have the tank only fire on the object once it's barrel is sighted directly on the center of the target.

So far, I have just been adding adequate amounts of time delay so that the turret will line up with target before I tell it to fire. Obviously this is a lousy way to do it.
Please do not respond with things like "well use cansee" because cansee
is based on a wide field of vision that apparently we cannot shave down to look less then a degree from center, etc..

Thanks for any help on these two questions.
grb
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

Q2 is simple: $gun waittill ontarget

Q1:

When you say backup, do you mean drive backwards, or turn around? If you want it to drive backwards, make it drive to the last waypoint on the path it used to come there, put for the speed, a negative number.

OK, lets see... lets say you got the tank driving path $a. path $a leads to a fork in the road. what you could do is make the end of path $a right at the junction, and then use some scripting like this...

Code: Select all

$tank drive $a 128 32 256 256
$tank waittill drive

if (level.goright == 1)
{
    $tank drive $a_branchright 128 32 256 256
}
else
{
    $tank drive $a_branchleft 128 32 256 256
}
$tank waittill drive
//do whatever you want here
grb
Warrant Officer
Posts: 136
Joined: Fri Jun 06, 2003 12:22 am
Location: USA Philadelphia

Thanks for fast response Alcoholic!

Post by grb »

You asked "When you say backup, do you mean drive backwards, or turn around?"
Answer: Both ways. Thanks I know how to put it in reverse using negative values assigned to variables such as level.slowspeed_rev et..
And I understand in principal how your code works. THANKS....

Now if I may........

Could you please give me a description on what each of the elements in the argument section mean for:
$tank drive $a 128 32 256 256


__________________________________________________________
What I have been doing is:
In MAP make a number of wapoints targeting each proceeding one. EX:
$tank_path targets $tank_path1 targets $tank_path2 etc.

Then as mentioned in original question, tell tank to drive to $tank_path which makes it move through the series of wappoints just mentioned.

Now what I believe you are telling me is that where $tank_path2 is located...... I could then put in the map another set of waypoints a little distance from $tank_path2......called lets say...... $a_branchright
for instance. Then tell the tank to drive to that waypoint and of course any others that may be targeted by it, in a sequence of waypoints?
----------------------------------------------------------------------------------

IS this correct Alcoholic?
IF so, this is really great! If my wording is not sufficient to bring out the question properly please bear with me.....I will try to re-word it.

And thanks for the answer to Q1 ..... I am sure it will work just fine!

While I at it...............forgive me.... you got me a bit excited with these answers................HOW would you make the tank just pivot around it's
center?

cheers
grb
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

hmm, i dont think there is any REAL way of making it do that... one thing you could try is this:

$tank rotatezdown 180 //down or up

$tank time 6 //guarantees 6 seconds to turn

-OR-

$tank speed 100 //doesnt guarantee time, guarantees speed
$tank loopsound "whateverthattankmovingsoundis"
$tank waitmove //or move
$tank stoploopsound

i dont know how your gonna do animating wheels, maybe you can swap models with one that has rolling wheels..
grb
Warrant Officer
Posts: 136
Joined: Fri Jun 06, 2003 12:22 am
Location: USA Philadelphia

Thanks Alcoholic...

Post by grb »

I will test out the various solutions you have offered. Thank you for such
quick responses.

best regards....
grb
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

no problem. :wink:
Post Reply