Changing sniper rifle scope color [Solved]

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
User avatar
Superm9
Second Lance Corporal
Second Lance Corporal
Posts: 104
Joined: Thu Aug 23, 2007 8:41 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Changing sniper rifle scope color [Solved]

Post by Superm9 »

Hello, all! I was wondering if it would be possible to tint the color of a rifle scope green, in order to simulate a "night scope" - in other words, when you zoom in when using a sniper rifle, the scope would be generally tinted green. :cpu:

Thanks!
-_-
Gametoast Staff
Gametoast Staff
Posts: 2678
Joined: Sat May 07, 2005 1:22 pm

Re: Changing sniper rifle scope color

Post by -_- »

Change your over-sized avatar please. 1600x1200?
User avatar
Superm9
Second Lance Corporal
Second Lance Corporal
Posts: 104
Joined: Thu Aug 23, 2007 8:41 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Changing sniper rifle scope color

Post by Superm9 »

Avatar fixed... I guess? :oops: Sorry about any unintentional issues there.

So, any advice on changing the scoped-in view color?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Changing sniper rifle scope color

Post by AQT »

In data_***\Common\interface\PC, you will find four scope textures (weapon_scope, weapon_scope2, weapon_scope3, and weapon_scope4.tga). Choose the one you want to edit, edit it, and save it as weapon_scope5 in your side's msh folder. Reference this scope texture in your weapon's .odf file like so

Code: Select all

ScopeTexture        = "weapon_scope5"
under

Code: Select all

[Properties]
save it and munge your sides.
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: Changing sniper rifle scope color

Post by Fiodis »

Won't you need to make a custom ingame.lvl for that, since Data***/Common is not in any particular sides folder?
User avatar
Superm9
Second Lance Corporal
Second Lance Corporal
Posts: 104
Joined: Thu Aug 23, 2007 8:41 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Changing sniper rifle scope color

Post by Superm9 »

Well, I did just as was suggested, and what actually happened was the rifle scope image defaulted back to the "weapon_scope" texture - the first weapon scope. It doesn't seem to be recognizing the existence of my "weapon_scope5" texture, even though I saw the visualmunge tool munge it...

I'll post my errorlog here in the next few minutes.

Help!

EDIT: I'm not seeing any error in the log related to rifle scopes, but here it is anyways:
Hidden/Spoiler:
Message Severity: 2
.\Source\EntitySoldier.cpp(10471)
Soldier RC_inf has geometry collision

Message Severity: 2
.\Source\FLEffect.cpp(214)
FLEffect::Read: duplicate effect class name (5f518933)!

Message Severity: 3
.\Source\Weapon.cpp(2076)
Weapon "rep_weap_inf_fusioncutter" missing high res geometry "rep_1st_weap_inf_fusioncutter"

Message Severity: 3
.\Source\WeaponMelee.cpp(3191)
WeaponMelee "farmer_weap_inf_knife" invalid combo definition file "rep_hero_ep3obiwan"

Message Severity: 3
.\Source\WeaponMelee.cpp(3196)
WeaponMelee[farmer_weap_inf_knife]::ComboAnimationBank invalid params "human_sabre melee rep_hero_ep3obiwan"

Message Severity: 2
.\Source\SkyManager.cpp(122)
Skyfile FarSceneRange is in old format

Message Severity: 2
.\Source\AttachedEffects.cpp(143)
AttachEffects: effect 'prop_steampipe' not found

Message Severity: 2
.\Source\AttachedEffects.cpp(143)
AttachEffects: effect 'prop_steampipe' not found

Message Severity: 2
.\Source\AttachedEffects.cpp(143)
AttachEffects: effect 'prop_steampipe' not found

Message Severity: 2
.\Source\AttachedEffects.cpp(143)
AttachEffects: effect 'torchflame' not found

Message Severity: 2
.\Source\AttachedEffects.cpp(185)
AttachEffects: effect 'waterfall_bottom_side' not found

Message Severity: 2
.\Source\AttachedEffects.cpp(185)
AttachEffects: effect 'waterfall_bottom_side' not found

Message Severity: 2
.\Source\AttachedEffects.cpp(185)
AttachEffects: effect 'waterfall_bottom_center' not found

Message Severity: 2
.\Source\StringDB.cpp(48)
ID=79616671: trying to replace "end_prop_leaftree1" with "end_prop_leaftree11"

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\StringDB.cpp(48)
ID=715f1b42: trying to replace "end_prop_leaftree2" with "end_prop_leaftree21"

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\StringDB.cpp(48)
ID=786164de: trying to replace "end_prop_leaftree1" with "end_prop_leaftree10"

Message Severity: 2
.\Source\StringDB.cpp(48)
ID=7d616cbd: trying to replace "end_prop_leaftree1" with "end_prop_leaftree15"

Message Severity: 2
.\Source\StringDB.cpp(48)
ID=766161b8: trying to replace "end_prop_leaftree1" with "end_prop_leaftree12"

Message Severity: 2
.\Source\FLEffect.cpp(463)
Attach: model '' [f62b4f6f] has no hardpoint 'hp_light_3' [a19fd6cf]

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\FLEffect.cpp(463)
Attach: model '' [f62b4f6f] has no hardpoint 'hp_light_3' [a19fd6cf]

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\StringDB.cpp(48)
ID=7a616804: trying to replace "end_prop_leaftree1" with "end_prop_leaftree16"

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\StringDB.cpp(48)
ID=725f1cd5: trying to replace "end_prop_leaftree2" with "end_prop_leaftree20"

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\StringDB.cpp(48)
ID=7761634b: trying to replace "end_prop_leaftree1" with "end_prop_leaftree13"

Message Severity: 2
.\Source\StringDB.cpp(48)
ID=7c616b2a: trying to replace "end_prop_leaftree1" with "end_prop_leaftree14"

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 2
.\Source\Godray.cpp(298)
GodrayManager: Exceeded maximum number of godrays (0)

Message Severity: 3
.\Platform\Pc\pcFirstPerson.cpp(69)
FirstPerson::LoadLVLFile: Could not open FPM\REP\rep.lvl

Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(2523)
Timer "victoryTimer" not found

Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(2523)
Timer "delayTimer" not found

Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(635)
Entity "goto" not found
Note that the game isn't crashing; it's just not displaying the correct rifle scope texture.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Changing sniper rifle scope color

Post by AQT »

Well I guess you do need a custom ingame.lvl then as Fiodis pointed out. Just save your scope texture over any of the four original ones, reference it in the weapon's .odf file, then open up your .lua and find

Code: Select all

ReadDataFile("ingame.lvl")
and change it to

Code: Select all

ReadDataFile("dc:ingame.lvl")
save it and munge. After the munge is complete go to data_***\_LVL_PC and copy the ingame.lvl to your map's _LVL_PC folder in the addon folder. Your scope texture should show up in-game (hopefully).
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: Changing sniper rifle scope color

Post by Fiodis »

It is just like I thought, you need a custom ingame.lvl file. Check the FAQ thread for information on how to make one, there's a handy tutorial in there although I never got it to work for me.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Changing sniper rifle scope color

Post by AQT »

I forgot to mention that alternatively you could just reference the "weapon_scope5" texture in your side's (or unit's) .req like so

Code: Select all

REQN
{
"texture"
"weapon_scope5"
}
instead of using a custom ingame.lvl. I did this with the auto turret skin (located in data_***\Common\msh) and it showed up.
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: Changing sniper rifle scope color

Post by Fiodis »

Omg. That works? It's so much simpler than a custom ingame.lvl.... I've got to try it.
User avatar
Superm9
Second Lance Corporal
Second Lance Corporal
Posts: 104
Joined: Thu Aug 23, 2007 8:41 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Changing sniper rifle scope color

Post by Superm9 »

Errmmm... it didn't work...

I added the code you posted to my rep.req file, and made sure that the rifle was referencing weapon_scope5, and... it defaulted back to weapon_scope, the same as before...

I also tried copying over the ingame.lvl file - is there any other modification that I need to make? Because the scope didn't change at all using that method.

Thanks!
User avatar
Fluffy_the_ic
Hoth Battle Chief
Hoth Battle Chief
Posts: 3223
Joined: Thu Jan 24, 2008 7:03 pm
xbox live or psn: fluffytherc
Location: she/her
Contact:

Re: Changing sniper rifle scope color

Post by Fluffy_the_ic »

Do you need the original scope in teh first place? Because if you don't, then you should just overwrite it. If you just overwrite it, it's just like skinning any other object.
User avatar
Frisbeetarian
Jedi
Jedi
Posts: 1233
Joined: Wed Sep 12, 2007 3:13 pm

Re: Changing sniper rifle scope color

Post by Frisbeetarian »

Fluffy_the_ic wrote:Do you need the original scope in teh first place? Because if you don't, then you should just overwrite it. If you just overwrite it, it's just like skinning any other object.
Except that the scope is part of the HUD, and as such, like Fiodis said in the first place, you need a custom ingame.lvl to make changes to the HUD.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Changing sniper rifle scope color

Post by AQT »

Superm9 wrote:I added the code you posted to my rep.req file, and made sure that the rifle was referencing weapon_scope5, and... it defaulted back to weapon_scope, the same as before...
My mistake. I just thought if it worked for the auto turret (which is somewhat part of the HUD) it would also for the scope texture.
I also tried copying over the ingame.lvl file - is there any other modification that I need to make? Because the scope didn't change at all using that method.
Did you overwrite one of the original scope textures and reference your custom ingame.lvl in you .lua by adding the "dc:"?
User avatar
Superm9
Second Lance Corporal
Second Lance Corporal
Posts: 104
Joined: Thu Aug 23, 2007 8:41 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Changing sniper rifle scope color

Post by Superm9 »

I actually managed to get it ingame - I just had to take what you said for the second option (changing the .req) and apply it to your first option (changing the ingame.lvl file) - I didn't make the connection that I was supposed to be editing my ingame.req file; once I did that, then munged, then copied over the new ingame.lvl file, it worked like a charm - a great night vision scope!

So, in summary your methods work - just as one complete method! :D
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: Changing sniper rifle scope color

Post by Fiodis »

That's not one complete method. That's creating a new ingame.lvl file. Editing the req is part of it.

What do you mean, AQT, when you said it worked for the autoturret? How could you see the autoturret's scope?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Changing sniper rifle scope color

Post by AQT »

Not the scope but the turret's texture itself. I made this thread awhile ago concerning the now solved problem.
RogueKnight
Space Ranger
Posts: 2512
Joined: Sat Nov 22, 2008 1:50 pm
Projects :: Life. Work.
Games I'm Playing :: League of Legends
xbox live or psn: No gamertag set
Location: Washington, US

Re: Changing sniper rifle scope color

Post by RogueKnight »

AQT wrote:
Superm9 wrote:I added the code you posted to my rep.req file, and made sure that the rifle was referencing weapon_scope5, and... it defaulted back to weapon_scope, the same as before...
My mistake. I just thought if it worked for the auto turret (which is somewhat part of the HUD) it would also for the scope texture.
I also tried copying over the ingame.lvl file - is there any other modification that I need to make? Because the scope didn't change at all using that method.
Did you overwrite one of the original scope textures and reference your custom ingame.lvl in you .lua by adding the "dc:"?
Uh, wasn't he supposed to add it to the req folder, not the rep.req?
Post Reply