Tripwire Interactive Forums

Go Back   Tripwire Interactive Forums > Red Orchestra: Ostfront 41-45 Forums > Red Orchestra Modifications > Coding

Reply
 
Thread Tools Display Modes
  #1  
Old 11-08-2006, 12:04 AM
ToiletDuckie ToiletDuckie is offline
Member
 
Join Date: Aug 2006
Posts: 59
Default Tank/Vehicle Hud implementation question

Tanks, as I'm sure you've all seen, have a nice little HUD in the lower left corner that displays the turret's position relative to the vehicle itself.

On the other hand, vehicles such as the BA and Halftrack have no such useful feature.

On a whim, I was/am attempting to change this on a BA64.

The code here is.. for lack of a better term, too simple to not work (which it doesn't for me.. which is why I'm posting.. heh).

ROWheeledVehicle has most of the HUD code, such as what vehicle icon to display and where to place it, etc. ROTreadCraft extends this ever-so-slightly. It adds

var TexRotator VehicleHudTurret;
var TexRotator VehicleHudTurretLook;

var float VehicleHudThreadsPosX[2]; // 0 = left thread, 1 = right thread
var float VehicleHudThreadsPosY; // both threads always draw at same Y pos
var float VehicleHudThreadsScale; // both threads always draw with same scale

which I assume allow the IS2 turret icon to.. well, rotate, as TexRotator is implied to do. I'm not too sure about the float variables. This is all that is changed from ROWheeledVehicle to ROTreadCraft, Hud wise.

Dropping down one level to a specific tank, say an IS2, I see

VehicleHudImage=Texture'InterfaceArt_tex.Tank_Hud. IS2_body'
VehicleHudTurret=TexRotator'InterfaceArt_tex.Tank_ Hud.IS2_turret_rot'
VehicleHudTurretLook=TexRotator'InterfaceArt_tex.T ank_Hud.IS2_turret_look'
VehicleHudThreadsPosX(0)=0.38
VehicleHudThreadsPosX(1)=0.63
VehicleHudThreadsPosY=0.505
VehicleHudThreadsScale=0.72
VehicleHudOccupantsX(0)=0.5
VehicleHudOccupantsX(1)=0.5
VehicleHudOccupantsX(2)=none
VehicleHudOccupantsY(0)=0.3
VehicleHudOccupantsY(1)=0.45
VehicleHudOccupantsY(2)=none
bVehicleHudUsesLargeTexture=true

Which make sense. You have your standard wheeled vehicle HUD stuff (such as what the BA has), which is the HUD image and VehicleHudOccupants, which are the dots you see on the HUD representing player locations in the vehicle. This leaves the variables defined in ROTreadCraft, whose function isn't fully understood by me. Still, there's data there.

Now, if the only difference between a wheeled vehicle hud and a treaded vehicle hud is ~5 variables, why is it that when I added those variables to a BA64's code, as well as the values for those variables ripped directly from the IS2 code, that I don't see a turret? I didn't see any functions/etc. in TreadVehicle or IS2 code that used these variables, so its not like there's a magical function necessary to make them "work" (though I might have missed it). There shouldn't be any "BA to IS2" hud incompatibility, since I ripped all of the BA HUD data out and replaced it with the exact data held in the IS2 file.

Yet, when I jump in my BA, I see the IS2 tank body, the "clock ring" around it, and no turret icon. I run over to my IS2, and the turret is there and accurated twisting around on the HUD.

Any ideas?
Reply With Quote
  #2  
Old 11-10-2006, 12:31 PM
UncleDrax's Avatar
UncleDrax UncleDrax is offline
Senior Member
 
Join Date: Oct 2005
Location: Florida, USA
Posts: 1,475
Default

Off hand, maybe the code that does turret rotation looks to see if the parent vehicle is a ROTreadCraft (or whatever the class is called).. then it does all the hud mumbo jumbo..
?

(No idea really.. does it do this if you change the parent class of the BA64 you are modifying?)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:17 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2005 - 2013, Tripwire Interactive, LLC