Jump to content

Adding sniper scope


Recommended Posts

Rather than making my own thread about this issue, I figured I'd post it here. I've got the scope added to the SCAR-L and SCAR-H, and it works just fine in SP, but after I load a LAN [GR] Coop game the game crashes a few seconds after it loads and I'm in the main lobby. The message looks like this:

Crash in application version: grpcrc1.30

data\lib\units\extensions\inventory.dsf(-1): cant set this to a value (type: <void>)

SCRIPT STACK

data\lib\units\extensions\inventory.dsf(0)

data\lib\units\extensions\inventory.dsf(0)

data\lib\managers\groupmanager.dsf(0)

data\lib\units\extensions\groupunit.dsf(0)

data\lib\units\extensions\groupunit.dsf(0)

data\lib\units\extensions\groupunit.dsf(0)

Any idea what's causing this?

EDIT: Dur, should have made sure I used the file from the patch.bundle and not the quick.bundle. Problem solved, but left here for those who do the same (stupid) mistake.

Edited by Nutlink
Link to comment
Share on other sites

How to add a scope to the SCAR-L and SCAR-H (also works for M8 and the likes, but it just doesn't look right)

1. Extract the files mod_data.xml and weapon_data.xml from data\lib\managers\xml.

2. Extract the files mods.xml from data\strings.

3. Extract the files u_addons.xml from data\units\weapons.

Under the mod_data.xml add the following lines:

<mod_data unit_name="scar_scope" mod_id="18" name="scope" mod_slot="top" price="0">

<bar_stats accuracy=".8" stability="0.5" weight="1" impact="0.5" />

</mod_data>

See the mod_id is 18? Next, open up the weapons_data.xml. Look for the following:

<weapon_data disabled_by="disable_heavy_rifle" unit="scar_light" name="scar_light" weapon_id="12" inventory_slot="primary" gui_unit="scar_l" weight="3.5" length="80" stability="1" price="120" damage="2" player_weapon="1" grenade="0" cal="556" wizby="2">

<stats caliber="5.56mm" rpm="600" velocity="875 m/s" firemodes="SA FA" capacity="30" info="info_scar_light" />

<bar_stats accuracy="0.6" stability="0.6" weight="3.5" impact="0.6" />

<mods front="true" top="true" bottom="true">

<mod mod_id="12" default="1" />

<mod mod_id="11" />

<mod mod_id="8" />

<mod mod_id="14" />

<mod mod_id="13" />

<mod mod_id="18" />

</mods>

</weapon_data>

The bold part was added in to make the game say "Hey, the SCAR-L has an attachment of a sniper scope." Next, open up the mods.xml from the strings directory, and add this line:

<string id="mod_scar_scope" value="Scope"/>

From there, open up the u_addon.xml from the units\weapons directory. Copy the part about the sniper rifle that looks like this:

<unit type="weapon" name="sniper_scope$name_ext" slot="12">

<script_class name="hud" class="HudScope"/>

<model file="/weapons/addons/sniper_scope/sniper_scope$name_ext.xml"/>

<stats block="addon_data">

<var name="anim_name" value="scopesight"/>

<var name="hud_movie_name" value="crosshair_scope"/>

<var name="can_activate" value="true"/>

<var name="has_hud" value="true"/>

<var name="fov_halfway" value="40"/>

<var name="fov_zoomed" value="4.5"/>

<var name="zoom_mouse_sensitivity" value="0.1"/>

<var name="sway_amp" value="0.05"/>

<var name="sway_lerp" value="0.4"/>

<var name="speed_to_zoomed" value="15.0"/>

<var name="speed_to_halfway" value="3.0"/>

<var name="speed_to_unzoomed" value="6.0"/>

<!--var name="animspeed_sight_enter" value="1.5"/-->

</stats>

</unit>

Copy that, and paste it right underneath. Make it look like this:

<unit type="weapon" name="scar_scope$name_ext" slot="12"> <!---This line changed-->

<script_class name="hud" class="HudScope"/>

<model file="/weapons/addons/sniper_scope/sniper_scope$name_ext.xml"/>

<stats block="addon_data">

<var name="anim_name" value="combatsight"/> <!----This line changed-->

<var name="hud_movie_name" value="crosshair_scope"/>

<var name="can_activate" value="true"/>

<var name="has_hud" value="true"/>

<var name="fov_halfway" value="40"/>

<var name="fov_zoomed" value="10"/>

<var name="zoom_mouse_sensitivity" value="0.1"/>

<var name="sway_amp" value="0.05"/>

<var name="sway_lerp" value="0.4"/>

<var name="speed_to_zoomed" value="15.0"/>

<var name="speed_to_halfway" value="3.0"/>

<var name="speed_to_unzoomed" value="6.0"/>

<!--var name="animspeed_sight_enter" value="1.5"/-->

</stats>

</unit>

That should be it. I don't think I missed anything :)

Edited by Nutlink
Link to comment
Share on other sites

Thanks for the predictably thorough response. Perhaps these details on which files do what should be collected and posted somewhere? Every tutorial I've seen so far focuses on getting X or Y done (great if you want to do X or Y, not so much if you want to do Z) but few go into the details of the xml heirarchy so that people can explore the possibilities on their own.

Link to comment
Share on other sites

  • 1 month later...

Jake, just create your own english folder under local. If you follow Nutlink's short tut it works just fine on 1.35. Use nemon's bundle extractor(on downloads page) to extract both quick and patch bundles. I just set up a grawstuff folder under my documents, made 2 folders, one for patchbundle extract, one for quick bundle extract. Then copy and paste files you need into your english folder(be mindful to put files in same name folder they come from, such as folder strings-mod.xml or units-weapons-scarl l xml or lib-managers-xml-mod_data xml. The real data for the game is contained mainly in the bundles files--not in the data folder under graw folder.

Link to comment
Share on other sites

I have good news and bad news . . .

The good news is that:

I followed Nutlink's excellent tutorial,

I made the listed changes to the files from both the quick bundle and the patch bundle

(BTW, patch only has the mod_data and weapon_data xml files),

I created my own english folder under local,

I populated it with the appropriate subfolders and modified files,

I varified that language = "english" in the context.xml,

and

my game ran in both single player and multiplayer without crashing. :)

The bad news . . . no changes to the original program. >_<

No sniper scope for the SCAR-L

No sniper scope for the SCAR-H

:hmm:

But at least the game doesn't crash. :thumbsup:

Any suggestions troops?

Jake, just create your own english folder under local. If you follow Nutlink's short tut it works just fine on 1.35. Use nemon's bundle extractor(on downloads page) to extract both quick and patch bundles. I just set up a grawstuff folder under my documents, made 2 folders, one for patchbundle extract, one for quick bundle extract. Then copy and paste files you need into your english folder(be mindful to put files in same name folder they come from, such as folder strings-mod.xml or units-weapons-scarl l xml or lib-managers-xml-mod_data xml. The real data for the game is contained mainly in the bundles files--not in the data folder under graw folder.

Link to comment
Share on other sites

Does your structure look like C:\Program Files\Ubisoft\Ghost Recon Advanced Warfighter\local\english\lib\managers\xml

Or does it look like C:\Program Files\Ubisoft\Ghost Recon Advanced Warfighter\local\english\data\lib\managers\xml

The first one is how it should be.

Link to comment
Share on other sites

I have found a very simple means of adding an existing scope / sight to a weapon. Most of the info provided below is background material for those who are not so sure of where files are or what they do, so bear with me.

When we get to the money shot, the actual process is simple as it can be.

First I am assuming the necessary folders (see earlier posts in this thread, above) have been extracted - if you have already installed mods in your game the chances are they will have been. I have installed the M4 mod in the English folder (other mods have been installed in their own folder so as not to clash so my example below reflects how the folder and relevant files looked after I installed that mod - yous may be a little different.

Navigate to:

C:\Program Files\Ubisoft\Ghost Recon Advanced Warfighter\local\English\lib\managers\xml (or were ever you have installed the game - the above is based on the standard install.)

In the above folder you will find a file named - "weapon_data.xml" . Open this using notepad so you can edit it. (You may wish to backup first as the game is very twitchy and ANY xml error seems to cause a crash.)

As an example here is the entry for my SCAR heavy as it appears when I open that file:

<weapon_data disabled_by="disable_heavy_rifle" unit="scar_heavy" name="scar_heavy" weapon_id="11" inventory_slot="primary" gui_unit="scar_h" price="160" damage="3" player_weapon="1" grenade="0" cal="762" wizby="3">

<stats caliber="7.62 x 45 mm" rpm="600" velocity="710 m/s" firemodes="SA FA" capacity="20" info="info_scar_heavy" />

<bar_stats accuracy="0.5" stability="0.55" weight="4" impact="0.7" />

<mods front="true" top="true" bottom="true">

<mod mod_id="12" default="1" />

<mod mod_id="11" />

<mod mod_id="8" />

<mod mod_id="16" />

<mod mod_id="17" />

</mods>

</weapon_data>

You can see the list of mod ids lower down in the entry for this weapon - these are the various addons that can be used on the weapon. In this case the default sight is number 12. And there are various others (11, 8 etc) which are also selectable.

To find out what these numbers refer to open the file named - "mod_data.xml" (also in the same directory.) You will see that mod 12 is in an entry which looks like this:

</mod_data>

<mod_data unit_name="scar_ironsight" mod_id="12" name="ironsight" mod_slot="top" price="0">

<bar_stats accuracy="0.5" stability="0.5" weight="0.7" impact="0.5" />

</mod_data>

And that tells you that ( in my case at least ) mod 12 is the scar ironsight. Similarly for the other mods.

So the long and the short of it is that by looking up the mod number of your desired add-on in the "mod_data.xml" file and adding a new entry like " <mod mod_id="16" /> " (or whatever) to your weapon of choice in the "weapon_data.xml" file you can add the new scope very simply to the list of selectable mods for each weapon - very simple!

In other words just add an extra line in the list of mods and enter the xml for containing the number of the new sight that you want to be selectable. As I said - very simple.

If you like you can also make it the default sight if you want - for example thats what I have done with the short barrelled version of the M8. I have added the M8 combat sight (in the stock installation it only has iron sights for some reason) and made the combat sight the default sight for this weapon.

Just be aware that some sights do not work well with some weapons. Use trial and error to find out which sights work OK with which weapons. For example you may find that some are not lined up so the bullet does not hit where the reticule inidcates it should. And some are wrongly positioned - e.g. the sniper scope sits WAY too far forward on the M4 . I think these can be rectified by playing about with the u-addons.xml file or some of the other xml files that set the characteristics for the placement of the mods in their relevant weapon slots, but I need to experiment more to work out the details.

The good news is that

(a) Most sights work OK on their new weapons if a little common sense is used. eg Do not add the sniper scope to a hand gun :^)

(b) I am not a programmer just a "mug" fiddler around and tinkerer. If I can find this stuff out with a couple of hours of research plus a modicum of trial and error then so can most GRAW players who are so inclined - so good luck. (Remember - just BACK UP first)

Hope this helps

Edited by pistolpete
Link to comment
Share on other sites

Jake, your setup looks fine, go back and recheck your xml files. Did you add mod 18 to list of mods for scar? Also, did you go into game and see icon for scar was just ironsight outline?--it won't show a scope on it but should say scope next to it. If you can't get it to work, pm me with your email--I'll send it to you. I'll be back tomorrow.

Also check context.xml file and that it says english in language section at top.

Edited by TRC
Link to comment
Share on other sites

Well, I'm finally up and running GRAW again (version 2.20 at the moment) thanks to the fine folks at SecuROM. The scope mod seems to be working pretty well too.

I did notice one difference in my setup;

instead of

<weapon_data disabled_by="disable_heavy_rifle" unit="scar_light" name="scar_light"

my version 1.20 weapons_data.xml entries read

<weapon_data unit="scar_light" name="scar_light"

:huh:

It still seems to work fine.

Hopefully SecuROM will have me up to 1.35 within the next couple days, and I can make that version work as well.

Thanks to one and all for the help. :thumbsup:

Link to comment
Share on other sites

If you want a sight with a bit better view than the standard aimpoint, here is a stopgap measure you can try - I have and it works. It involved boosting the magnification on that sight. Go into the following XML file - U_addons.xml which you will find here :

C:\Program Files\Ubisoft\Ghost Recon Advanced Warfighter\local\English\units\weapons

Open it using notepad and scroll down till you find the entry for the aimpoint. You will find it under the non iron sights group of entries.

It will look something like this:

<unit type="weapon" name="aimpoint$name_ext" slot="12">

<script_class name="hud" class="HudScope"/>

<model file="/weapons/addons/aimpoint/aimpoint$name_ext.xml"/>

<stats block="addon_data">

<var name="anim_name" value="combatsight"/>

<var name="hud_movie_name" value="crosshair_combatsight"/>

<var name="fov_halfway" value="20"/>

<var name="fov_zoomed" value="20"/>

<var name="has_hud" value="true"/>

<var name="zoom_mouse_sensitivity" value="0.2"/>

<var name="sway_amp" value="0.1"/>

<var name="sway_lerp" value="0.4"/>

<var name="speed_to_halfway" value="10.0"/>

<var name="speed_to_unzoomed" value="9.0"/>

<!--var name="animspeed_sight_enter" value="1.5"/-->

</stats>

</unit>

I have changed the FOV (field of view) value to 20. I forget what it previously was - something like 25 or 30 I think. This has the same effect of increasing magnification on the aimpoint. (More magnification gives smaller FOV)

For the sniper scope my entry looks like this:

<unit type="weapon" name="sniper_scope$name_ext" slot="12">

<script_class name="hud" class="HudScope"/>

<model file="/weapons/addons/sniper_scope/sniper_scope$name_ext.xml"/>

<stats block="addon_data">

<var name="anim_name" value="scopesight"/>

<var name="hud_movie_name" value="crosshair_scope"/>

<var name="can_activate" value="true"/>

<var name="has_hud" value="true"/>

<var name="fov_halfway" value="40"/>

<var name="fov_zoomed" value="7"/>

<var name="zoom_mouse_sensitivity" value="0.1"/>

<var name="sway_amp" value="0.05"/>

<var name="sway_lerp" value="0.4"/>

<var name="speed_to_zoomed" value="10.0"/>

<var name="speed_to_halfway" value="3.0"/>

<var name="speed_to_unzoomed" value="6.0"/>

<!--var name="animspeed_sight_enter" value="1.5"/-->

</stats>

</unit>

I have chanegd the FOV from 5 to 7. I have added the sniper scope as an optional sight to some other weapons and have found that the original setting just looks WAY too magnified. I have also increased the speed to bring the scope up to full zoom as this is more in keeping with using it on a lighter rifle and also I found there was an annoying pause halfway otherwise.

Both seem to work fine (except that the aimpoint now blocks out more of the screen when in use.)

Edited by peterm1
Link to comment
Share on other sites

  • 1 month later...

Sorry to post in an old topic, but oh well

I'm using pistolpete's method to get the aimpoint onto my MR-C

I get it in the selection screen, spawn with it, but can't use it. Help?

Sorry, i'm a total n00b at GRAW modding, most i've done so far is let it increase my texture/graphics settings :(

Edited by DerRelient
Link to comment
Share on other sites

I cant get this to work either, im trying to put the scar-l's combat sight and the MR-C Eotech sight on the M249, but just cant get it to bloody work :(

Keeps crashing with the inventory.dsf files (I think thats the ones)

Anyone got any ideas?

Or, has anyone done this already?

Besides Jasons Mod, that doesnt work with the latest patch.

Link to comment
Share on other sites

  • 6 months later...

I've got the scope to work in the [GR] Coop without using a mod (like Brettzies as they don't work, drat!) The problem is, the scope is off-center. It's almost like my Ghost isn't looking straight down the scope. It's off to the side making it fairly useless. Any ideas? If I use a custom mod in normal game or non-[GR] MP, those scopes work fine, but I can't seem to find the differences in the XML files. And I looked, really REALLY hard : )

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...