Sabranan -> RE: Modding Tool (3/2/2017 11:07:25 PM)
|
So in preparation for the next feature release (1.1.0.0) I figured I’d show off some of what’ll be coming in the next partial feature release (1.0.1.0). This revision (number 4) contains my latest work on the on-load data validator. It now checks the research file with the exception of the ability lines and the component improvement lines (they’re a fair bit more complex because the valid values change depending on the ability/component type). As an example of what this can do for you, I’ve manually introduced some errors into the default games first project “Wave Weapons”. It looks like this: PROJECT ;0, Wave Weapons, X, -5, 10, armour, I'm Special, 10000000000.0, COMPONENTS ;129, , 4 FIGHTERS;48 FACILITY; 4 PLAGUE CHANGE; -1, Random Plague, 200000000, -10x00, Duration, -200000000, 50%, 2 Hours ALLOWED RACES; happyonish PARENTS ;N As you might imagine, DW would freak if you tried to load a research.txt file containing the above into it and so would my tool when you tried to open the project in the research form. It can’t allocate words to a number field or set a drop-down box to a negative value or something beyond its range. It also doesn’t always deal well with missing values like the blank component or the orphaned “N” in the parents line. Until now. Now it pre-emptively finds those invalid values and sets them to something that is valid. Usually this is just a default value so you’ll probably see a lot of 0’s in the log. But it can also fix issues like the blank components value, it’ll remove that value entirely and move the third one up a level. So “COMPONENTS ;129, , 4” becomes “COMPONENTS ;129, 4” (or actually it becomes “COMPONENTS ;0, 4” since 129 isn’t a valid component). Another useful thing it can do is try to figure out which genuine race name is closest to what you’ve typed in and sets it to that. So “happyonish” gets changed to “Haakonish” rather than just getting dropped. Very handy for when you make a simple capitalisation error or you’ve missed a letter. This is the actual contents of the input log when loading in the above project: Beginning data validation on Research Invalid tech level value "X" found in Research record 0) Wave Weapons, value changed to "0" Invalid row value "-5" found in Research record 0) Wave Weapons, value changed to "1" Invalid industry value "10" found in Research record 0) Wave Weapons, value changed to "0" Invalid category value "armour" found in Research record 0) Wave Weapons, value changed to "0" Invalid special function code value "I'm Special" found in Research record 0) Wave Weapons, value changed to "0" Invalid base cost multiplier override value "10000000000.0" found in Research record 0) Wave Weapons, value changed to "0" Invalid enable component 0 value "129" found in Research record 0) Wave Weapons, value changed to "0" Invalid enable fighter 0 value "48" found in Research record 0) Wave Weapons, value changed to "0" Invalid plague change index value " -1" found in Research record 0) Wave Weapons, value changed to "0" Invalid plague change mortality rate value "200000000" found in Research record 0) Wave Weapons, value changed to "0.001" Invalid plague change infection chance value "-10x00" found in Research record 0) Wave Weapons, value changed to "0" Invalid plague change duration value "Duration" found in Research record 0) Wave Weapons, value changed to "1" Invalid plague change exception mortality rate value "-200000000" found in Research record 0) Wave Weapons, value changed to "0.001" Invalid plague change exception infection chance value "50%" found in Research record 0) Wave Weapons, value changed to "0" Invalid plague change exception duration value "2 Hours" found in Research record 0) Wave Weapons, value changed to "1" Invalid race (allowed races) value "happyonish" found in Research record 0) Wave Weapons, value set to "Haakonish" Invalid project parent 0 value "N" found in Research record 0) Wave Weapons, value changed to "0" Invalid project parent 0's obligatory flag value "" found in Research record 0) Wave Weapons, value changed to "N" Data validation on Research complete, found and corrected 18 values As it turns out, this runs really well so I've set this to run by default for the time being. If you do find it's causing you issues there's a new checkbox on the main menu to disable it. Minor warning, my free digital certificate has expired so I've published this as unsigned to avoid forcing users to reinstall which happens when you sign it with a new certificate. It'll say "Unable to verify publisher" or something similar and ask if you still want to install. It seems redundant to sign an application that's just not used enough to gain trust status from Microsoft and naturally I'm unwilling to pay for a permanent certificate when I'm doing this for free.
|
|
|
|