Jump to content
Sign in to follow this  
scottdog62

getting a tank drive over an obstacle

Recommended Posts

I want a tank to just move straight and drive over an obstacle, It does if i put the waypoint to careless(i dont want the crew to turn out) but i cant find any other way to do this, Is there a script to do this?
And also is there a charge script where infantry just charge at full speed and dont stop and cover and fire.

Share this post


Link to post
Share on other sites

I want a tank to just move straight and drive over an obstacle, It does if i put the waypoint to careless(i dont want the crew to turn out) but i cant find any other way to do this, Is there a script to do this?

Nope. Not possible. Unless you take command of the tank and drive it yourself (this makes sense for a mission admin in a MP mission, not for SP).
 
 

And also is there a charge script where infantry just charge at full speed and dont stop and cover and fire.

There is no perfect solution for this. But try the following:

_unit disableAI "FSM";
_unit disableAI "AUTOCOMBAT";
_unit disableAI "SUPPRESSION";
_unit setSpeedMode "FULL";

Share this post


Link to post
Share on other sites

Sorry i should have explained it better, I want the tank to drive over a dirt hump like it does in this video.
 

https://youtu.be/Mvjce5xZeBI

It seems setting the waypoint to careless does the trick, im just interested in a way to make the tank go straight and shoot.

Share this post


Link to post
Share on other sites

Sorry i should have explained it better, I want the tank to drive over a dirt hump like it does in this video.

 

https://youtu.be/Mvjce5xZeBI

It seems setting the waypoint to careless does the trick, im just interested in a way to make the tank go straight and shoot.

 

That looks great. I am actually surprised you got it working. Making AI move straight from point A to point B consistently is almost as difficult as landing on the moon.

 

If you're going for cinematic effect, you could [a] script continuous suppression fire. It would also be possible to  script the gun/coax to aim at the infantry and then fire.

 

Useful commands include: fireAtTarget, forceWeaponFire. (Try both and see which one works. In my experience fireAtTarget works well for vehicle guns/static weapons and forceWeaponFire works for infantry).

 

To make sure the gun is aimed at a target before it fires you would also need doWatch and aimedAtTarget, perhaps something like this:

_tank doWatch _target;
waitUntil {_tank aimedAtTarget [_target] > 0}; 
_tank fireAtTarget [_target];

fireAtTarget will only make the gun fire once. To force the tank to use the coax MG and fire in bursts, you need to designate the weapon to be used, and write a for loop for continued fire:

_weaponName = "something"; //change "something" to weaponName for the tank coax MG (You can get the current weaponName and muzzleName with weaponState)
_weaponMuzzleName = "something"; //change "something" to muzzleName for the tank coax MG, this might be the same as muzzleName.
_tank doWatch _target;
waitUntil {_tank aimedAtTarget [_target, _weaponName] > 0};

//A loop for burst fire 
for "_i" from 1 to 5 do {
    _tank fireAtTarget [_target, _weaponMuzzleName];
    sleep 0.1;
};

If any of these is confusing I also have a working script for making static MGs fire at targets in a trigger area. It should be easy to convert that for a tank coax gun. I'll see if I can find it later.

  • Like 1

Share this post


Link to post
Share on other sites

You could try using BIS_fnc_unitPlay, or a custom script using setVelocity to force the tank forward?

Share this post


Link to post
Share on other sites

 

That looks great. I am actually surprised you got it working. Making AI move straight from point A to point B consistently is almost as difficult as landing on the moon.

 

If you're going for cinematic effect, you could [a] script continuous suppression fire. It would also be possible to  script the gun/coax to aim at the infantry and then fire.

 

Useful commands include: fireAtTarget, forceWeaponFire. (Try both and see which one works. In my experience fireAtTarget works well for vehicle guns/static weapons and forceWeaponFire works for infantry).

 

To make sure the gun is aimed at a target before it fires you would also need doWatch and aimedAtTarget, perhaps something like this:

_tank doWatch _target;
waitUntil {_tank aimedAtTarget [_target] > 0}; 
_tank fireAtTarget [_target];

fireAtTarget will only make the gun fire once. To force the tank to use the coax MG and fire in bursts, you need to designate the weapon to be used, and write a for loop for continued fire:

_weaponName = "something"; //change "something" to weaponName for the tank coax MG (You can get the current weaponName and muzzleName with weaponState)
_weaponMuzzleName = "something"; //change "something" to muzzleName for the tank coax MG, this might be the same as muzzleName.
_tank doWatch _target;
waitUntil {_tank aimedAtTarget [_target, _weaponName] > 0};

//A loop for burst fire 
for "_i" from 1 to 5 do {
    _tank fireAtTarget [_target, _weaponMuzzleName];
    sleep 0.1;
};

If any of these is confusing I also have a working script for making static MGs fire at targets in a trigger area. It should be easy to convert that for a tank coax gun. I'll see if I can find it later.

Thanks

 

Yes everything is abit confusing to me at the moment.

But il keep trying to learn.

@ceebs

I'm not to sure how to work those...

What would i put in the init to make it just go forward in a straight path?

 

Share this post


Link to post
Share on other sites

Another video of what im trying to achieve.

 

 

It seems tanks will drive over dirt humps in careless mode, but they will not drive over every object, such as If44 squad trenches.
 

Share this post


Link to post
Share on other sites

i would do a script for that which is started by a trigger or waypoint.

u should not write all of that stuff in the init line.

in a script u could use the name of the tank as a global variable of it.

if ur tank is named TANK1 then u could use

_tank = TANK1;

and the local variable _tank represents ur TANK1.

same with _target.

name ur target TARGET1

and in the script u can do

_target = TARGET1

but u ve to learne some scripting for it as the init line is very limited...

Share this post


Link to post
Share on other sites

@ceebs

I'm not to sure how to work those...

What would i put in the init to make it just go forward in a straight path?

 

UnitCapture allows you to record an exact path of a vehicle. When played back, the vehicle follows the exact route and speed as was recorded. It's really meant to be used for helicopter insertions the AI pilots just can't do, but it also works with ground vehicles. The downside to this is the tank will not respond to any dynamic changes, such as friendly or immovable obstacles in the way. So it's generally used right at the start of a mission.

 

Getting this to work well will require scripting knowledge, forcing the AI to do anything they don't want to can be complex.  I will see if I can come up with something.

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  

×