Home   Help Search Login Register  

Author Topic: Tank turrets  (Read 789 times)

0 Members and 3 Guests are viewing this topic.

Offline Grizzlie

  • Members
  • *
Tank turrets
« on: 28 Aug 2003, 14:40:00 »
Hello.
I'm looking for script which would allow each tank in platoon have it's turret turned in other direction (each 90 deg) in "SAFE" mode. Something like this is in "COMBAT" mode, but in this one tanks do not use roads :(

zsa_zsa_rasputin

  • Guest
Re:Tank turrets
« Reply #1 on: 28 Aug 2003, 15:12:28 »
Do you mean so that all directions are covered?

Ie - the front tank faces forwards (0 degrees), the next tank faces right (90 degrees) , another tank faces rearward (180 degrees), and the left tank faces left (270 degrees)?

Because ideally this would most suit a diamond formation - which you can't have in OFP :(
Is it for a cutscene (Easier to implement cheating things out of camera view)
Or for in the game?

Dan ;D

Offline Grizzlie

  • Members
  • *
Re:Tank turrets
« Reply #2 on: 28 Aug 2003, 15:23:09 »
Almost this way :)
But 0, 90, 270, 180 - last tank with turret back.

I was thinking about somekind of  "parade" for player, and tanks with turrets like it looks much more impressive :)

zsa_zsa_rasputin

  • Guest
Re:Tank turrets
« Reply #3 on: 28 Aug 2003, 15:32:27 »
so it would be more of a mission completed cutscene?

Dan ;D

Offline Grizzlie

  • Members
  • *
Re:Tank turrets
« Reply #4 on: 28 Aug 2003, 16:01:59 »
Yes.
Other idea is to fly in chooper over them during mission.

SheepOnMintSauce

  • Guest
Re:Tank turrets
« Reply #5 on: 28 Aug 2003, 17:17:01 »
Set them to 'dowatch' targets to either side of them while they're moving in a line formation.

Using my best ASCII art... uhem..  ;D
                     

                           3  

                            |
1         -0       0      0    0-             4
                    |

                   2

Make the targets (2, and 3) move along side the 2nd and 3rd tanks using get pos and set pos, while the 1st and last tank target 1 and 4 infront and behind the convoy of tanks.  :)

It should work in theory anyway.
« Last Edit: 28 Aug 2003, 17:17:26 by SheepOnMintSauce »

Bruce Banner

  • Guest
Re:Tank turrets
« Reply #6 on: 28 Aug 2003, 17:22:56 »
Turrets should be 'gun rear' and the gun in a crouch when in 'safe' mode moving on roads in rl or in hangers.

My 20cents worth

Offline Grizzlie

  • Members
  • *
Re:Tank turrets
« Reply #7 on: 28 Aug 2003, 18:39:41 »
@Bruce Banner
I know, but in OFP there is only one mode tanks do use roads - it is "safe" mode...
@SheepOnMintSauce
It is too high level for me :\

Offline KJAM

  • Contributing Member
  • **
  • Why Me, Whats it For?
    • Nightstalker mod
Re:Tank turrets
« Reply #8 on: 28 Aug 2003, 18:49:05 »
well maybe yo could do it in a column formation i.e

front tank covers the front
2nd tank covers left
3rd tank overs right
last tank covers rear

Offline Wadmann

  • OFPEC Patron
  • ****
  • I'm the next evolutionary step after a llama!
Re:Tank turrets
« Reply #9 on: 28 Aug 2003, 21:33:35 »
I saw this on the official forums today. I have not tried it and it seems a little too simple to work but give it a try and see for yourself:

Quote
Eaglesionu
..



Group: Members
Posts: 16
Joined: May 2003  Posted: Aug. 27 2003,19:53  

--------------------------------------------------------------------------------
Well guys, i hope no one has placed a fix for this problem before, but im here if not.

The problem occurs with any turret type gun in a multiplayer mission.  The Turret (mostly visible on tanks) always points to the north.  This is a known bug, and is present through Resistance.  

My Friend had asked me if i could fix it, and i made a simple script, that is pretty easy, and works.  

****MAKE SHURE THE TANK IS POINTING NORTH IN YOUR MISSION EDITOR!!!!********

Code Sample  

;=======Turret.sqs=======
;=======By Eagle=======

;Execute with the name of the tank you want to use, and the dirrection you want it to end up at....... [yourtank1, yourtank2, dir] exec "turret.sqs"

_tank = _this select 0
_tank2 = _this select 1
_dir = _this select 2

~.50

_tank setdir _dir
_tank2 setdir _dir

exit
 


This script is simple, it lets the game load up with the tank pointing north (hence the turret will be lighned up with the front of the tank.)  Then a half a second into the game it moves the tank to your wanted dirrection.  Verry easy, verry simple.  

This is only set up for 1 or 2 tanks, if you need more, and dont know how then just post here, or e-mail me and i will be happy to help.

Just my way of doing things, hope this helps someone.

Eagle
 

It appears to me that this script will set the direction of the vehicle itself, not just the turret as the script name implies. Try it and let us know if/how it works!

                               Wadmann
Check out my Camouflage Collection! New items added 31 July 2005.

Offline Grizzlie

  • Members
  • *
Re:Tank turrets
« Reply #10 on: 28 Aug 2003, 23:40:03 »
:(
It does not work.
It sets direction of the tanks, but a sec later this is overwritten by default settings.
I mean in "safe" mode, because in "combat" mode turrets r in different directions 0, +45, -45, 180 degrees.
Maybe it works in MP mode...

SheepOnMintSauce

  • Guest
Re:Tank turrets
« Reply #11 on: 29 Aug 2003, 00:26:05 »
You were right, it turns the tanks to face the direction you specify.

I have been playing around with a script to make the turrets point in the right direction, so far though I've had minimal success. It's possible to do it though. Here is my script so far.

Code: [Select]
;First get the names of the four tanks in order.

_Tank1 = _this select 0
_Tank2 = _this select 1
_Tank3 = _this select 2
_Tank4 = _this select 3

;Next create the objects that will act as each tanks' target.
;Place first target infront of tank 1, to the right of tank 2,
;to the left of tank 3, and to the rear of tank 4.

_Target1 = "Barrel1" camcreate [(getpos _Tank1 select 0),(getpos _Tank1 select 1)-25,1]
_Target2 = "Barrel1" camcreate [(getpos _Tank2 select 0)-25,(getpos _Tank2 select 1),1]
_Target3 = "Barrel1" camcreate [(getpos _Tank3 select 0)+25,(getpos _Tank3 select 1),1]
_Target4 = "Barrel1" camcreate [(getpos _Tank4 select 0),(getpos _Tank4 select 1)+25,1]

;Now to make the tanks target their units.

_Tank1 dotarget _Target1
_Tank2 dotarget _Target2
_Tank3 dotarget _Target3
_Tank4 dotarget _Target4

;Now to make sure the targets never move from their position relative to their tank.

#loop
_Target1 setpos [(getpos _Tank1 select 0),(getpos _Tank1 select 1)-25,1]
_Target2 setpos [(getpos _Tank2 select 0)-25,(getpos _Tank2 select 1),1]
_Target3 setpos [(getpos _Tank3 select 0)+25,(getpos _Tank3 select 1),1]
_Target4 setpos [(getpos _Tank4 select 0),(getpos _Tank4 select 1)+25,1]
~0.1
goto "loop"

It's all well and good, but I don't think the tanks like to target anything while their behaviour is 'safe'. Also this script will camcreate barrels (can be changed to another object easily) in different positions around each of the four tanks. The script works just how I wanted it to if the road you use it on is straight. If not that where my problem lies.

If a tank is targetting a barrel behind it, it's all well and good. But in 'safe' it's not possible, and in 'combat' you swirve all over the road. I'm not even sure if you can target in 'safe' either. I tried and couldn't get it to target anyway. I think it only will if the target is enemy, in which case the tank won't be in 'safe' anymore.

I had a go anyway and came up with this screen shot for my troubles.  ;)





« Last Edit: 29 Aug 2003, 00:30:19 by SheepOnMintSauce »

zsa_zsa_rasputin

  • Guest
Re:Tank turrets
« Reply #12 on: 29 Aug 2003, 01:13:39 »
ok...
So there are a number of problems here...
A> Tanks won't follow roads unless they're in safe or careless mode...
B> But in safe and careless they wont target...
C> I'm guessing you want the crew "in" the tank as if in combat mode rather than all exposed? Which they won't be in combat mode...?

How about making the tanks SAFE so they follow the roads...  Then get the gunner of the tank just LOOK at the targets rather than target them?
Perhaps in a perpetual loop so they don't look once and then look back forwards again...?

I'm not sure how you'd designate a certain unit inside a vehicle but you could make a looping script using the "Unit1Name DoWatch Unit2Name" command...?

Not too sure about getting them in the tank - I think you can just get the commander of the group to order them in though... Although maybe this might set them into Combat mode???
Anyway - you might have to put up with them outside the tank...

What do you think? Try it? Did it work? (I like to think I SOMETIMES help!!!) :/

Dan ;D

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:Tank turrets
« Reply #13 on: 29 Aug 2003, 14:22:28 »
Can't test this at the moment, but I believe tankN crew become tankND (Driver), tankNG (Gunner) and tankNC (Commander).

So, what happens if you tankNG SetDir bearing?  Does the turret swing to the gunners SetDir?

Or, better, tankNG SetDir (GetDir tankN + angle) where angle is the +90, -90, -180 for the direction you want to cover.

SheepOnMintSauce

  • Guest
Re:Tank turrets
« Reply #14 on: 29 Aug 2003, 20:25:31 »
Well in my script I tried (gunner _Tank1) dotarget _Target1, but it seems that doesn't work. Also with getting the tanks to target the barrels like that when the tank turns the barrel doesn't so if the turret did move it'd then be pointing in the wrong direction.

I think the tank won't target in 'safe' mode because the driver is 'turned out' so the turret can't turn (else it'd squish his head. :P) I'm not sure if it's possible to turn the driver and commander in, in 'safe' mode. But if you can, then that might work.

It probably involves a lot of tinkering about with.  :-\

Oh yeah, I forgot to mention..

Quote
I'm not sure how you'd designate a certain unit inside a vehicle but you could make a looping script using the "Unit1Name DoWatch Unit2Name" command...?

I did try using 'dowatch' zsa_zsa_rasputin, but the whole tank turned towards it's target not just the turret. So, nope it didn't work for me  :(
« Last Edit: 29 Aug 2003, 20:31:12 by SheepOnMintSauce »