Jump to content


Photo

Tank Turrets in BFME2


  • Please log in to reply
25 replies to this topic

#1 Hostile

Hostile

    Benefitting Humanity Simply by Showing Up!

  • Veterans
  • 9,551 posts
  • Location:Washington DC
  •  T3A Founder
  • Division:Revora
  • Job:Global Administrator
  • Donated
  • Association

Posted 05 April 2006 - 06:40 PM

Maybe it's a dream come true, but it comes a few years too late. Perhaps it's a sign of things to come for RA3. What I do know is we not only have access to 3 turrets per vehicle, we can now set firing arcs for these turrets.

This would have been great for BSG. But never the less, here it is. Found in the cinimatic object folder named "tank" This portion of code set up the turrets as weapons. Notice you have to place new public bones for the turrets, these bones should be the name of the mesh that makes up the seperate turret object.

This tankdraw module tel the unit that this unit will have turrets. It also sets up the tread FX.

;	Draw = W3DTankDraw ModuleTag_01
;		OkToChangeModelColor	= Yes
;		ExtraPublicBone		 = Turret01
;		
;		DefaultModelConditionState
;			Model			   = NVBtMstr
;			Turret			  = Turret01
;			
;;; Use these to set up secondary and tertiary turrets;;;
;			SecondaryTurret		= Turret02
;			TertiaryTurret		= Turret03
;;; --------------------------------------------------;;;

Here is where the new magic begins, you can restrict the firing arc and the starting turret angle. Why is this important you ask? Because you can now make a WWI tank that has a machine gun turret on each side and limited to only firing to each side within a limited firing arc.

Or you could have a bunker that limits it's firing arc. Or perhaps a spaceship where the turrets are mounted on the sides and should not be able to fire through itself. Many uses for this gift from EA.

;	Behavior = AIUpdateInterface ModuleTag_03
;		AutoAcquireEnemiesWhenIdle = Yes
;		Turret
;			TurretTurnRate = 180; turn rate, in degrees per sec
;			TurretPitchRate = 30; does not pitch
;			ControlledWeaponSlots = PRIMARY
;			
;;;; Use these to restrict the firing arc of the turret;;;
;;			NaturalTurretAngle = 0; Natural angle of the turret relative to the front of the object
;;			TurretMaxDeflectionCW = 90; Maximum deflection of the turrect clockwise from the natural turret angle
;;			TurretMaxDeflectionACW = 90; Maximum deflection of the turrect anti-clockwise from the natural turret angle
;;;; --------------------------------------------------;;;
;			
;		End
;				
;;;; Use these to set up secondary and tertiary turrets;;;
;;		SecondaryTurret
;			TurretTurnRate = 180; turn rate, in degrees per sec
;			TurretPitchRate = 30; does not pitch
;			ControlledWeaponSlots = SECONDARY			
;		End
;
;		TertiaryTurret
;			TurretTurnRate = 180; turn rate, in degrees per sec
;			TurretPitchRate = 30; does not pitch
;			ControlledWeaponSlots = TERTIARY
;		End
;;; --------------------------------------------------;;;

How this can be used for BFME2? Only you can tell me... (can you say, mounted archers that fire while moving and not shoooting behind themselves :p )

#2 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 05 April 2006 - 09:30 PM

can you say, mounted archers that fire while moving and not shoooting behind themselves :p


or bombard ships that dont have to stop to shoot :p

awesome information, where did you get it?
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#3 Hostile

Hostile

    Benefitting Humanity Simply by Showing Up!

  • Veterans
  • 9,551 posts
  • Location:Washington DC
  •  T3A Founder
  • Division:Revora
  • Job:Global Administrator
  • Donated
  • Association

Posted 05 April 2006 - 11:22 PM

I looked for the tank unit that appeared in a late patch in BFME1. That introduced turrets back into the SAGE engine.

#4 ched

ched

    .

  • Undead
  • 4,431 posts
  • Location:Angers (France)
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member
  • Division:BFME
  • Job:Previous Division Leader

Posted 06 April 2006 - 03:03 PM

and I quote, from the BfME I 1.03 turretAI.cpp

F:\bfme\Code\gameengine\Source\GameLogic\Ai\TurretAI.cpp



TurretStateMachine
FiresWhileTurning
InitiallyDisabled
RecenterTime
MaxIdleScanInterval MinIdleScanInterval
MaxIdleScanAngle MinIdleScanAngle
AllowsPitch
ControlledWeaponSlots
TurretSweepSpeedModifier
TurretFireAngleSweep
GroundUnitPitch MinPhysicalPitch FirePitch NaturalTurretPitch
NaturalTurretAngle
TurretPitchRate TurretTurnRate
TurretMoveLoop
TurretAIIdleState TurretAIAimTurretState
TurretAIRecenterTurretState AIHoldTurretState TurretAIHoldTurretState


couldn't be arsed to organise it, just know that those are the possibilities :lol:
Software is like sex; it's better when it's free ~Linus Torvald

#5 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 07 April 2006 - 06:34 PM

where did you get the source code?
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#6 Hostile

Hostile

    Benefitting Humanity Simply by Showing Up!

  • Veterans
  • 9,551 posts
  • Location:Washington DC
  •  T3A Founder
  • Division:Revora
  • Job:Global Administrator
  • Donated
  • Association

Posted 08 April 2006 - 12:52 AM

Use the hex editor and open game.dat with it. Than do search.

#7 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 08 April 2006 - 09:41 AM

ok, but this:

F:\bfme\Code\gameengine\Source\GameLogic\Ai\TurretAI.cpp


??
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#8 ched

ched

    .

  • Undead
  • 4,431 posts
  • Location:Angers (France)
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member
  • Division:BFME
  • Job:Previous Division Leader

Posted 10 April 2006 - 04:48 PM

it's mentionned in game.dat as well, don't think I've just decompiled the whole source code :D
Software is like sex; it's better when it's free ~Linus Torvald

#9 Master Windu

Master Windu

    The Master.

  • Advisors
  • 2,150 posts
  • Location:Houston, Texas
  • Projects:Galaxy at War, Rhovanion Alliance
  •  T3A Team Chamber Member

Posted 17 April 2006 - 04:18 AM

A question: is it possible to have one unit firing two shots, one out of one bone and one out of another bone? Like two weapons on the same model but identical. (a guy with two guns)

Also, I know theres something you do to stop your hero from disappearing when he uses balrog jump, but I cant remember what it was. Thanks
Posted Image
Posted Image

#10 Hostile

Hostile

    Benefitting Humanity Simply by Showing Up!

  • Veterans
  • 9,551 posts
  • Location:Washington DC
  •  T3A Founder
  • Division:Revora
  • Job:Global Administrator
  • Donated
  • Association

Posted 17 April 2006 - 06:27 AM

#1 yes each turret will fire independant of each other.
#2 I don't understand the question.

#11 Master Windu

Master Windu

    The Master.

  • Advisors
  • 2,150 posts
  • Location:Houston, Texas
  • Projects:Galaxy at War, Rhovanion Alliance
  •  T3A Team Chamber Member

Posted 17 April 2006 - 03:38 PM

How would I create another turret? I tried, but it doesnt work, he just shoots two out of one bone. I want him to shoot one out of the B_HANDR bone, and one out of the B_HANDL.

#2. When I use the balrog jump ability for my hero, he disappears and isnt able to be respawned. I know someone posted this error sometime ago but I cant remember what it was. Does anyone know how to prevent him disappearing? (I think it is like inser this in the behavior: 'DeathUponImpact = No' but I searched game.dat and it didnt come up with anything like it).
Posted Image
Posted Image

#12 Master Windu

Master Windu

    The Master.

  • Advisors
  • 2,150 posts
  • Location:Houston, Texas
  • Projects:Galaxy at War, Rhovanion Alliance
  •  T3A Team Chamber Member

Posted 17 April 2006 - 04:15 PM

I tried it again and it doesnt work....can you set up a faramir.ini where he shoots one arrow/projectile out of B_HANDR and one out of B_HANDL ? I cant get it to work
Posted Image
Posted Image

#13 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 17 April 2006 - 08:29 PM

faramir got surgery? does he have two little crossbows in his hands ;)
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#14 Hostile

Hostile

    Benefitting Humanity Simply by Showing Up!

  • Veterans
  • 9,551 posts
  • Location:Washington DC
  •  T3A Founder
  • Division:Revora
  • Job:Global Administrator
  • Donated
  • Association

Posted 17 April 2006 - 09:59 PM

How would I create another turret? I tried, but it doesnt work, he just shoots two out of one bone. I want him to shoot one out of the B_HANDR bone, and one out of the B_HANDL.

#2. When I use the balrog jump ability for my hero, he disappears and isnt able to be respawned. I know someone posted this error sometime ago but I cant remember what it was. Does anyone know how to prevent him disappearing? (I think it is like inser this in the behavior: 'DeathUponImpact = No' but I searched game.dat and it didnt come up with anything like it).

Well each turret is a separate weapon. It sounds like a coding typo or something. You simply name the mesh and it rotates and fires.

#15 Master Windu

Master Windu

    The Master.

  • Advisors
  • 2,150 posts
  • Location:Houston, Texas
  • Projects:Galaxy at War, Rhovanion Alliance
  •  T3A Team Chamber Member

Posted 17 April 2006 - 10:33 PM

I think thats the problem, can it be a bone?
Posted Image
Posted Image

#16 Hostile

Hostile

    Benefitting Humanity Simply by Showing Up!

  • Veterans
  • 9,551 posts
  • Location:Washington DC
  •  T3A Founder
  • Division:Revora
  • Job:Global Administrator
  • Donated
  • Association

Posted 17 April 2006 - 10:33 PM

It can be a mesh or a bone. As long as it's defined the game doesn't care. ;)

#17 Master Windu

Master Windu

    The Master.

  • Advisors
  • 2,150 posts
  • Location:Houston, Texas
  • Projects:Galaxy at War, Rhovanion Alliance
  •  T3A Team Chamber Member

Posted 19 April 2006 - 01:49 AM

Thats so weird....now it still doesnt work. I tried using bone and mesh objects, but it still doesnt work. If you wouldnt mind would you post the code that I would need to insert into my Faramir.ini to make it work. (The two objects that should be firing from are GUNR and GUNL).
Posted Image
Posted Image

#18 Hostile

Hostile

    Benefitting Humanity Simply by Showing Up!

  • Veterans
  • 9,551 posts
  • Location:Washington DC
  •  T3A Founder
  • Division:Revora
  • Job:Global Administrator
  • Donated
  • Association

Posted 19 April 2006 - 02:44 AM

First of all I don';t have the time. Second why would you use turret logic for infantry. Maybe that's the whole issue? Tankdraw module is not made for infantry KindOf.

#19 Master Windu

Master Windu

    The Master.

  • Advisors
  • 2,150 posts
  • Location:Houston, Texas
  • Projects:Galaxy at War, Rhovanion Alliance
  •  T3A Team Chamber Member

Posted 19 April 2006 - 10:15 PM

Well, the point is I changed him to Jango Fett, and he is only firing out of one blaster pistol. If I changed his KindOf to something that supports tank logic, would it have any other side effects?
Posted Image
Posted Image

#20 Hostile

Hostile

    Benefitting Humanity Simply by Showing Up!

  • Veterans
  • 9,551 posts
  • Location:Washington DC
  •  T3A Founder
  • Division:Revora
  • Job:Global Administrator
  • Donated
  • Association

Posted 19 April 2006 - 11:28 PM

Infantry and turret logic do not work together. Simply use new firing bones for your weapon slots. Two differant beasts entirely.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users