OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Sn0wBaLl on 14 Apr 2003, 19:37:04

Title: tank's canon's direction
Post by: Sn0wBaLl on 14 Apr 2003, 19:37:04
Hi all nice site, 1st post in here. Good Job!


I  just wanna know how to put an empty tank, like an  Abrams, and then put the canon's aiming direction like faicing east, when the main body of the tank is facing north...how can I move it around the tank.

I know its possible with a WEST tank, with doTarget and doFire, but Ive seen a lot of maps on GS with empty tanks at the start with the canon move


some1 know how to rotate the canon of an EMPTY tank ?

ThX guys :)
Title: Re:tank's canon's direction
Post by: macguba on 14 Apr 2003, 19:54:13
If you've seen it somewhere you should un-pbo the mission and see how it was done.

I don't know how they did it, but what you could do is create a west tank (say), give it a dotarget command and then immediately deleteVehicle the crew.     Crews are automatically named after the vehicle, so if you named the vehicle tank1 the crew would be tank1D, tank1C and tank1G.

If you're not sure how to use the deleteVehicle command check it out in the Command reference in the Ed Depot.

Oh, and

Welcome to the forum!
Title: Re:tank's canon's direction
Post by: DrStrangelove on 15 Apr 2003, 20:17:54
Close to the topic (i think): I use the artillery object for my mission but it has no AI, so i guess it can't aim at a gamelogic. Is there a way to set the elevation of the gun with a normal command ?
Title: Re:tank's canon's direction
Post by: Sn0wBaLl on 15 Apr 2003, 21:19:31
Some1 found it n reply to me on another forum.

Here's what it look like:

1-create an empty M1A1 Abrams, name it "tank1"

2-create a barel and name it "barel1"

3-create a soldier, name it "sol1" and on its Init box type:

   sol1 moveingunner tank1; sol1 dowatch barel1; sol1 dotarget barel1;

4-create a trigger, Activation: West, present

condition: this

onActiv.:sol1 setpos(getpos barel1);[[sol1]] exec "del.sqs";


create the script an name it 'del.sqs'

_v0 = _this select 0


_t=0
_n=count _v0

#loop
~0.01
_ck=_v0 select _t
deletevehicle _ck
_t=_t+1
? _t>_n:exit
goto "loop"


That should be it, it take a certain time (3-4 seconds) before the canon rotate, but it's nice.

Thx to xaviernator  ;)