Custom HUD - Multiple Reticules

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Custom HUD - Multiple Reticules

Post by lucasfart »

Just wondering, before I do too much work on a custom HUD, is it at all possible to use a different reticule mesh for individual weapons? So when one changes the current primary weapon, the reticule changes with it?
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Custom HUD - Multiple Reticules

Post by THEWULFMAN »

Using the standard method the stock game uses to display reticles? Nope, as to the best of my knowledge, but I'll just wait for Ace or Zerted to correct me. :P (I'm kidding, I'm just referencing the fact that while I may be capable, but I'm not all-knowing when it comes to modding).

Using a workaround method? Yes, in theory. If you've ever used FragMe!'s Floating Icon Fix, then you already know half the work you'd need to do. Basically, my theory is that you could assign a reticle icon to each weapon, and some could be different. Different ones for shotguns, pistols, rifles, etc.

Drawbacks include, but are not limited to: the heaps work required to do this (ever single weapon would have to be referenced, and the stock reticle would have to be removed), there would probably be no room for the ammo ticks, or the reloading ticks, so they'd have to be removed as well, and it wouldn't changed colors (blue, red and yellow) like the normal reticle does.
Last edited by THEWULFMAN on Thu Apr 26, 2012 4:40 pm, edited 1 time in total.
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Custom HUD - Multiple Reticules

Post by lucasfart »

That's sneaky. I like it. :)

I get what you're saying about not being able to have different colours for the reticle icon, but why exactly couldn't you still have the ammo ticks and everything else?
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Custom HUD - Multiple Reticules

Post by THEWULFMAN »

Because all of the reticle icons would have to line up perfectly with the existing ammo/reload ticks, or it'd look weird and unprofessional. If all the reticles you want to add line up with it, then fantastic. Otherwise they'd need to be removed.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Custom HUD - Multiple Reticules

Post by [RDH]Zerted »

THEWULFMAN wrote:but I'll just wait for Ace or Zerted to correct me ...itt wouldn't changed colors (blue, red and yellow) like the normal reticle does.
Well don't wait for me. I know Lua scripting and shell scripts better than anyone, but all that time spent in Lua means I didn't spend it in other areas. I've never done HUD work other than trying to restore green team chat. What I did learn from that is that you can specifiy colors in the HUD files. One of the color values represents the color of the team you're pointing at. I don't know if that works with transparent icons (I'd assume it does).

I wouldn't have thought of the floating icon fix. My hack would be asking players to use a fake zoom that changes the reticle. The sniper's reticle changes when you zoom, so I assume you can change it for different weapons. I don't know if you're required to be in a zoomed state for that to happen.

You could also place a shell interface screen on top of the game and place your reticle image there (this is what the full screen map does). However, that just seems too hackish and I don't recommend it. But it would 'work'

In general all my suggestions are Lua based. If there's a non-Lua solution, it's best to try that first.
User avatar
Cerfon Rournes
Master Bounty Hunter
Master Bounty Hunter
Posts: 1558
Joined: Thu Jul 08, 2010 5:53 pm
Projects :: WIP. I will reveal what it is later on..
Games I'm Playing :: SWBF2-SWRC
xbox live or psn: No gamertag set
Location: New York, USA
Contact:

Re: Custom HUD - Multiple Reticules

Post by Cerfon Rournes »

The floating icon solution is possible, I've tried it and have gotten very close to the final result.
[RDH]Zerted wrote: I wouldn't have thought of the floating icon fix. My hack would be asking players to use a fake zoom that changes the reticle. The sniper's reticle changes when you zoom, so I assume you can change it for different weapons. I don't know if you're required to be in a zoomed state for that to happen.
This could work if:
1: The main reticule is an invisible msh, or it is small enough to fit in between the other weapon reticules.
2: If there was a way to show the zoom texture without zooming in.
I'll look into this. :)
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Custom HUD - Multiple Reticules

Post by lucasfart »

[RDH]Zerted wrote:You can specifiy colors in the HUD files. One of the color values represents the color of the team you're pointing at. I don't know if that works with transparent icons (I'd assume it does).
So you're saying its possible to make any icon with transparency change colour depending on who you're aiming at, even if it's not the reticule? How hard would this be to achieve in terms of scripting? If its quite difficult I probably would need a bit of help setting it up....
[RDH]Zerted wrote:My hack would be asking players to use a fake zoom that changes the reticle. The sniper's reticle changes when you zoom, so I assume you can change it for different weapons. I don't know if you're required to be in a zoomed state for that to happen.
So can you force the player to automatically zoom in to a rate of something like x1.01, so that the difference is negligible, and then add the reticule to your zoom view.....if you did this would you still be able to zoom normally, to like 3x zoom or whatever?

Your ideas sound awesome Zerted, but I'm afraid they're probably all a bit difficult for me to accomplish unless someone walks me through it.
THEWULFMAN wrote:Because all of the reticle icons would have to line up perfectly with the existing ammo/reload ticks, or it'd look weird and unprofessional. If all the reticles you want to add line up with it, then fantastic. Otherwise they'd need to be removed.
What if you don't want the ammo ticks inside the reticule? :P
Hidden/Spoiler:
Image
I'm aiming for something similar to this...which looks quite feasible IMO. Just change the ammo model from a tick to a bullet, stick it in the corner and voila!

EDIT: Hmm. I've got my custom reticule ingame, but the stock one still loads alongside it. What am I forgetting to do?
User avatar
Cerfon Rournes
Master Bounty Hunter
Master Bounty Hunter
Posts: 1558
Joined: Thu Jul 08, 2010 5:53 pm
Projects :: WIP. I will reveal what it is later on..
Games I'm Playing :: SWBF2-SWRC
xbox live or psn: No gamertag set
Location: New York, USA
Contact:

Re: Custom HUD - Multiple Reticules

Post by Cerfon Rournes »

lucasfart wrote: EDIT: Hmm. I've got my custom reticule ingame, but the stock one still loads alongside it. What am I forgetting to do?
You need to override the stock one. To do that, just name your msh hud_main_reticule. Make sure it's named that in the HUD file.
By the way, your Halo layout is totally possible. You will need a global ingame.lvl to see the full changes, however.
Here is a screeny of mine. Again I only get full changes with a global ingame.lvl. Without it, the minimap and other things would just be duplicated.
Hidden/Spoiler:
Image
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Custom HUD - Multiple Reticules

Post by lucasfart »

Could I just leave my reticule as the same name and create a dummy/invisible model named hud_main_reticule? And what do you mean by a "global" ingame.lvl - do you mean totally replacing the stock ingame.lvl in the data folder?

With the duplicating items, couldn't you just replace the default models with invisible ones, so that the default ingame layout would still be there but you wouldn't see it?

What the two posts Cerfoun. :P

Nice HUD btw.
User avatar
Cerfon Rournes
Master Bounty Hunter
Master Bounty Hunter
Posts: 1558
Joined: Thu Jul 08, 2010 5:53 pm
Projects :: WIP. I will reveal what it is later on..
Games I'm Playing :: SWBF2-SWRC
xbox live or psn: No gamertag set
Location: New York, USA
Contact:

Re: Custom HUD - Multiple Reticules

Post by Cerfon Rournes »

lucasfart wrote:Could I just leave my reticule as the same name and create a dummy/invisible model named hud_main_reticule? - do you mean totally replacing the stock ingame.lvl in the data folder?
Yes to both questions.
With the duplicating items, couldn't you just replace the default models with invisible ones, so that the default ingame layout would still be there but you wouldn't see it?
Yes, but some things can't be removed using models. The Chat/text lines, and the Minimap for instance.
What the two posts Cerfoun. :P
Meh, my mistake. :P
Nice HUD btw.
Thanks, it took a great deal of time to get right. :)
Just tell me if you need any help with your custom HUD and I'll be glad to help.
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Custom HUD - Multiple Reticules

Post by Fiodis »

I thought we couldn't completely replace the ingame.lvl since we don't have everything that went into it? Also, if you replace HUD elements with invisible models, wouldn't those have the same visual problems any model with an alpha layer has (showing up as an outline against a CP's glow, for example)?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Custom HUD - Multiple Reticules

Post by AQT »

Those visual problems only occur if an object is semi-transparent and if it doesn't have hard edge enabled.
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Custom HUD - Multiple Reticules

Post by THEWULFMAN »

Fiodis wrote:I thought we couldn't completely replace the ingame.lvl since we don't have everything that went into it?

We can replace the ingame, I've done it myself (I think, or did I... anyway). Zerted has said it can be done(and he has done it, see the unofficial patch), regardless of whether I did it or not.
Fiodis wrote:Also, if you replace HUD elements with invisible models, wouldn't those have the same visual problems any model with an alpha layer has (showing up as an outline against a CP's glow, for example)?
I recommend replacing the HUD with a reeeeaaaly tiny model with one polygon, that's what I did anyway. Or using hard-edged transparency, that solves that issue as well.

Edit - Ninja'd by AQT. :P
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Custom HUD - Multiple Reticules

Post by lucasfart »

What else does the minimap use? Surely it'd just be a matter of finding the right parts and changing them.

EDIT: And I'd still appreciate help in configuring the setup of my original question, with a custom reticule for each weapon. Is it possible to force the weapon to zoom in ever so slightly, and still enable the normal zoom?

EDIT2: Heh. I've got alot of questions on the HUD. Where would I edit the ammo tick information? The only section I can find relating to ammo is the number which is located next to the weapon icon...

EDIT3: Is this is?
Hidden/Spoiler:
[code]
BarSegmented("player1weapon1clipbar")
{
AngleStart(-135.296936)
AngleEnd(144.795883)
NumSegments(30)
Value(1.000000)
EventValue("player1.weapon1.totalClipFraction")
Rect(0.087831, 0.111404, "Center", "Center", "Viewport")
PropagateAlpha(1)
Position(-0.000581, -0.001564, 0.000000, "Viewport")
ColorChangeRate(0.100000)
FadeHoldTime(6.030002)
FadeSustainTime(1.020000)
FadeOutTime(0.500000)
EventEnable("player1.weapon1.totalClipFraction")
EventDisable("player1.weapon1.target.disable")
Segment("Segment")
{
Bitmap("hud_clipbar_segment")
BitmapStyle("Shadow")
BitmapRect(0.003122, 0.014606, "Center", "Center", "Viewport")
Alpha(0.750000)
Color(160, 160, 224)
FadeInTime(0.100000)
FadeOutTime(0.250000)
}

}[/code]
User avatar
Cerfon Rournes
Master Bounty Hunter
Master Bounty Hunter
Posts: 1558
Joined: Thu Jul 08, 2010 5:53 pm
Projects :: WIP. I will reveal what it is later on..
Games I'm Playing :: SWBF2-SWRC
xbox live or psn: No gamertag set
Location: New York, USA
Contact:

Re: Custom HUD - Multiple Reticules

Post by Cerfon Rournes »

Yup, that's it.
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Custom HUD - Multiple Reticules

Post by lucasfart »

lucasfart wrote: 1. What else does the minimap use? Surely it'd just be a matter of finding the right parts and changing them.

2.Is it possible to force the weapon to zoom in ever so slightly, and still enable the normal zoom?
3.How do i make the ammo ticks straight? By default they curl around inside the reticle, but I want to make them appear in a straight line, like the halo HUD. Would I just change this line:

Code: Select all

AngleStart(-135.296936)
        AngleEnd(144.795883)
to

Code: Select all

AngleStart(0)
        AngleEnd(0)
4. Is it possible to have the ammo clip appear in three even rows, like the halo one?

5.Also, does anyone know what the "Rect" line refers to?

EDIT:Well I tried changing the Angle values to 0 and the Position values, but I'm not seeing any changes in my HUD. Here's what the section looks like in my hud file:

Code: Select all

    BarSegmented("player1weapon1clipbar")
    {
        AngleStart(0)
        AngleEnd(0)
        NumSegments(60)
        Value(1.000000)
        EventValue("player1.weapon1.totalClipFraction")
        Rect(0.087831, 0.111404, "Center", "Center", "Viewport")
        PropagateAlpha(1)
        Position(55.00, 55.00, 10.000000, "Viewport")
The Position value didn't seem to be doing anything, so I just changed it to some extreme values with no difference.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Custom HUD - Multiple Reticules

Post by [RDH]Zerted »

lucasfart wrote:So you're saying its possible to make any icon with transparency change colour depending on who you're aiming at, even if it's not the reticule? How hard would this be to achieve in terms of scripting?
No, I'm saying any HUD element can change colors based off of what you're pointing at. I don't know if an icon is considered a HUD element. It's impossible to do through scripting. You must edit the HUD files.
lucasfart wrote:So can you force the player to automatically zoom in
I don't know that. That's why I would ask the players to zoom in.

We can replace ingame.lvl. Both v1.2 and v1.3 do so. What we can't do is fully replace core.lvl. That has some optimizations we don't have.

If you don't think your changes are having an effect, change something you know works, like changing color and see if that shows up. If not, then you know there's most likely a munging problem. If so, then you know there's a problem with your initial changes.
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Custom HUD - Multiple Reticules

Post by lucasfart »

[RDH]Zerted wrote:
lucasfart wrote:So you're saying its possible to make any icon with transparency change colour depending on who you're aiming at, even if it's not the reticule? How hard would this be to achieve in terms of scripting?
No, I'm saying any HUD element can change colors based off of what you're pointing at. I don't know if an icon is considered a HUD element. It's impossible to do through scripting. You must edit the HUD files.
I'm guessing this is the relevant line?

Code: Select all

        EventColor("player1.weapon1.target.teamColor")
Can you just stick that in with any HUD element? Was also curious - is it possible to insert your own HUD element?
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Custom HUD - Multiple Reticules

Post by Fiodis »

lucasfart wrote:Was also curious - is it possible to insert your own HUD element?
I believe so, yes. If you play AQT's/Duck's/Ande's Republic Commando maps, the first-person commando helmet overlay is a HUD element, I think. (Or it's just modelled into the first-person mesh, I can't remember which.) I've inserted my own HUD elements, mainly meshes, before.
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Custom HUD - Multiple Reticules

Post by lucasfart »

Awesome. :) Thanks for that Fiodis.

I'm having trouble figuring out the values to use for positioning. It seems really inconsistent/difficult to use, relying on several different elements. Why didn't they just make a simple (x,y) system? Any help in understanding the HUD positioning would be appreciated.
Post Reply