OpenWorldGames Server ONE

Video games => Far Cry 2 => Far Cry series => Single player modding => Topic started by: Rhynder on October 02, 2011, 06:04:45 PM

Title: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: Rhynder on October 02, 2011, 06:04:45 PM
Ok, i'm trying to edit the M16 (AR-16 ingame), to be full auto, instead of burst fire. I searched through the the .xml files looking for stuff related to the weapons fire modes and I finally found it( I think), edited and made the patch file and put it in the Data_Win32 folder. I started the game and tried the weapon, nothing, still burst fire. So I then said "Hey, maybe I just need to start a new game?" Tried that, and it's still the same. "Hey, maybe it's one of the cached values that needs to be reset?" I fired off thousands of rounds, switched weapons, picked up a brand new one off the wall, nothing. :(  I have done all sorts of different things trying to figure this out and nothing is working.


So, i'm just gonna state what I have done and what I changed and maybe you guys can tell me if I did something wrong?


Far Cry 2/modding

Ok, used the bootstrap.bat to create all the files and folders, I then opened "mymod" folder and then the  "patch" folder.

I opened "21_WeaponProperties.xml" to edit the firemode, I used ' Crtl+f ' and searched for " M16 ", which took me to the section needed, scrolled down until I found <value name="iBurstLength" type="UInt32">3</value> This has to be it, it's the only one with 3 as a value, so I checked the rest of the automatic rifles and they have this value set to 0, so I changed it. Ok, now it reads <value name="iBurstLength" type="UInt32">0</value> just like the other assault rifles, I checked the M16 and Ak47 side by side and no other value that should matter is different?

I run the Build_patch.bat, it makes the patch files, just below the two .bat files. I copy the patch files into Data_Win32, overwriting the originals. (Have backs ups of originals)

What am I doing wrong? Is this value hard coded and can't be changed?
Title: Re: Weapons Editing?
Post by: PZ on October 02, 2011, 07:56:07 PM
Interesting modification idea.  Although I'm no expert in modding just yet, I wonder if it has something to do with the AR-16 animation - perhaps it is only a 3-round burst?

Welcome to OWG by the way - hope you find the information on the site useful  :-X
Title: Re: SOLVED (+Tutorial- Newbie Friendly)
Post by: Rhynder on October 02, 2011, 10:29:38 PM
Okay, I figured it all out. My AR-16 is full auto!

What I was doing before WAS correct, however, there is a second file that needs to be edited and added to the patch file, along with changes to the patch.xml file. I'll spell it all out down below.

You need to also edit the file in libraries/world1/41_WeaponProperties.xml (This one has many "iBurstLength" entries to edit so use the find tool, change them all from 3 to 0)

Once that is done, copy the file into your mymod\patch\ folder. It now needs to added to the patch.

Go back one folder and open the patch.xml file, add <object external="41_WeaponProperties.xml" />  to the list below <object external="22_weapons.xml" /> Save. Run build_patch.bat, copy the patch file over and you're DONE! You now have a  fully auto AR-16.


I've also added a very newbie friendly tutorial, I know most of us here know more than a bit about this stuff, but some might come across this and not know, but want to make the change themselves.

Newbie TUTORIAL

Click the spoiler tag to reveal the newbie friendly version
Spoiler
Newbie friendly tutorial on changing weapon from burst fire to full auto and vice-versa

The AR-16 will be used as the example.


1. Open the ' mymod ' folder and the following  ' patch ' folder

2a. Open " 21_WeaponProperties.xml ", Press Ctrl f,  type M16 in the text field, press " Find Next"

2b. It will have taken you to M16 section, Press Ctrl f again, type Burst in the text field, press " Find Next"

3. You will now be looking at <value name="iBurstLength" type="UInt32">3</value> Change the 3 in between the > < symbols to 0 , Save.

4a. Now, go back to the ' modding ' folder. Open the libraries folder, then open world1, find 41_WeaponProperties.xml.

4b. Copy 41_WeaponProperties.xml to your ' mymod\patch\ '  folder, make the same edits as before. However, there is more than just one this time, keeping searching for "iBurstLength" until you no longer see any 3's and instead see 0's. Save.

5.Go back one folder, you will see a patch.xml file. Open the file. Add this <object external="41_WeaponProperties.xml" /> to the bottom of the list, but before the </object>


EXAMPLE: <object external="21_WeaponProperties.xml" />
  <object external="22_weapons.xml" />
  <object external="41_WeaponProperties.xml" />
</object>



Thanks for the welcome! Also thanks to Gibbed for his modding tools. After the few simple edits I've made this game is actually FUN!
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: PZ on October 02, 2011, 11:30:49 PM
Nicely done!  I enjoy using the AR-16 so this one will be really nice  :-X
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: Art Blade on October 03, 2011, 10:39:24 AM
Welcome to OWG and "good one" regarding that modification, Rhynder :)  :-X
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: PZ on October 03, 2011, 08:24:22 PM
I applied Rhynder's mod to my game and I must say that the AR-16 is now an amazing weapon.  Thanks again for finding this gem, Rhynder.
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: Rhynder on October 03, 2011, 08:57:22 PM
You are very welcome, sir. The gun is a beast, my new favorite in Far Cry 2. 

Anyway, now i'm moving onto a new modification. Enemy spawn times, that's it, that's all that is left and this game will be perfect. So far I've looked into the files and found nothing, or maybe I just missed it?

I know this has been looked into before, but that was before so much of the code was even available to edit. So, has anyone since then figured anything out or is this actually a hard coded piece of the game?


UPDATE

I believe I've found the code! The code is not in any of the files the bootstrap program generates, it's in world.fat\ domino\system. There are two files, ' reinforcementregion.lua ', and ' spawnreinforcement.lua '. The code is in here, clear as day. However I am NOT a programmer, I have no idea what to edit or what to add.  But this is what I believe controls the spawns. The entire code is below. Can someone more experienced, please, tell me what this does and if this is it or not?


reinforcementregion.lua
Spoiler
-- DOMINO REFLECTION BOX START
--
-- <Display Category="Missions" Text="ReinforcementRegion"/>
--
-- <ControlIn  Name="ChangeSpawnRate"/>
-- <DataIn     Name="GameRegion"      Type="Nomad|entity"/>
-- <DataIn     Name="MercDensity"     Type="Core|int"/>
-- <DataIn     Name="MercThreshold"   Type="Core|int"/>
--
-- <ControlOut Name="Out"/>
--
--
-- DOMINO REFLECTION BOX END

ReinforcementRegion = {
}

function ReinforcementRegion:Create(cbox)
-- left empty on purpose
end

function ReinforcementRegion:Init(cbox)
-- left empty on purpose
self.MercDensity = -1;
self.MercThreshold = -1;
end

function ReinforcementRegion:ShutDown()
-- left empty on purpose
end

function ReinforcementRegion:ChangeSpawnRate()
    if ( self.GameRegion ~= nil and self.MercDensity ~= nil  and self.MercThreshold) then   
    ChangeReinforcementRegionSpawnRate(self.GameRegion, self.MercDensity,self.MercThreshold);
  return self:Out();
  end
end


export = ReinforcementRegion;
ReinforcementRegion = nil;

______________________________________________________________

spawnreinforcement.lua
Spoiler
-- DOMINO REFLECTION BOX START
--
-- <Display Category="Pawns" Text="Spawn Reinforcement"/>
--
-- <ControlIn  Name="In"/>
-- <DataIn     Name="ReinforcementPoint" Type="Nomad|entity"/>
-- <DataIn     Name="Target"             Type="Nomad|entity"/>
-- <DataIn     Name="ReactOnlyToPlayer"  Type="Core|bool"/>
--
-- <ControlOut Name="Out" Delayed="true"/>
--
-- DOMINO REFLECTION BOX END

SpawnReinforcement = {
}

function SpawnReinforcement:Create(cbox)
-- left empty on purpose
end

function SpawnReinforcement:Init(cbox)
self.callidOnReinforcementPoint = nil;
self.callidOnTarget = nil;
self.counter = 0;
end

function SpawnReinforcement:ShutDown()
self._type.UnregisterCallback(self);
end

function SpawnReinforcement:UnregisterCallback()
  cbSyst = CScriptCallbackSystem_GetInstance();
  if (self.ReinforcementPoint ~= nil and self.callidOnReinforcementPoint ~= nil) then
cbSyst:RemoveCallback(self.ReinforcementPoint, self.callidOnReinforcementPoint);
self.callidOnReinforcementPoint = nil;
end
if (self.Target ~= nil and self.callidOnTarget ~= nil) then
cbSyst:RemoveCallback(self.Target, self.callidOnTarget);
self.callidOnTarget = nil;
end
end

function SpawnReinforcement:In()
if (self.ReactOnlyToPlayer == nil) then
self.ReactOnlyToPlayer = 0;
end
self.counter = 0;

if self.ReinforcementPoint ~= nil and self.Target ~= nil then
if( IsEntityLoaded(self.ReinforcementPoint) ~= 1 ) then
self.callidOnReinforcementPoint = CScriptCallbackSystem_GetInstance():RegisterOnSpawnCallback(self.ReinforcementPoint, self, "TrySpawnReinforcementScenario");
self.counter = self.counter + 1;
end

if (IsEntityLoaded(self.Target) ~= 1) then
self.callidOnTarget = CScriptCallbackSystem_GetInstance():RegisterOnSpawnCallback(self.Target, self, "TrySpawnReinforcementScenario");
self.counter = self.counter + 1;
end

if ( self.counter == 0 ) then
SpawnReinforcementScenario(self.ReinforcementPoint,self.Target,self.ReactOnlyToPlayer);
return self:Out();
end
end
end

function SpawnReinforcement:TrySpawnReinforcementScenario()
if(self.callidOnReinforcementPoint ~= nil) then
if (IsEntityLoaded(self.ReinforcementPoint) == 1) then
self.counter = self.counter - 1;
CScriptCallbackSystem_GetInstance():RemoveCallback(self.ReinforcementPoint, self.callidOnReinforcementPoint);
self.callidOnReinforcementPoint = nil;
end
end

if (self.callidOnTarget ~= nil) then
if (IsEntityLoaded(self.Target) == 1) then
self.counter = self.counter - 1;
CScriptCallbackSystem_GetInstance():RemoveCallback(self.Target, self.callidOnTarget);
self.callidOnTarget = nil;
end
end

if ( self.counter == 0 ) then
SpawnReinforcementScenario(self.ReinforcementPoint,self.Target,self.ReactOnlyToPlayer);
return self:Out();
end
end


-- Export visible for Nomad engine.
export = SpawnReinforcement;
SpawnReinforcement = nil;

Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: PZ on October 04, 2011, 10:19:28 AM
Looks promising - not sure but it looks like changing one (or both) of the -1 values might do something.  Might have to do some experimenting.
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: TheStranger on October 04, 2011, 01:44:37 PM
Great w@&k Rhynder on the AR-16! The 3 round burst was an annoying thing for me all the time so now it's as it should be.  :-X

Maybe we can do something concerning the spawntimes, but als I'm no coder :/
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: Binnatics on October 04, 2011, 03:31:26 PM
Urhmm, you mean the spawntimes for mercs at guardposts? Good idea.

Actually, I like to think about what can be done by modding, but don't mod anything myself. You think it's possible to change the amount of spawns as well? Should be funny if you can have them spawn by the dosen, knowing that you are at a safe distance with an MGL 140 with extra clip and bigger explosion-range >:D
When you can also adjust the time a dead body will stay in the game, you can start to pile up dead mercs until the whole guardpost is gone, LOL, I'm losing touch with reality again ^-^
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: PZ on October 04, 2011, 04:07:55 PM
One other thing that would be nice is to do away with the endless spawn in Pala and Mosate Selao.  That would make those two towns more like Sefapane.
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: nexor on October 04, 2011, 05:17:10 PM
Thanks for the AR -16 mod Rhynder, works like a dream  :-X

Quote from: Rhynder on October 03, 2011, 08:57:22 PM
You are very welcome, sir. The gun is a beast, my new favorite in Far Cry 2.

Oh and by the way......we almost got PZ and Art domesticated, so please don't call anyone of the two "SIR".........  :o            >:D :-() :-()



[admin]The domesticated Art was so free and edited the messed-up quote for you, nexor  :-()[/admin]
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: Rhynder on October 04, 2011, 06:16:10 PM
After some testing time, I've come to a conclusion on the enemy re-spawn time matter.  :D  :D  :D

During my testing, I've done a couple things, first off, I edited the script to wait for 5 minutes (just for testing) before it would "respawn" the enemies. It didn't w@&k. So just to test I edited the file again, I removed a key section of the script, which would cause an error and thus crash the game. It didn't w@&k either.

So after a few more hours of testing different stuff out, I've come to the conclusion that patching in the script does not w@&k, it doesn't read the script, it bypasses it and reads the original. Now I don't know if that means that it's just not wanting to read it from the patch file and we would have to find some way to actually replace the original files for it to w@&k or not? I'm also not sure how you would go about repacking world1.fat/world2.fat and common.fat.

But, for now until I get some conformation on the script and if it really is what is controlling the re-spawn (95% sure, btw), i'm just going to give up on this for now.  I wish they would have just released an SDK, so we wouldn't have to use these bypass hacks, life would be so much easier.
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: Art Blade on October 06, 2011, 11:52:30 AM
Nice find.

Unfortunately I currently don't have time for any extended playing or testing so I can't check it out myself.

From what little I gathered, you should be able to pack a new set of files that only have the wrong names. It might be possible to empty the modding folders, put in the luas, pack them to mod files and then rename those.
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: nexor on October 06, 2011, 05:43:45 PM
Quote from: nexor63 on October 04, 2011, 05:17:10 PM
The domesticated Art was so free and edited the messed-up quote for you, nexor  :-()

I'm not with you????
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: Art Blade on October 08, 2011, 06:01:31 AM
Err.. I was just referring to the fact that you didn't terminate the quote (BBC code error) which resulted in your own text to appear as part of the quote (as if Rhynder had said it). So I terminated the quote after Rhynder's own words and therefore made your text recognisable as a comment which you originally had intended.

:)
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: nexor on October 08, 2011, 11:40:59 AM
thanks, i'm still learning       :-()   
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: Art Blade on October 09, 2011, 06:50:07 AM
 :)
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: shelmez on December 11, 2011, 12:56:41 PM
Good job and great manual! Thank you Phynder!  :-X  Everything turned out right the first time)))) So, step by step game open its secrets))))
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: shelmez on December 14, 2011, 01:18:47 AM
Maybe someone will be interested in this information. In the game is pretty weak weapon shotgun, I used it a few times and then threw away, because you can only kill the flies. So, everything should be done as written above, Mr.Phynder about M16. For example, consider USAS12. Only need to change the parameter <value name="iBulletsShot" type="UInt32"> 7 </ value> how many bullets it will shoot out of your arms in one shot, that is, in one cartridge 7 bullets. Make <value name="iBulletsShot" type="UInt32"> 20 </ value> and your shotgun will turn into a lawn mower))) But do not forget that your enemy will have the same powerful weapons. But I do not recommend to put more than 20, the game can be very slow.
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: Art Blade on December 14, 2011, 08:15:25 AM
hehe  :-() I prefer to mod weapons that are not available to mercs so they won't get their grubby mitts on the nukes  :-D
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: nexor on December 14, 2011, 08:29:25 AM
I love the "lawn mower" effect      :lol
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: PZ on December 14, 2011, 10:24:09 AM
 :-X good one!
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: TheFishlord on February 20, 2012, 06:28:41 PM
I'd like to point out something I've found with the semi auto fix we have here. This adjusting of the burst works, but it is not really meant to be used that way. The way a weapon's firing type is determined is in this section of its code:

Spoiler
<object type="FireRate">
              <value name="fBusyDuration" type="Float">0</value>
              <value name="iFireRate" type="Float">240</value>
              <value name="selFireRateMode" type="UInt32">0</value>
              <object type="enumFireRateMode">
                <object type="enum">
                  <value name="Value" type="String">SingleShot</value>
                </object>
                <object type="enum">
                  <value name="Value" type="String">FullAuto</value>
                </object>
                <object type="enum">
                  <value name="Value" type="String">PrepareShot</value>
                </object>
              </object>
            </object>

Here I have the SPAS12's code. We're looking at the bolded section.

"sel" before a code means that this line is telling the weapon what it is going to do, in this case, "fire rate mode". (Sel is probably short for Select) "enum" before the code means it is giving the weapon its choices, and the first one is numbered as "0", hence the SPAS is single-shot or semi-auto. (Enum probably = Enumeration)

The M1903 and Ithaca are both "PrepareShot", presumably because before each firing an action has to be performed. The MGL140 is "SingleShot" because the action (rotating of the cylinder) comes AFTER the firing.

And all full auto weapons are obviously FullAuto. What piqued my interest here is that the M16 is labeled as full auto, so the "burst" code was apparently actually meant to determine bursts only in full auto. We've worked around it but here is the simplest fix to getting a semi auto gun - change the bolded line's value to 0.

This may solve the problem I pointed out in another thread about the "burst" of sounds. I'll go fix my FAL up with this and see what happens.

EDIT: This silences the weapon entirely (no firing sound at all now). I'll see if I can find any way around that...
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: PZ on February 20, 2012, 06:41:01 PM
Nice  :-X  Just when I think I've completely played out the game, modding SP comes along.  This will fill in some of the spare game time between now and the time that FC3 comes out.
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: TheFishlord on February 20, 2012, 07:40:40 PM
Oh yeah, I only started modding on...what, Friday? And I can't get away from it.  ;)

If anyone has tips on what the issue here with the sound is, I'm all ears (no pun intended). I'm totally stumped here, I see no reference to sounds at all that could be causing this.

Judging by the way the problem arose, sounds are inherently labeled as full auto or otherwise, and changing the weapon characteristics removes the sound, since there is no sound for the new characteristic. But that doesn't help much when the only spot left to look at is just a list of hash values, that I have no idea how to use...Here's the set for the FAL, if anyone can decipher them.

Spoiler
            <object type="Sounds">
              <value hash="65E69E99" type="BinHex">3078303034343933413300</value>
              <value hash="0167AEA7" type="BinHex">09000000</value>
              <value hash="E6F9A43D" type="BinHex">3078464646464646464600</value>
              <value hash="9DFA1E94" type="BinHex">9A99193E</value>
              <value hash="D8E14E8F" type="BinHex">3078303034433635463300</value>
              <value hash="893A492E" type="BinHex">08000000</value>
              <value hash="3F97D03F" type="BinHex">3078303034433636303600</value>
              <value hash="4398672F" type="BinHex">08000000</value>
              <value hash="CDD0C853" type="BinHex">FFFFFFFF</value>
              <value hash="876895B3" type="BinHex">3078464646464646464600</value>
              <value hash="9DD1F34F" type="BinHex">3078464646464646464600</value>
              <value hash="51953DD2" type="BinHex">FFFFFFFF</value>
              <value hash="BE3FDC7D" type="BinHex">3078303034343845363100</value>
              <value hash="7412DAC6" type="BinHex">3078303034423239314600</value>
              <value hash="DEF79FAE" type="BinHex">3078464646464646464600</value>
              <value hash="4B925BC6" type="BinHex">3078464646464646464600</value>
              <value hash="AADD0D3E" type="BinHex">08000000</value>
              <value hash="EF644C6F" type="BinHex">0000C03F</value>
              <value hash="FF3F6042" type="BinHex">EC51B83D</value>
              <object hash="822EE7C9">
                <value hash="876895B3" type="BinHex">3078464646464646464600</value>
                <value hash="51953DD2" type="BinHex">FFFFFFFF</value>
                <value hash="BE3FDC7D" type="BinHex">3078303034353533334300</value>
                <value hash="7412DAC6" type="BinHex">3078303034353533334400</value>
                <value hash="AADD0D3E" type="BinHex">09000000</value>
              </object>
            </object>

I've tried switching this section out for the M16 equivalent section (a few numbers are different), thinking because the M16 is labeled as full auto it might fit in, and there's no change, still no firing sound... :(
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: nexor on February 21, 2012, 03:38:47 AM
Quote from: TheFishlord on February 20, 2012, 06:28:41 PM

This may solve the problem I pointed out in another thread about the "burst" of sounds. I'll go fix my FAL up with this and see what happens.

EDIT: This silences the weapon entirely (no firing sound at all now). I'll see if I can find any way around that...

Brilliant w@&k mate, you might have stumbled onto something, did you test it to find out if any of the mercs can hear the firing sound, if they can't hear it either then it's exactly what we want, imagine spreading death and destruction amoungst the mercs and they don't know where it comes from.......................  :-X :-D

Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: TheFishlord on February 21, 2012, 11:26:01 AM
Quote from: nexor on February 21, 2012, 03:38:47 AM
Brilliant w@&k mate, you might have stumbled onto something, did you test it to find out if any of the mercs can hear the firing sound, if they can't hear it either then it's exactly what we want, imagine spreading death and destruction amoungst the mercs and they don't know where it comes from.......................  :-X :-D

No unfortunately they still do. The weapon behaves exactly like it does normally (semi auto of course, so at least that works), just no firing sound. Reloading sounds are still there as well.
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: nexor on February 21, 2012, 01:50:25 PM
Damn, there goes my hopes................. :'(
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: TheFishlord on February 21, 2012, 07:25:34 PM
Well, I haven't exactly made progress on the issue, but I've learned something new from it that we should probably keep in mind.

When you look in the WeaponsProperties files, the "21" file will have only the weapon, with .Multi after it. This, according to the gamemodesconfig file, refers to the multiplayer version (which differs significantly from the single player version many times).

So, DO NOT MESS WITH THIS. At best, it won't be modifying your single player weapons so you won't get the effect you want; at worst, when you go online Punkbuster might ban you for it.

Now this next part I don't know for sure, but I think it's reasonable: The ONLY weapons codes we need to look at are in the 41weaponsproperties file. Inside there you have weapons with the .Multi suffix (same multiplayer version, don't know why there are two...), a .Persistent version, which I have no idea what it does (perhaps the AI's weapons), and the plain, no suffix version.

We don't need to look in 21_WeaponsProperties because only the .Multi version is in there anyway. Hence why when chiconspiracy is modifying weapon accuracy he only needs to mod the 41, and leaves 21 alone.

The no suffix version is probably the one that needs to be changed to affect single player. So we can save a lot of time by only modifying that one, no need to go through and do all of them now. I suspect this is what first happened when the OP tried to mod his M16 - he modded a .Persistent or .Multi by accident, and saw no effect, so his instructions say to change all of their burst values. I believe that you only need to change the suffix-less version.

I've just come to this conclusion after a hard few attempts at fixing my sound issue, but I have a mountain of homework to do, so I'm not going to try what I did with the .Multi's on the regular code for now, too busy  :( When I get back to this tomorrow afternoon I'll report again.
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: PZ on February 21, 2012, 07:43:01 PM
This is good information - helps others avoid the problems you encountered.  :-X
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: TheFishlord on February 22, 2012, 03:24:19 PM
Well, progress!  :lamp:

I was correct on my previous post - if you want to mod single player weapons, you only need to do the suffix-less section.

I have...sort of...corrected the sound problem. Not really. But anyway, it seems that both sounds and weapons are labeled as "SingleShot" "FullAuto" or "PrepareShot". When the weapon and the sound don't match, you won't hear any firing sound. (Although I've only tried changing weapons from FullAuto to SingleShot, I should try the other way around to confirm this)

Well, I got around this on the FAL by copying the whole chunk of code under "Sounds" for the Dragunov (being a SingleShot) and putting it in place of the FAL's sounds. It is strange that this worked since the sections do not seem to match up - the FAL has five or six extra lines, what for I don't know.

But anyway now the FAL uses the Dragunov firing sound, which I think I will stick with, it's a 7.62mm, I'll use it in my mod. The strange thing is though that the FAL's reload sound is still used, so reloading is not covered under the "sounds" section. Perhaps the jamming and failure sounds now belong to the Dragunov but I'll have to do some playing to get my FAL that rusty.

So anyway, not exactly a fix, but a workaround. Game is fully playable with the new semi auto fix, just a little funky here on the sound. I'll keep trying but I think this is a problem that we would have to decode the hashes for, and Gibbed says that you need to do each one individually, which I don't have the expertise for.
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: PZ on February 22, 2012, 04:57:47 PM
Good w@&k TheFishLord - looking forward to your investigations!
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: TheStranger on February 23, 2012, 10:43:44 AM
Yeah good job. I also looked in the sound files a while ago, but didn't find anything useful :( Ahrgh and they could have made modding so easy.
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: PZ on February 23, 2012, 11:02:43 AM
Quote from: TheStranger on February 23, 2012, 10:43:44 AM
... Ahrgh and they could have made modding so easy.

They sure could have, but I seriously doubt that they wanted any modding done.  It is only because of guys like gibbed, who can reverse engineer things that we can do modding of any kind in FC2.

I wish gibbed had become interested in the AC series
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: OWGKID on January 03, 2015, 02:34:51 AM
http://www.binaryhexconverter.com/decimal-to-hex-converter (http://www.binaryhexconverter.com/decimal-to-hex-converter)
http://babbage.cs.qc.cuny.edu/IEEE-754/ (http://babbage.cs.qc.cuny.edu/IEEE-754/)

Two useful pages if you want to edit ammo values, scope zoom and more.
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: PZ on January 03, 2015, 05:35:22 AM
Nice  :-X
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: OWGKID on February 05, 2015, 12:43:43 AM
I took a look through your modded file and I saw you had renamed the "41_WeaponProperties" to "23_WeaponProperties". Om my first attempt on FC2 weapons modding, I crashed the game since I added both the "42_Weapons" in my "mymod" folder together with "41_WeaponProperties"  :D Should I rename "41_WeaponProperties" to "23_WeaponProperties"?
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: wobatt on February 05, 2015, 04:13:06 AM
As far as I can tell, the number at the start doesn't matter.

If you have more than one file called XX_WeaponProperties.xml (XX=any number) then it could cause problems, as some of the weapons will be defined twice.
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: OWGKID on February 05, 2015, 06:56:40 AM
The game worked great  :-() :-D I can now be a WALKING ARMOURY  >:D >:D >:D :-() :-() :laugh:
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: Art Blade on February 05, 2015, 10:54:28 AM
 :-D
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: OWGKID on March 06, 2015, 04:06:34 AM
If you'd like to reduce recoil for the weapons (without the manuals) , the following parameter (in bold) should be changed:
Spoiler
<object type="Recoil">
              <value name="iRecoilRecoveryLevel" type="Int32">1</value>
              <value name="fRecoilAchieveTime" type="Float">0.15</value>
              <value name="fRecoilAnimationWeight" type="Float">1</value>
              <value name="fRecoilMax" type="Float">30</value>
This is the default values for the MP5 and I used Wobatt's hash converter tool to decode them.

If you don't have Wobatt's tool, look for the hash "3B75D90F" and edit the hash "0788D065"
Spoiler
<object hash="3B75D90F">
              <value hash="158EFFD8" type="BinHex">01000000</value>
              <value hash="C0671E89" type="BinHex">EC51383E</value>
              <value hash="641C31C5" type="BinHex">0000803F</value>
              <value hash="0788D065" type="Float">1.21</value>
My modded value for the golden AK47. I changed the "BinHex" -> "Float". Gibbed's tool can re-pack the file with no problem.
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: PZ on March 06, 2015, 07:33:50 AM
Nice one, GKID  :-X
Title: Re: Weapons Editing? SOLVED (+Tutorial- Newbie Friendly)
Post by: OWGKID on March 06, 2015, 09:34:37 AM
I can now enjoy the PKM  :-D :-D