Page 1 of 1
Realistic zooming and Ironsights in weapons
Posted: Sun Dec 16, 2007 11:15 am
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

), 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

Re: Realistic zooming and Ironsights in weapons
Posted: Sun Dec 16, 2007 12:39 pm
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.
Re: Realistic zooming and Ironsights in weapons
Posted: Sun Dec 16, 2007 12:48 pm
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.
Re: Realistic zooming and Ironsights in weapons
Posted: Sun Dec 16, 2007 4:05 pm
by ARC_Commander
I believe that this may have something to do with it:
ScopeTexture = "your custom scope tga"
In the weapon's ODF.
Re: Realistic zooming and Ironsights in weapons
Posted: Sun Dec 16, 2007 4:37 pm
by Taivyx
Thanks! I'll try it out.
Now to find the place where the stock scope texture is......
Re: Realistic zooming and Ironsights in weapons
Posted: Sun Dec 16, 2007 11:43 pm
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.
Re: Realistic zooming and Ironsights in weapons
Posted: Mon Dec 17, 2007 4:38 am
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.
Re: Realistic zooming and Ironsights in weapons
Posted: Mon Dec 17, 2007 8:17 am
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)
Re: Realistic zooming and Ironsights in weapons
Posted: Mon Dec 17, 2007 12:02 pm
by Caleb1117
did you try adding it to your side's msh/pc folder?
Re: Realistic zooming and Ironsights in weapons
Posted: Mon Dec 17, 2007 1:14 pm
by Taivyx
Yes! It worked!...... sorta
When I zoom:
Now I gotta figure out why it copies and flips around, how to get it centered, and how to get the white transparent.
Re: Realistic zooming and Ironsights in weapons
Posted: Mon Dec 17, 2007 2:10 pm
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.
Re: Realistic zooming and Ironsights in weapons
Posted: Mon Dec 17, 2007 2:20 pm
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.......

Re: Realistic zooming and Ironsights in weapons
Posted: Mon Dec 17, 2007 11:36 pm
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.
Re: Realistic zooming and Ironsights in weapons
Posted: Tue Dec 18, 2007 2:46 pm
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
Re: Realistic zooming and Ironsights in weapons
Posted: Tue Dec 18, 2007 6:24 pm
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.