Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Army Builder Forums > Army Builder
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
TMPEditor
Member
 
Join Date: Feb 2006
Posts: 30

Old February 16th, 2006, 08:53 AM
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?
TMPEditor is offline   #1 Reply With Quote
harkan
Senior Member
Volunteer Data File Author
 
Join Date: Mar 2005
Posts: 345

Old February 16th, 2006, 10:40 AM
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!!)
harkan is offline   #2 Reply With Quote
TMPEditor
Member
 
Join Date: Feb 2006
Posts: 30

Old February 16th, 2006, 12:50 PM
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.
TMPEditor is offline   #3 Reply With Quote
Colen
Senior Member
Lone Wolf Staff
 
Join Date: Dec 2008
Posts: 4,690

Old February 16th, 2006, 03:04 PM
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/
Colen is offline   #4 Reply With Quote
TMPEditor
Member
 
Join Date: Feb 2006
Posts: 30

Old February 16th, 2006, 06:22 PM
>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... ?
TMPEditor is offline   #5 Reply With Quote
TMPEditor
Member
 
Join Date: Feb 2006
Posts: 30

Old February 17th, 2006, 07:10 AM
OK, I get it now. "Blank" value - empty, not even zero!
TMPEditor is offline   #6 Reply With Quote
Colen
Senior Member
Lone Wolf Staff
 
Join Date: Dec 2008
Posts: 4,690

Old February 17th, 2006, 10:37 AM
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/
Colen is offline   #7 Reply With Quote
TMPEditor
Member
 
Join Date: Feb 2006
Posts: 30

Old February 17th, 2006, 11:58 AM
I'm used to working in a scripting language where blank and zero are equal - so, my oops!
TMPEditor is offline   #8 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old February 17th, 2006, 08:22 PM
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:
I'm used to working in a scripting language where blank and zero are equal - so, my oops!
rob is offline   #9 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:14 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.