Code: Select all
ObjectTemplate.crossHairIcon "Example.tga"
While it functions correctly for soldier handweapons, it does not work on PlayerControlObjects or FireArms, thus vehicles can't seem to use it. That is until I did this tweak to the meme file for the ingame HUD.
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
![Image](http://img109.imageshack.us/img109/7799/crosshairr.jpg)
(note the use of the CullNode, what I put in there tells the game whether or not the player is in a vehicle. If you fail to include this, the crosshair will be visible all the time no matter where you are or in. So don't forget that!
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
When used in that combination it enables the command to work on vehicles. (add the command to the main PCO, NOT the the firearm object(s) used on the PCO, or else it won't work)
The the new transform node I created could also be altered to instead allow full screen HUDs for vehicles instead of a crosshair. Just change the size of the transform node to 800x600 and use a TGA file matching that size. (then if you still want to use a custom crosshair on some vehicles while keeping a fullscreen HUD on others, then you can create a crosshair texture with the small crosshair in the center of the image. But the tga resolution must remain at 800x600. Resizing it will only alter the detail of the texture that fills the screen since the transform node is what defines how much screenspace a image takes up)
The only drawbacks to using this is that once enabled in the hud, you have to add this to any vehicle that you decide not to use a custom crosshair on (that includes passenger positions):
Code: Select all
ObjectTemplate.crossHairIcon "Empty.tga"
Also, the custom crosshair added via this method (or HUD depending on how you want to use it), will not vanish if you change camera views on the vehicle. For example, you use C key to switch to nose cam or flyby. The custom crosshair will remain on the screen. I may perhaps find away to use a CullNode to fix this, but I would have to determin how the game knows when a soldier is using a external camera view. (since on soldiers when switching camera views, the crosshair vanishes properly)
If I manage to refine this further, I will post updates on it.
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
EDIT:
Ok small revision. The new transform node should be created in the very first split node you see in the ingame meme file and not placing it as the very last node in the file. Since I discovered that having it on the bottom would mean having the image (if you had chosen to use it as a fullscreen HUD image) obscure all other hud elements like minimap, health, ammo, and so on. So instead, put it on the very first splitNode. (that node is also where the other crosshairs are stored anyway, so it's the best place to have it anyway)
Also if you decide not to use this for a fullscreen hud and just want to enable custom crosshairs on vehicles, then this will work better:
![Image](http://imageshack.us/a/img18/7103/vehiclecrosshairs.jpg)
(as mentioned above, place transform node on first splitNode in file, and not at the bottom like in this image)
This fixes the crosshair so that it will disappear correctly when changing camera mode to an external view (except nose cam, since crosshair will remain in place in that view). But as a result it will ignore the size/position settings of the transform node it's on and instead inherit the position/size of the first instance of the crosshair CullNode which is the version used on soldiers. This means it can't be used as a fullscreen hud with this method. I think in vanilla BF1942 the crosshair's original size/position is smaller, thus you'll need to make it larger and recenter it if you wish to use a more detailed crosshair image that is larger then the original vanilla crosshair. This second method also means that you won't have to define an empty crosshair for all the vehicles in your mod that don't use the CHTIcon type or is set to CHTNone. Since with that extra cullNode info it can now determine whether or not to display the cross hair icon by reading the crossHairType command used on all the vehicles. I removed the picture node since it seems to also be inheriting the original picture node from the soldier version of the crosshair (since after I added that new CullNode, I noticed there being two crosshairs on screen instead of one, so I removed the picture node and fixed that.
![Razz :P](./images/smilies/icon_razz.gif)
In my BFH'42 mod, the crossHairIcon is set to 64x64 size and positioned at 368x268 which is exact center of screen for a 64x64 size element. Thus you can use that size and position to alter the soldier's version so that your vehicle crosshair also has the matching size.
The original transform node that the game uses to govern the crosshair size/psoition is the very first transform node in the very first splitNode in the file. It should not be hard to miss. Adjust that to increase size/detail of the crosshairs for both soldiers and vehicles that use the CHTIcon crosshair type.
Now that I think about, all it took to fix custom crosshairs for vehicles was two cullNodes under a second transformnode (or splitNode as that node type will work for this too). Guess EA got real lazy with the HUD coding and never properly fixed the crosshair command for PCOs.
![Razz :P](./images/smilies/icon_razz.gif)