Home » MODDING HQ 1.13 » v1.13 Modding, Customising, Editing » v1.13 XML Customization » 1.13 Xml Editing
|
|
|
|
|
Re: 1.13 Xml Editing[message #73502]
|
Fri, 09 September 2005 07:10
|
|
Madd_Mugsy |
|
Messages:634
Registered:July 2005 Location: Canada |
|
|
Kaiden,
While the weapon #s should match the item #s (although, technically, I guess they don't need to anymore), there don't need to be entries for non-weapon items. There are some empty, ignored entries at the end too.
Likewise, there are only 350 entries currently in items xml even though it can go up to 5000, and ~200 entries in attachments.xml even though that one can go up to 30,000 (yes, you can now have 30,000 attachment entries, instead of 182 in 1.12 with wedit ) For simplicity, I just set most of the max # of entries equal to the MAXITEMS constant ( = 5000 ) in the code. We can increase them if need be.
Majek,
Weapons.xml - look for the ubShotsPer4Turns stat in the G11 entry. Increasing this number will reduce the number of APs required to shoot the weapon, and vice versa. Both burst and single fire are controlled by this number.
Everyone:
Please note that changes to the xml files (except cities.xml, I'm not sure about that one), should take effect as soon as you've saved them and (re)started the ja2.exe. So any minor changes should not require starting a new game or anything.
Major changes, like moving items from one slot to another, can cause weirdness. For instance, if you move items from one slot to another, your items in your savegames will change to different things, and the items appearing on the maps may change too.
I also recommend against deleting items. Some things, like IMP starting gear, enemy equipment (including LAWs and GLs), and quest items are still dependent on certain items being in their original places. Replacing items with similar items should be okay though.
This restriction will be lessened somewhat in a future version, after I have figured out a way to externalize enemy and IMP equipment.
Of course, you should feel free to add as many new items as you wish.
Report message to a moderator
|
|
|
|
|
Re: 1.13 Xml Editing[message #73504]
|
Fri, 09 September 2005 07:32
|
|
Madd_Mugsy |
|
Messages:634
Registered:July 2005 Location: Canada |
|
|
Kaiden,
Ah. The uiIndex here doesn't match the items.xml, the bItemNo(1-50) attributes match the uiIndex in Items.xml. So each index has 50 gun choices.
In the original EnemyGunChoices in the code, there were less than 10 choices available. I extended it to fifty. I didn't go further because I got tired of typing (and my C++ skills are very poor when it comes to string parsing).
Keep in mind that there are 50 choices per weapon type (index), and there are 11 indexes, so that's room for 550 guns (and this file is just guns).
If it's not enough, we can extend it pretty easily.
We're stuck with 11 indexes though, unless we want to do some (maybe serious) work to extend it.
The uiIndex in this file (and only in this file) matches the following categories:
0 - low powered pistols
1 - high powered pistols/shtgn
2 - low SMGs/shtgn
3 - low rifles
4 - high SMGs
5 - medium rifles
6 - sniper rifles
7 - high rifles
8 - best rifles
9 - machine guns
10- rocket rifles / machine guns
Basically, it's least dangerous to most dangerous.
uiIndex: In general, think of this as the primary key / unique index for each entry in a given file.
The weapons.xml / explosives.xml / armours.xml / magazines.xml / etc. uiIndexes are matched to the ubClassIndex in Items.xml. (Even though it's prefixed with "ub", ubClassIndex is a UINT16 in the code)
Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: 1.13 Xml Editing[message #73519]
|
Sat, 10 September 2005 14:29
|
|
Madd_Mugsy |
|
Messages:634
Registered:July 2005 Location: Canada |
|
|
Yes and yes.
The uiIndex is a unique identifier for each file. It's actually the spot of the C++ array that the xml entry goes into. Each xml file goes into a different array, so there's no overlap.
So you don't need to worry about making all the uiIndexes different between files. Think of each xml file as a different table in a database. Each table has a primary key (uiIndex) that identifies each row (entry) in the table.
You also don't need to make all the uiIndexes 1000 in magazines.xml, 2000 in weapons.xml, 3000 in explosives.xml, etc. You could just group all your stuff together in the 1000 range, since each file is a separate array.
And you shouldn't use 1000 for weapons, 2000 for ammo, etc. in Items.xml because you'd need to have empty filler items between the filled entries or the game will think it's hit the end of the array. (To speed up the game, I made it stop looking through the items array once it hits an item with an item class of zero) Empty filler items will very quickly increase the file size without any benefit, besides organization. We're better off building some kind of database solution to organize the entries if we really need to.
So, in summary, just pick a starting number for all your entries in all your files. But make sure your items.xml entries are contiguous and there are empty filler ('nada') items between item 350 and your starting item entry.
Report message to a moderator
|
|
|
|
|
|
|
Re: 1.13 Xml Editing[message #73523]
|
Sat, 10 September 2005 19:02
|
|
Snap |
|
Messages:286
Registered:September 2000 Location: USA (by way of the Old Wo... |
|
|
Quote:Originally posted by Madd Mugsy:
I think the G11 is more of a full-auto rifle anyway, so you could just increase the bAutofireShotsPerFiveAP stat, and have it use less APs on auto (you can still shoot just 3 bullets on auto).
I'm reluctant to make it overly different, since there are better guns out there. G11 is different (in r/l). And in the game it fits nicely as a weapon with unique properties. But in weapons.xml its bBaseAutofireCost is already set to 0. If it still takes 11 APs per burst, then something is wrong.
Quote:Externalizing the original arrays is not something I forsee myself having time for in the near future. If you've got the code to compile, I can tell you how to do it though; it's not that hard. OK, no problem. I just thought that you might have some stand-alone tools that you were using when extracting this info. Anyway, any tips would be appreciated.
As for Proedit, since we now know the format of prof.dat, nothing stops us from making a new Proedit. It would be nice if someone made a GUI proggy, but in a pinch I could make a pair of command-line tools to convert between the encrypted data in prof.dat and an xml file.
Maps are still a problem though. Map editors are becoming increasingly incompatible with 1.13, and unless we get the editor working, there's little we can do about it.
Report message to a moderator
|
Master Sergeant
|
|
|
Re: 1.13 Xml Editing[message #73524]
|
Sun, 11 September 2005 03:17
|
|
Kaiden |
|
Messages:504
Registered:September 2003 |
|
|
Quote:
but in a pinch I could make a pair of command-line tools to convert between the encrypted data in prof.dat and an xml file.
If you did that, then we could start using the XML file instead of Prof.dat and would speed up some progress in other areas as well. I'd consider that a huge contribution right about now
Same thing with Imp.dat would be nice too
Quote:
Maps are still a problem though. Map editors are becoming increasingly incompatible with 1.13, and unless we get the editor working, there's little we can do about it.
It's towards the top of my todo list, I was having issues with getting the editor code to compile and work. And it looks like I need to extract all the maps in the maps folder for it to work, for some reason, but I decided to work on a few smaller projects first, and try to track down some of the uglier pre-1.13 bugs now. But again, it's in the top 5 of my projects list.
Like I told Mugsy, I have a very ambitious goal here, and I KNOW that I can't do it all by myself, at least not in any reasonable amount of time, but I would like to get JA2 as close as possible to NWN's style of editability and shared community content. We have ALL the tools we need for this, we just have to improve on them and put in alot of work. We definitely need a few more coders and some version control sooner than later.
Report message to a moderator
|
|
|
|
|
|
|
|
Re: 1.13 Xml Editing[message #73529]
|
Mon, 12 September 2005 02:25
|
|
Madd_Mugsy |
|
Messages:634
Registered:July 2005 Location: Canada |
|
|
Quote:
what must i do so that C-Mag adapter (9mm) will go on a pistol?
make a whole new item?
Because of the way the ammo works in the game, any items that provide a magsizebonus, like the c-mag adapter, must have a total mag size, including the bonus, that matches up to an existing magazine.
So for instance, the 5.56mm adapter has a magsizebonus = 70, so when it's attached to a weapon with magsize = 30, the total is 100 rds, which is how large the c-mags are, so it works.
So, yeah, you'd need to create a new adapter for pistols, with a magsize bonus of 85 (easiest way: just copy/paste the 9mm adapter to an empty item slot and change the magsizebonus). (15 rd pistol mag + 85 rd bonus = 100 rd c-mag)
Afterwards, you need to add the appropriate entries to the attachments.xml to allow the new adapter to attach to the various 9mm pistols.
Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Oct 04 08:20:16 GMT+3 2024
Total time taken to generate the page: 0.02314 seconds
|