Realistic zooming and Ironsights in weapons

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

Post Reply
Taivyx
2008 Best Games Related Avatar
Posts: 1706
Joined: Thu Jun 07, 2007 3:34 pm
Projects :: Terra Strife - discontinued
Games I'm Playing :: none
xbox live or psn: No gamertag set
Contact:

Realistic zooming and Ironsights in weapons

Post by Taivyx »

So I'm moving along, trying to make my AK47 odf as realistic as possible, when I stumble upon some things I have no idea how to do.

1. How would I change the zoom-in texture to a custom made one (ironsights :P ), but also have a different zoom texture for a different weapon?

2. How would I have it so that when you zoom in, the firing also becomes more accurate?

Thanks in advance :)
MercuryNoodles
Jedi
Jedi
Posts: 1003
Joined: Sun Mar 12, 2006 7:16 pm
Projects :: Space - Boarding Action
xbox live or psn: No gamertag set

Re: Realistic zooming and Ironsights in weapons

Post by MercuryNoodles »

Someone might be able to prove me wrong, but I don't believe there's any way to add in the aim-down-the-sight feature as you've described. At least, I've yet to find any odf parameters that'd be helpful.
Taivyx
2008 Best Games Related Avatar
Posts: 1706
Joined: Thu Jun 07, 2007 3:34 pm
Projects :: Terra Strife - discontinued
Games I'm Playing :: none
xbox live or psn: No gamertag set
Contact:

Re: Realistic zooming and Ironsights in weapons

Post by Taivyx »

Well, it's not really aiming down the actual gun model, but I'll just take a snapshot of the model in 3ds Max in a down-the-sight view, then use it as the zoom-in texture.

What I'm confused about is having different zoom-in textures for different weapons.
ARC_Commander
High General
High General
Posts: 838
Joined: Tue Feb 06, 2007 7:18 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Realistic zooming and Ironsights in weapons

Post by ARC_Commander »

I believe that this may have something to do with it:

ScopeTexture = "your custom scope tga"

In the weapon's ODF.
Taivyx
2008 Best Games Related Avatar
Posts: 1706
Joined: Thu Jun 07, 2007 3:34 pm
Projects :: Terra Strife - discontinued
Games I'm Playing :: none
xbox live or psn: No gamertag set
Contact:

Re: Realistic zooming and Ironsights in weapons

Post by Taivyx »

Thanks! I'll try it out.

Now to find the place where the stock scope texture is......
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: Realistic zooming and Ironsights in weapons

Post by RepSharpshooter »

It's in the common assets, in mshs. I believe it's a quarter of what it is in-game, then it's flipped and copied around, it may not help with your problem. Perhaps you could make a custom hud for it? I don't know.
MercuryNoodles
Jedi
Jedi
Posts: 1003
Joined: Sun Mar 12, 2006 7:16 pm
Projects :: Space - Boarding Action
xbox live or psn: No gamertag set

Re: Realistic zooming and Ironsights in weapons

Post by MercuryNoodles »

Well, I mean the game already has the soldier aim (in 3rd person) whenever you zoom or fire, so that part is already present, though it'd require some work to get it like games such as CoD. The big question would be how to affect the accuracy, which I doubt is possible, from what I've seen.
Taivyx
2008 Best Games Related Avatar
Posts: 1706
Joined: Thu Jun 07, 2007 3:34 pm
Projects :: Terra Strife - discontinued
Games I'm Playing :: none
xbox live or psn: No gamertag set
Contact:

Re: Realistic zooming and Ironsights in weapons

Post by Taivyx »

Well, I've taken a look at those.

The cis/imp scope texture seems to be the normal SWBF2 one.

The .option file for that texture has one command I'm unfamiliar of:

-maps 1

Perhaps this is what makes it copied around and flipped?

EDIT: I've added the line ARC_Commander mentioned to the HUD values in my weapon's odf, put my custom scope texture in the PC folder of common msh's, along with a .option file, and it doesn't work.
So I'm wondering...... which .lvl file is are the HUD files compiled into? ingame.lvl? allshell.lvl? (the side that's using the weapon is alliance)
Caleb1117
2008 Most Original Avatar
Posts: 3096
Joined: Sun Aug 20, 2006 5:55 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: X-Fire: caleb1117 ಠ_ಠ

Re: Realistic zooming and Ironsights in weapons

Post by Caleb1117 »

did you try adding it to your side's msh/pc folder?
Taivyx
2008 Best Games Related Avatar
Posts: 1706
Joined: Thu Jun 07, 2007 3:34 pm
Projects :: Terra Strife - discontinued
Games I'm Playing :: none
xbox live or psn: No gamertag set
Contact:

Re: Realistic zooming and Ironsights in weapons

Post by Taivyx »

Yes! It worked!...... sorta

When I zoom:
Image

Now I gotta figure out why it copies and flips around, how to get it centered, and how to get the white transparent.
User avatar
Karnage
Commander Randomtoast
Posts: 947
Joined: Sun Oct 23, 2005 9:17 pm
Projects :: No Mod project currently.
Games I'm Playing :: Overwatch
xbox live or psn: No gamertag set
Location: Wherever there is shenanigannery.

Re: Realistic zooming and Ironsights in weapons

Post by Karnage »

If you notice on all the scope images in Battlefront 2, they each have four quarters.

So my suggestion would be to make four quarters out of yours.
Taivyx
2008 Best Games Related Avatar
Posts: 1706
Joined: Thu Jun 07, 2007 3:34 pm
Projects :: Terra Strife - discontinued
Games I'm Playing :: none
xbox live or psn: No gamertag set
Contact:

Re: Realistic zooming and Ironsights in weapons

Post by Taivyx »

The problem is, those four quarters are all the same, just flipped and copied around.

My image isn't symmetrical on any axis, and so I'm unable to do that. I'll be able to do that with a sniper scope, but not with ironsights.

EDIT: I've gotten the alpha channel to work properly now, but I'm really stuck on how to get rid of the four quarters. Would I have to edit the HUD files themselves? I'm scared of those monsters....... :P
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: Realistic zooming and Ironsights in weapons

Post by RepSharpshooter »

RepSharpshooter wrote:It's in the common assets, in mshs. I believe it's a quarter of what it is in-game, then it's flipped and copied around, it may not help with your problem. Perhaps you could make a custom hud for it? I don't know.
What if you tracked the camera in the third person so that it is lined up over the rifle? (you could see right down the sights)

I'm afraid if the scope texture flipping could a hard-coded thing. I'd look through the hud files though and see if theres an enable event that has something to the effect of "on zoom in" or something. If so you could put a mesh in there instead of a scope texture. If there isn't any assets for the scope, assume it's hard-coded. If there's a related msh you can always mod it, by replacing it with another msh.

I'm not sure the picture of the sight would look that good in-game, due to it's static nature. If all possible, I'd go for having a msh.

EDIT that option is for mip maps I believe, it's in the docs, it was for ps2? I think you can disregard it.
Taivyx
2008 Best Games Related Avatar
Posts: 1706
Joined: Thu Jun 07, 2007 3:34 pm
Projects :: Terra Strife - discontinued
Games I'm Playing :: none
xbox live or psn: No gamertag set
Contact:

Re: Realistic zooming and Ironsights in weapons

Post by Taivyx »

RepSharpshooter wrote:What if you tracked the camera in the third person so that it is lined up over the rifle? (you could see right down the sights)
How exactly would I do that? Even though it would look as good as the scope being a picture, that's probably what's more plausible
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: Realistic zooming and Ironsights in weapons

Post by RepSharpshooter »

Code: Select all

TrackCenter         = "0.0 1.0 -3.0"
TrackOffset         = "0.0 1.0 1.5"
(This is for a turret by the way, I hope it applies to units)
I believe it is the track offset value that needs to be changed, and I think it's just "x y z". So you might try a value of x around .5 - 1, and see where the camera goes.
Post Reply