Member
Join Date: Feb 2006
Posts: 30
|
I created a def file that included a stat which I realize I no longer need.
I have already created a unit (in a data file) which uses that stat. Removing the stat from the stat set (in the def file) seems to have no impact on the data file - the unit still shows the stat and score assigned. Removing the stat from Unit Stat (in the def file) prevents the data file from being loaded, with the error that it references a missing stat. Is the only option to delete the unit, and create it from scratch? |
#1 |
Senior Member
Volunteer Data File Author
Join Date: Mar 2005
Posts: 345
|
if u remove the value assigned to the unit for that stat, save everything in the dat file then go to the def file n remove the stat then save etc that should be ok. Even if you remove a stat from a stat set it'll still show in the list but not in the position it was in the stat set (if that makes sense!!)
|
#2 |
Member
Join Date: Feb 2006
Posts: 30
|
Nope - it won't load the dat file, says unit stat referenced but not defined.
But I solved the problem just now, by manually editing that line out of the dat file. |
#3 |
Senior Member
Lone Wolf Staff
Join Date: Dec 2008
Posts: 4,690
|
At 04:50 PM 2/16/2006 -0500, you wrote:
>Nope - it won't load the dat file, says unit stat referenced but not defined. > >But I solved the problem just now, by manually editing that line out >of the dat file. You should be able to fix this by doing the following: 1) Make sure all units in all files have a blank value for the unit stat, and save them. Save all data (.dat) files. 2) Remove the stat from all stat sets. 3) Delete the stat entirely and save the defintion file. 4) Reload the data files. The stat should now be gone. If a unit stat has no value, it shouldn't get saved out to the .dat file, so when the file is reloaded the stat isn't there to cause problems. Hope this helps, -- Colen McAlister (colen@wolflair.com) Chief Engineer, Lone Wolf Development http://www.wolflair.com/ |
#4 |
Member
Join Date: Feb 2006
Posts: 30
|
>If a unit stat has no value, it shouldn't get saved out to the .dat file<
That's interesting. In my trial dat file, there are three other stats that are set at zero, and all appear in the dat file. For instance: <statval stat="ma" value="0"/> Perhaps it's something about the way I have things set up... ? |
#5 |
Member
Join Date: Feb 2006
Posts: 30
|
OK, I get it now. "Blank" value - empty, not even zero!
|
#6 |
Senior Member
Lone Wolf Staff
Join Date: Dec 2008
Posts: 4,690
|
At 11:10 AM 2/17/2006 -0500, you wrote:
>OK, I get it now. "Blank" value - empty, not even zero! Exactly. Zero is still a "0" character, which is different from nothing - if they're empty / blank, there's nothing to save out. -- Colen McAlister (colen@wolflair.com) Chief Engineer, Lone Wolf Development http://www.wolflair.com/ |
#7 |
Member
Join Date: Feb 2006
Posts: 30
|
I'm used to working in a scripting language where blank and zero are equal - so, my oops!
|
#8 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
Since AB uses XML as its fundamental file format, we've embraced the conventions established by XML. Within XML, there's a huge difference between an attribute or element being omitted vs. it existing and having a particular value. AB relies on this distinction in a variety of places, and this is one of them. :-)
-Rob At 12:58 PM 2/17/2006, you wrote: Quote:
|
|
#9 |
|
|