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; // 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
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.
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?)