Home » MODDING HQ 1.13 » v1.13 General Development Talk » Automagical XML Editing/Error Checking via AutoIt
Automagical XML Editing/Error Checking via AutoIt[message #342095] Sun, 16 August 2015 17:12
Redwolf is currently offline Redwolf

 
Messages:41
Registered:July 2009
Disclaimer:
Beware! These scripts are of very poor coding quality, not made with you in mind, but they are very simple to understand if you read through them.
They are not plug and play kind of things, they only do exactly what I want them to do, but they are theoretically rather powerful, you just have to make them into what you want them to do.
They do NOT make neat/pretty xml files, but they make xml files which apparently sufficiently conform to standards, and I've had no issues playing with them.
Comments are usually just old/unused/broken code, not actual comments like you would be used to.
If these were useful to you, I'd sure like to know. If something doesn't work, feel free to post, I'll help as time permits
If at any time you wonder why did I do it this way the answer is probably sloppy coding.
These scripts are probably not bug-free.

What you'll need: * = optional
0) 7zip or equivalent.
1) Autoit: https://www.autoitscript.com/site/autoit/downloads/ (Download Autoit button).
2*) SciTE (Button underneath that, or https://www.autoitscript.com/site/autoit-script-editor/downloads/ ).
3) _XMLDomWrapper.au3 (in the zip) in your C:\Program Files (x86)\AutoIt3\Include folder.
4) Each script in the folder next to the relevant xml file (see _XMLFileOpen for which each needs).
5*) Notepad++ for sexy .ini viewing.

Usage/Notes/Whatever:
Item repairable.au3:
Makes all items non-Unaerodynamic, Non-Takeswaterdamage, Non-Sinking, makes items of certain classes repairable, sets BR's stock of all items already available at BR to 200, sets all ammo crates as for sale on BR, removes stealth/ap/aim maluses on gear, Sets PP-93s size to 3 and Gas Masks to 18, logs items that don't have size set (error checking).
This is probably the most important one, you should learn how to do almost anything from this, it deletes nodes, updates nodes, makes new nodes, reads nodes, makes logs...
Merc alltraits.au3:
This one changes MercProfiles.xml to my liking, it shows you how to read an xml value and change stuff depending on it, also there's a new function (_XMLUpdateField2) to automatically create the field if it doesn't exist.
Ammo List.au3:
From before when I learned how to properly get .xmls into an excel table, this makes an .ini which has a category for each caliber and lists each weapon of that caliber (I wanted to know if there were good weapons for certain calibers or if I can safely sell the ammo). If you open this .ini with notepad++ and then select View => Toggle all folds (or hit alt+0) you'll see what I mean.
Attachables.au3:
From before you could get tooltips for what attachments work, this lists each item that can take attachments in it's class and lists the attachments it can take. Needs items.ini from Items Names.au3.
Items Names.au3
Creates Items.ini for other scripts and personal use (Lists/Sorts items by Classes/Sizes)
Merges.au3
Writes a Merges.ini that shows all merges (sorted by the class of something), not sure if this is up to date...
Grenade Renaming.au3
Renames Grenades/Explosives with damage/radius like so: 60/5 Mine, 100/13 Mortar Shell, 110/13 C1, 120/13 HMX, 100/11 TNT, 80/11 RDX, 50/9 Mk2 Grenade, 30/7 Mini Grenade (examples), it reads the prepend value from Explosives.ini, created by Items Names.au3

Stuff I had left over and didn't rework (most likely completely broken, but might still be interesting to someone)
Weapon Changes.au3:
Dynamically changes weapons stats based on weapon class (mostly normalizes, IIRC I made this because I wanted weapon comparing to be easier, less differences = easier comparison)

Download:
http://puu.sh/jDBP0/cd75e08c0b.7z Size: 24kb
Feel free to send me a pm if it's down.

[Updated on: Wed, 19 August 2015 12:55]

Report message to a moderator

Corporal
Previous Topic: Anyone playing IOV mod? Merc stating gear disappear
Next Topic: merc assignments enum
Goto Forum:
  


Current Time: Thu Apr 18 04:05:21 GMT+3 2024

Total time taken to generate the page: 0.00733 seconds