Jump to content
XCOMUFO & Xenocide

Prg-items Schema


captainmikey

Recommended Posts

Okay, this is what I have so far. I tried to base these files off the facilities

schema as much as possible. Please check the XML file, and tell me if that

format is acceptable.

 

I added a <graphic> node that contains a string for a mesh filename (for use in

the game), and one for a bitmap filename (for use in the load-out screen) ... just

let me know if this doesn't belong here.

 

Item ID is not checked to make sure it is in the range for the type

(e.g. weapons are supposed to be in the range 1001-10000). I'm

not sure if this can be validated via XML Schema.

 

I am unsure how to implement <owners>, <owner>, <environments>,

and <acquire> so I omitted them for now.

 

I was going to continue adding derived types for each possible combination

of values required for the <action> node as follows:

 

XSD Type.........................Action Nodes [optional]

 

weaponItemType.................snapshot, aimedshot, [autoshot] (IMPLEMENTED)

loadoutWeaponItemType......loadout, snapshot, [autoshot]

guidedWeaponItemType.......guided, [loadout]

grenadeWeaponItemType.....prime, throw

meleeWeaponItemType........touch

 

Am I going about this the right way?

itemv01.xsd

itemv01.xml

Link to comment
Share on other sites

Looking good, I would change the Text node as we have discussed because the complete parsing depends on the Parser, nothing grants you that you are going to get a normalized DOM Structure there, while you have with attributes.

 

As you replied by PM It is true I had checked on my validator and yes it validates text nodes too, but I didnt use them because of the first reason so it seams I skipped that from the Schema Standard.

 

Greetings

Red Knight

Link to comment
Share on other sites

Looking good, I would change the Text node as we have discussed because the complete parsing depends on the Parser, nothing grants you that you are going to get a normalized DOM Structure there, while you have with attributes.

 

Ah, okay, I think I understand now. I fixed that up and finished the derived types for the 5 different weapon types.

 

Here's the updated Schema and sample XML file. If they look correct I'll start in on the equipment types in a similar manner (one derived type for each of the 5 different equipment types).

itemv02.xsd

itemv02.xml

Link to comment
Share on other sites

Take out the bitmap reference and the graphics one... put instead a descriptor with an abstract descriptor type.

 

BTW do you have the Items/Weapons System design? Well I will upload it just to make sure you read it :)

 

Greetings

Red Knight

Items_and_Weapons_Design_Doc_V0.0.2.rar

Link to comment
Share on other sites

When you say "descriptor" is that the same as element?

 

<xs:complexType name="graphicType" abstract="true"/>

...

 

Like that?

 

I read the weapons & items design doc: should I be modelling the XML structure using them? So far I've been using the XDD-ItemsConfiguration.rtf file that you emailed me.

Edited by captainmikey
Link to comment
Share on other sites

Yes, and change the type so that we define the item in game descriptor later.

 

... where descriptor is a descriptorType that is abstract too.

 

The more up to date is that design, that in time was based on Cpt. Boxershorts DTDs. I though you have already read that ones from the forum, but in case you didnt I put them here again.

 

Greetings

Red Knight

Edited by red knight
Link to comment
Share on other sites

  • 3 weeks later...

Awesome :).

 

Few propositions:

1. Change "guided" to "guide" so it's verb like "shot" and "throw", not adjective (now). This only goes to actions, not name "guidedWeaponItemType".

2. Change melee to hit (see above, now noun to verb).

3. Change element "action" to type "actionType" from "customActionType", so user can add not only custom actions, but also shot actions, gudie actions etc. to items that don't have them defaultly (this will require to use xsi:type attribute).

4. Integrate it with basic.xsd (so this IDs stuff will be straighten out).

 

Guyver

 

PS. My propositions zipped and attached :)

item.zip

Link to comment
Share on other sites

1. Change "guided" to "guide" so it's verb like "shot" and "throw", not adjective (now). This only goes to actions, not name "guidedWeaponItemType".

2. Change melee to hit (see above, now noun to verb).

3. Change element "action" to type "actionType" from "customActionType", so user can add not only custom actions, but also shot actions, gudie actions etc. to items that don't have them defaultly (this will require to use xsi:type attribute).

4. Integrate it with basic.xsd (so this IDs stuff will be straighten out).

Thanks for doing the work in advance :D

1. The verb is 'shoot', and the action itself is referred to as a 'shot', hence the misunderstanding ('guided' as 'guided shot'). Changed those nevertheless.

4. Unfortunately, setting type to whateverID kills the ID check, which would prevent redefinitions. So I added the whateverREF types, which are the old ones, and now the whateverID types are the unique ones; will change that elsewhere together with the id->name change.

 

edit: basic.xsd update.

item.zip

Edited by centurion
Link to comment
Share on other sites

BTW, what's loadout weapon? Ship weapon? Or what? :Blush: I can't figure that out.

 

Anyway, changes are:

1. Abstracted weapons a little more, so it's little more clearer now what's weapon and what's not. Also extending weapons might be easier.

2. For clips added list of weapons they can be used with.

3. Changed action elements for equipment as optional (before at least 1 action had to be defined).

4. You can now define what clips can be used with weapon (optional).

5. Added capacity to clips.

 

Guyver

item.zip

Link to comment
Share on other sites

Loadout weapons are the unremovable ones, like the chryssalid's "weapon". XCAPs, terrorists and psi-using aliens use them.

 

Slightly modified the schema to my liking :Blush: .

item.zip

Link to comment
Share on other sites

First and foremost: I thought that this_kind_of_names like money_const are not permitted. RK asked me to use thisKindOfIdentifiers.

 

Second: I don't like underscores either :unsure:

 

Anyway, wouldn't be it easier to use 0 capacity to indicate infinity? Logically clip having 0 capacity does not exist :).

 

Another thing is that I believe that capacity attribute is more connected with a clip and not with damage. So let's move it to clipItemType.

 

Only propositions to discuss, I haven't change anything.

 

Guyver

 

EDIT: I'm keeping subversion repository of those xml schemas for the sake of being able to move to whatever version I want.

Edited by guyver6
Link to comment
Share on other sites

Can someone send me the whole bunch of schemas out there to add them to the CVS??? As I do think too that those iterations are getting out of control too, so we must have some sort of stable versions in CVS too.

 

About identifiers, dont use underscores as guyver said... for types use names like variable names finishing with Type and for Reference Identifiers use constant kind of identifiers all in uppercase.

 

Greetings

Red Knight

Link to comment
Share on other sites

Underscores changed. Affects the combatants and research schemas, should I repost them?

Anyway, wouldn't be it easier to use 0 capacity to indicate infinity? Logically clip having 0 capacity does not exist :).

Yes, and that's why it's better IMHO to use a separate identifier for them. I will forget the special meaning of 0, you will forget the special meaning of 0, and the code will not handle it well, producing weird bugs. This way the .xml is self-explanatory.

Another thing is that I believe that capacity attribute is more connected with a clip and not with damage. So let's move it to clipItemType.

Well, the 'damage' tag tells you how much of what does the clip hold, for how many attacks. It looks unnatural to me to move the capacity into the head tag of the clip item. So in the attached version you have the numerical data in a separate element, just to make you see how weirdly does it look like :P .

 

edit: tried to put in the smiley by code <_>item.zip

Edited by centurion
Link to comment
Share on other sites

×
×
  • Create New...