[Solved][Tips]Need Help with custom dataFiles

Posts

[Unknown user]'s Avatar
cyberbooster
New blood
New blood
Progress to next rank:
 
60%
 
Posts: 30
Joined: 02 Nov 2011, 16:53

Re: Need Help with custom dataFiles

Postby cyberbooster at 10 Nov 2011, 08:55

I had the same issue about costMultiplier on 7-64bit Italian language (thus using commas); but as you saw I have not used the costMultiplier in the scheme.
As you can see the system file is pretty simple, so I can't figure out why is telling that.

Looking @Snowblizz code I also see the error:
Code: Select all
C:\Users\Henri\WarFoundry-WinForms\data\Forgefathers.race: Unexpected XML declaration.
The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it. Line 1, position 7.


Which I hadn't.

EDIT: Maybe it depends on the encoding format used to save the files? Maybe some systems use UTF-8, while others systems use different encodings? I used notepad, but maybe is better if I switch to something more programming-styled like XmlPad
EDIT2: I tried loading up @Snoblizz corrected code, but WarFoundry doesn't show me the race under WarPath game system. I'm going to diff files and look for strange things :D
EDIT3: Ok i now can load everything. Trying to play around a bit, I'm working on it. :D
Last edited by cyberbooster on 10 Nov 2011, 09:51, edited 2 times in total.

[Unknown user]'s Avatar
snowblizz
Veteran Member
Veteran Member
Progress to next rank:
 
61%
 
Posts: 484
Joined: 08 Apr 2009, 06:55

Re: Need Help with custom dataFiles

Postby snowblizz at 10 Nov 2011, 09:40

cyberbooster wrote:I had the same issue about costMultiplier on 7-64bit Italian language (thus using commas); but as you saw I have not used the costMultiplier in the scheme.
As you can see the system file is pretty simple, so I can't figure out why is telling that.

Looking @Snowblizz code I also see the error:
Code: Select all
C:\Users\Henri\WarFoundry-WinForms\data\Forgefathers.race: Unexpected XML declaration.
The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it. Line 1, position 7.


Which I hadn't.

EDIT: Maybe it depends on the encoding format used to save the files? Maybe some systems use UTF-8, while others systems use different encodings? I used notepad, but maybe is better if I switch to something more programming-styled like XmlPad

The "XML error" hasn't anything to do with the datafile though, that's why I didn't mention it. When I copy your code from the forum it adds a tab in front of the first tag, which means it breaks XML structure and errors. I fixed that and reloaded the files in WF but it had already saved the issue into the log file. I should have cleaned it out but was lazy, my bad.
Windows uses ANSI as standard eg in Notepad, and yes it can cause problems. I recommend Notepad++, which I use now, so many things became easier with that, really nifty application.

Can you get the file to work if you use the modified code I posted?

[Unknown user]'s Avatar
cyberbooster
New blood
New blood
Progress to next rank:
 
60%
 
Posts: 30
Joined: 02 Nov 2011, 16:53

Re: Need Help with custom dataFiles

Postby cyberbooster at 10 Nov 2011, 10:22

Ok, now it works for me with no issue of costMultiplier (run only two times).
The encoding could be a serious issue. Is any way to build an army editor within the software?
Have we got a dtd file, which could be used to validate armies?

A couple of more issues:
How do I declare which races are allies for each one?

I have a limit (in the game system) that allows me to put a maximum amount of "special" units (for each kind) equal to the number of Infantry units with at least 10 models in it. So it is pretty hard to set it up using only %, is there another system?
For example, if I have 2 Infantry units, one with 5 models and one with 20 models, I can put in the army only 1 Ordnance, 1 Armour, 1 Aircraft and 1 Hero/Monster. I see that I could set up the limit for "special" units to maximum 50%, but I have a lower limit issue because the allowed number of units depends on what already is in the army (and only Infantry units equals or greater than 10 models).

EDIT: I added multiple units since the posted version at page 1, including some with costMultiplier 0.5 or 0. So far no problems.
EDIT2: I added to the yahoo group the warpath system file, could be useful if someone wants to start doing some work on others races.

[Unknown user]'s Avatar
snowblizz
Veteran Member
Veteran Member
Progress to next rank:
 
61%
 
Posts: 484
Joined: 08 Apr 2009, 06:55

Re: Need Help with custom dataFiles

Postby snowblizz at 10 Nov 2011, 11:59

There is an editor being coded, but it's not finished yet. Since it's a open project people drift in and out and I think who guy who was making it isn't active right now. That would remove the structural issues. Though it will always be possible to manually make invalid files. With so few people making datafiles so far it has made more sense to concentrate on developing the main program's features.

There are dtds files for all XMls and the program does validate files, that's why you got an error message.

I do not think the defining of allies for an army is implemented yet.

Currently there is no alternative to the %s. And I do not think even those are actually enforced in any way. I've never noticed them to be at any rate. I've been meaning to push for them but since GW changed the way armies are picked in 8th edition I didn't need to as much.
So there no such restrictions yet. They should hopefully be possible to implement once IBBoard gets the requirements completely implemented and we get a more extensive ability to define requirements and restrictions for units and equipment.

For now you probably need to put in a note and let the user police himself.

[Unknown user]'s Avatar
cyberbooster
New blood
New blood
Progress to next rank:
 
60%
 
Posts: 30
Joined: 02 Nov 2011, 16:53

Re: Need Help with custom dataFiles

Postby cyberbooster at 10 Nov 2011, 12:49

Ok. I won't make notes about that, because it wouldn't make sense to put the same note on 75% of the units in an army. I hope people will read the game manual.

Anyway, there is another small issue that I need to fix:
I have a vehicle which can choose between having 4 identical weapon or another set of 4 identical weapon. I tried to set up a type and set minimum to 4 (and then individually from 0 to 4) but obviously it will not work because you can't setup a minimum for a type.

Edit: another thing, is any way to set up an ability and then apply different levels of that ability to different units? Actually I coded the same ability with different levels as if they were different from each others (so it works), but I would like to make things easier.

[Unknown user]'s Avatar
snowblizz
Veteran Member
Veteran Member
Progress to next rank:
 
61%
 
Posts: 484
Joined: 08 Apr 2009, 06:55

Re: Need Help with custom dataFiles

Postby snowblizz at 10 Nov 2011, 14:00

cyberbooster wrote:Ok. I won't make notes about that, because it wouldn't make sense to put the same note on 75% of the units in an army. I hope people will read the game manual.

That's something I've put into a readme file for the race file

cyberbooster wrote:Anyway, there is another small issue that I need to fix:
I have a vehicle which can choose between having 4 identical weapon or another set of 4 identical weapon. I tried to set up a type and set minimum to 4 (and then individually from 0 to 4) but obviously it will not work because you can't setup a minimum for a type.

You would need to make a "default" set-up and let the user modify that. If it is the "Aircraft unit" then make both required and belonging to the same exclusivityGroup. I did something similar for Dark Elf jetfighter entry, looks like this.
Code: Select all
      <equipmentSlots>
         <equipmentSlot name="missile">
            <maxLimit>
               <core:absoluteLimit limit="4" />
            </maxLimit>
         </equipmentSlot>
      </equipmentSlots>
         <unitEquipment>   
            <unitEquipmentItem id="DarkLance" required="true" exclusivityGroups="wing" costMultiplier="0"><minLimit><core:absoluteLimit limit="2" /></minLimit><maxLimit><core:absoluteLimit limit="2" /></maxLimit></unitEquipmentItem>
            <unitEquipmentItem id="Disintegratorcannon" required="true" exclusivityGroups="wing" ><minLimit><core:absoluteLimit limit="2" /></minLimit><maxLimit><core:absoluteLimit limit="2" /></maxLimit></unitEquipmentItem>
            <unitEquipmentItem id="Monoscythemissile" costMultiplier="0" equipmentSlot="missile"><minLimit><core:absoluteLimit limit="0" /></minLimit><maxLimit><core:absoluteLimit limit="4" /></maxLimit></unitEquipmentItem>
            <unitEquipmentItem id="Necrotoxinmissile" costMultiplier="0.5" equipmentSlot="missile"><minLimit><core:absoluteLimit limit="0" /></minLimit><maxLimit><core:absoluteLimit limit="4" /></maxLimit></unitEquipmentItem>
            <unitEquipmentItem id="Shatterfieldmissile" costMultiplier="0.5" equipmentSlot="missile"><minLimit><core:absoluteLimit limit="0" /></minLimit><maxLimit><core:absoluteLimit limit="4" /></maxLimit></unitEquipmentItem>
            <unitEquipmentItem id="Twin-linkedsplinterrifles" required="true" exclusivityGroups="upg" />
            <unitEquipmentItem id="Nightshields" />
            <unitEquipmentItem id="Flickerfield" />
            <unitEquipmentItem id="Splintercannon" required="true" exclusivityGroups="upg" />
         </unitEquipment>

In this case I had to allow for any mix of missiles 0-4 so the user has to pick those and can't make the required items.
However the "wing" mounted weapons are 2 Dark Lances swappable for 2 disintegrators.
They are both required but can replace each other. In this case in the program the Darklances will be pre-selected (the program takes the first required item from a list if they belong to the same group) and you can replace them with the other option, but otherwise you cannot modify either option.

cyberbooster wrote:Edit: another thing, is any way to set up an ability and then apply different levels of that ability to different units? Actually I coded the same ability with different levels as if they were different from each others (so it works), but I would like to make things easier.

No. I've done different versions of the special rule just as you did. WHFB has eg. Magic Resistance (1) (2) (3) so I've just made a different one for each "level". It's not much a bother when I've used a spread sheet tool to do it, copy/paste basically. I should have mentioned that before. I wrote a spreadsheet with macros to make datafile coding easier. It's not always "user friendly" because I made it for my own use. You can read about it here: http://dev.ibboard.co.uk/projects/warfo ... ipmentTool
I've made it more advanced but more complicated now.

[Unknown user]'s Avatar
cyberbooster
New blood
New blood
Progress to next rank:
 
60%
 
Posts: 30
Joined: 02 Nov 2011, 16:53

Re: Need Help with custom dataFiles

Postby cyberbooster at 10 Nov 2011, 17:08

Thank you very much.
I know I can be a pain in the ass, but once learned I will not bother anymore about this :D

I uploaded the final version.

[Unknown user]'s Avatar
IBBoard
Administrator, Commissar
Administrator
Commissar
Progress to next rank:
 
38%
 
Posts: 4222
Joined: 20 Mar 2001, 20:24
Location: Worcestershire, UK

Re: [Solved][Tips]Need Help with custom dataFiles

Postby IBBoard at 10 Nov 2011, 19:39

I'll check the logs and try the old Cry Havoc build. Perhaps it is something that has been fixed by other work in later versions.

As for it being odd that it errors when it isn't there, I guess that could be clearer (if I can think of how to do it) but it is part of the way the XML works. The schema has a default value, so the code can assume it is there with a value, whether it is in the XML or not. If it isn't written in the XML file then the only way it should error is if your XSD file (in the schemas sub-folder) has a bad value or if some international settings are screwing something up again (but I thought XML defined a British/English decimal format).

If I ran Cyberbooster's original code as-is then I got an error about keys not being right, but your restructured code worked fine. If you upload the race and system files somewhere and your race.xsd file then I'll see if I can work out what happened.
Out now: Dawn of War Texture/Skin Downloads
At v0.1: WarFoundry (open source, cross-platform, multi-system army creation application)

[Unknown user]'s Avatar
cyberbooster
New blood
New blood
Progress to next rank:
 
60%
 
Posts: 30
Joined: 02 Nov 2011, 16:53

Re: [Solved][Tips]Need Help with custom dataFiles

Postby cyberbooster at 10 Nov 2011, 19:46

I uploaded everything on the yahoo group. The files should work just fine now (I switched from Notepad to a serious XML editor).

[Unknown user]'s Avatar
IBBoard
Administrator, Commissar
Administrator
Commissar
Progress to next rank:
 
38%
 
Posts: 4222
Joined: 20 Mar 2001, 20:24
Location: Worcestershire, UK

Re: [Solved][Tips]Need Help with custom dataFiles

Postby IBBoard at 10 Nov 2011, 19:55

(I switched from Notepad to a serious XML editor).

Good idea ;) Notepad is okay for very basic text editing, but proper editing (like larger files and XML) really does need something like Textpad or another more feature-filled editor :)

Thanks for posting the data files. WarFoundry won't officially distribute the files as it can put us in a tricky legal situation (certain companies *cough*GW*cough* like to throw the lawyers around) but copyright law varies around the world and the Yahoo group is data file area, thanks to Snowblizz :)
Out now: Dawn of War Texture/Skin Downloads
At v0.1: WarFoundry (open source, cross-platform, multi-system army creation application)

[Unknown user]'s Avatar
cyberbooster
New blood
New blood
Progress to next rank:
 
60%
 
Posts: 30
Joined: 02 Nov 2011, 16:53

Re: [Solved][Tips]Need Help with custom dataFiles

Postby cyberbooster at 10 Nov 2011, 19:59

I think you could contact Mantic directly: they release the Game Rules and Army List freely in Pdfs through their website, so maybe they'll be ok to put the files directly inside WarFoundry or their website.

Previous