Page 1 of 1

Iron Sight Help [Solved] [THANK YOU!]

Posted: Wed Feb 01, 2012 10:35 pm
by yuke5
Subject: Iron Sight Tutorial (FAQ)
kinetosimpetus wrote:
Make a 512 x 512 .tga that is completely transparent. Set this as the ScopeTexture in every weapon you want to use ironsights with. I tried a smaller one, 8 x 8, but it didn't work. Simply loading a null ScopeTexture will result in a default one being used.
I've been following the tutorial, but I don't think I'm doing it right.

Where should I put the transparent tga? I managed to make a transparent tga, but I think I must have saved it in the wrong spot. I'm also afraid I might be loading it the wrong way. I've been editing the req's in the Common/req/fpm folder to load the texture as the scope, but that didn't seem to work. I also tried just replacing the scope with the blank texture, but that doesn't seem to work either.

Here is the link to my tga. I'm pretty sure it's okay, but I could be wrong.

http://www.mediafire.com/?c92j8q2xz6718g6

If you need any additional info, I'd be happy to provide it.

Thanks in advance, yuke5. <- No signatures please. -Staff

Re: Iron Sight Help

Posted: Wed Feb 01, 2012 10:51 pm
by Cerfon Rournes
Where should I put the transparent tga?
C:\BF2_ModTools\data_***\Common\interface\PC
Your texture should be loaded in the ingame.req in this area:

Code: Select all

REQN
    {
        "texture"
        "justputthenameofyourscopehere"
        "anotheroneyoumadehere"
        "andsoon"
        "weapon_scope4"
}
EDIT
Just had a look at your texture, it's fine. :)

Re: Iron Sight Help

Posted: Wed Feb 01, 2012 11:01 pm
by yuke5
Okay. I'll try it out. I'll let you know if it works.
EDIT:
I think I'm still screwing it up. :oops: Here's my req
Hidden/Spoiler:
ucft
{
REQN
{
"config"
"1playerhud"
}
REQN
{
"texture"
"comcis"
"blank_scope"
}
}

Re: Iron Sight Help

Posted: Wed Feb 01, 2012 11:32 pm
by Cerfon Rournes
yuke5 wrote:
Hidden/Spoiler:
ucft
{
REQN
{
"config"
"1playerhud"
}

REQN
{
"texture"
"comcis"
"blank_scope"
}
}
I think there should be a space between the bracket and the next REQN. (I fixed it for you.)
Also, please post your weapon .odf along with the changed HUD files.

Re: Iron Sight Help (I'm still screwing up)

Posted: Thu Feb 02, 2012 8:11 pm
by yuke5
HUD File:
Hidden/Spoiler:
FileInfo("1playerhud")
{
Viewports(1)

}

Group("player1weaponinformationforironsights")
{
PropagateAlpha(1)

Viewport(1)

ZOrder(255)

EventEnable("player1.spawn")
EventDisable("player1.die")

Group("player1weapon1groupforironsights")
{
Viewport(1)
EventEnable("initialize")

Model3D("player1weapon1mesh")
{
EventMesh("player1.weapon1.mesh")

Viewport(1)

ZOrder(5)

EventEnable("player1.weapon1.disable")
EventDisable("player1.weapon1.mesh")


MeshInfo("rep_weap_inf_rifle")
{
Position(0.500000, 1.200000, 0.000000, "Viewport")
Rotation(-5.000000, 180.000000, 0.000000)
Scale(20.000000, 20.00000, 20.000000)
}
}
}
}
As of right now, I'm using a test map with no stock sides. I thought the texture for the scope of loaded through the req's. Do I need to add a command to my weapon odf?

Re: Iron Sight Help (I'm still screwing up)

Posted: Thu Feb 02, 2012 8:16 pm
by kinetosimpetus
Yes. The odf selects the scope texture.

Re: Iron Sight Help (I'm still screwing up)

Posted: Thu Feb 02, 2012 8:36 pm
by yuke5
What do I change/add in the odf? I can't seem to find a stock odf command for scope texture.

Re: Iron Sight Help (I'm still screwing up)

Posted: Thu Feb 02, 2012 9:08 pm
by Marth8880

Code: Select all

ScopeTexture = "texturename"

Re: Iron Sight Help (I'm still screwing up)

Posted: Thu Feb 02, 2012 9:10 pm
by AQT
yuke5 wrote:
kinetosimpetus wrote:
Make a 512 x 512 .tga that is completely transparent. Set this as the ScopeTexture in every weapon you want to use ironsights with. I tried a smaller one, 8 x 8, but it didn't work. Simply loading a null ScopeTexture will result in a default one being used.
ScopeTexture is the ODF parameter. If your weapon ODF doesn't have that line, then just simply add it in.

Re: Iron Sight Help (I'm still screwing up)

Posted: Fri Feb 03, 2012 5:01 pm
by yuke5
I managed to get the texture to load, but that is all that is displayed, no ironsights. I must not be loading the msh right. Hrm...

Re: Iron Sight Help

Posted: Fri Feb 03, 2012 9:41 pm
by AQT
yuke5 wrote:
Hidden/Spoiler:
ucft
{
REQN
{
"config"
"1playerhud"
}
REQN
{
"texture"
"comcis"
"blank_scope"
}
}
There are two 1playerhud.hud files: one at data_***\Common\hud, and one at data_***\Common\hud\PC. VisualMunge considers the one in the PC folder. It also depends on the order you load the stock ingame.lvl and your custom one. You can try flipping this order to see if it makes a difference.

Re: Iron Sight Help (I'm still screwing up)

Posted: Fri Feb 03, 2012 10:02 pm
by yuke5
Okay, thank you I'll try it. Should I just try putting the same thing in both just to be safe?

Re: Iron Sight Help (I'm still screwing up)

Posted: Fri Feb 03, 2012 10:03 pm
by AQT
Yeah, that's what I tend to do.

Re: Iron Sight Help (I'm still screwing up)

Posted: Fri Feb 03, 2012 10:13 pm
by yuke5
Nope. :oops: Still doesn't work. I must be doing something else wrong. I think I did what's right in the HUD file though. I load the msh file right? I've tripled checked to make sure I got the name right! I'm going to make a new map and see if it's the munger.

Re: Iron Sight Help (I'm still screwing up)

Posted: Sat Feb 04, 2012 12:29 am
by Tears2Roses
Make sure you have dc:ingame.lvl in your LUA and you coppied the munged ingame.lvl to your map's addon folder.

Re: Iron Sight Help (I'm still screwing up)

Posted: Sat Feb 04, 2012 9:07 pm
by AQT
^He has already done that since he managed to get the transparent texture working.

@yuke5:
AQT wrote:It also depends on the order you load the stock ingame.lvl and your custom one. You can try flipping this order to see if it makes a difference.
Have you tried that yet? If not, then give it a try.

Re: Iron Sight Help (I'm still screwing up)

Posted: Sun Feb 05, 2012 10:59 am
by yuke5
IT WORKS! Thank you so much AQT. :bowdown: I practically jumped out of my chair when I zoomed in and saw the Ironsights.

EDIT: Earlier I thought you were talking about the two HUD files instead of the LUA. I guess it just clicked this time, either way thanks.