FileStructure DEF: Difference between revisions

From OuroDev
m 9 revisions imported: Importing Portal Corps Wiki pages and history - Feb 6, 2020
 
(No difference)

Latest revision as of 10:02, 6 February 2020

DEF FILES


We all have seen them, they create all the fun toys we play with in game. Mostly they get generated from Excel, using PERL batch scripts.
Well these files are used to Generate BIN files, stored in PIGG containers for use by the client and server.
There are various way to extract or build them. What how are they structured?
Well I am going to show you an example:


EXAMPLE


This is part of the code that defines who a DEF File for a Character Class like Blaster/Controller is defined:

#ifdef CLASSES_PARSE_INFO_DEFINITIONS
TokenizerParseInfo ParseCharacterClasses[] =
{
 	{ "Class", TOK_STRUCT(CharacterClasses, ppClasses, ParseCharacterClass)},
	{ "", 0, 0 }
};
#endif


That outputs:
Class
[INSERT CHARACTER CLASS STRUCT HERE]

</BR> TokenizerParseInfo ParseCharacterClass[] =
</BR> {
</BR> 	{ "{",                   		TOK_START,			0 },
</BR> 	{ "Name",                		TOK_STRING(CharacterClass, pchName, 0)              },
</BR> 	{ "DisplayName",         		TOK_STRING(CharacterClass, pchDisplayName, 0)       },
</BR> 	{ "DisplayHelp",         		TOK_STRING(CharacterClass, pchDisplayHelp, 0)       },
</BR> 	{ "AllowedOrigins",      		TOK_STRINGARRAY(CharacterClass, pchAllowedOriginNames)},
</BR> 	{ "SpecialRestrictions",		TOK_STRINGARRAY(CharacterClass, pchSpecialRestrictions)},
</BR> 	{ "StoreRequires",				TOK_STRING(CharacterClass, pchStoreRestrictions, 0)},
</BR> 	{ "LockedTooltip",				TOK_STRING(CharacterClass, pchLockedTooltip, 0)},
</BR> 	{ "ProductCode",				TOK_STRING(CharacterClass, pchProductCode, 0)},
</BR> 	{ "ReductionClass",				TOK_STRING(CharacterClass, pchReductionClass, 0)},
</BR> 	{ "ReduceAsArchvillain",		TOK_BOOLFLAG(CharacterClass, bReduceAsAV, 0)},
</BR> 	{ "LevelUpRespecs",				TOK_INTARRAY(CharacterClass, piLevelUpRespecs)},
</BR> 	{ "DisplayShortHelp",    		TOK_STRING(CharacterClass, pchDisplayShortHelp, 0)  },
</BR> 	{ "Icon",						TOK_STRING(CharacterClass, pchIcon, 0)              },
</BR> 	{ "PrimaryCategory",			TOK_STRING(CharacterClass, pchTempCategory[kCategory_Primary], 0)   },
</BR> 	{ "SecondaryCategory",			TOK_STRING(CharacterClass, pchTempCategory[kCategory_Secondary], 0) },
</BR> 	{ "PowerPoolCategory",			TOK_STRING(CharacterClass, pchTempCategory[kCategory_Pool], 0)      },
</BR> 	{ "EpicPoolCategory",			TOK_STRING(CharacterClass, pchTempCategory[kCategory_Epic], 0)      },
</BR> 	{ "AttribMin",					TOK_STRUCT(CharacterClass, ppattrMin,				ParseCharacterAttributes)      },
</BR> 	{ "AttribBase",					TOK_STRUCT(CharacterClass, ppattrBase,				ParseCharacterAttributes)      },
</BR> 	{ "StrengthMin",				TOK_STRUCT(CharacterClass, ppattrStrengthMin,		ParseCharacterAttributes)      },
</BR> 	{ "ResistanceMin",				TOK_STRUCT(CharacterClass, ppattrResistanceMin,		ParseCharacterAttributes)      },
</BR> 	{ "AtrribDiminStrIn",			TOK_STRUCT(CharacterClass, ppattrDiminStr[kClassesDiminish_Inner],		ParseCharacterAttributes)      },
</BR> 	{ "AtrribDiminStrOut",			TOK_STRUCT(CharacterClass, ppattrDiminStr[kClassesDiminish_Outer],		ParseCharacterAttributes)      },
</BR> 	{ "AtrribDiminCurIn",			TOK_STRUCT(CharacterClass, ppattrDiminCur[kClassesDiminish_Inner],		ParseCharacterAttributes)      },
</BR> 	{ "AtrribDiminCurOut",			TOK_STRUCT(CharacterClass, ppattrDiminCur[kClassesDiminish_Outer],		ParseCharacterAttributes)      },
</BR> 	{ "AtrribDiminResIn",			TOK_STRUCT(CharacterClass, ppattrDiminRes[kClassesDiminish_Inner],		ParseCharacterAttributes)      },
</BR> 	{ "AtrribDiminResOut",			TOK_STRUCT(CharacterClass, ppattrDiminRes[kClassesDiminish_Outer],		ParseCharacterAttributes)      },
</BR> 	{ "AttribMaxTable",				TOK_STRUCT(CharacterClass, ppTempAttribMax,		ParseCharacterAttributesTable) },
</BR> 	{ "AttribMaxMaxTable",			TOK_STRUCT(CharacterClass, ppTempAttribMaxMax,	ParseCharacterAttributesTable) },
</BR> 	{ "StrengthMaxTable",			TOK_STRUCT(CharacterClass, ppTempStrengthMax,		ParseCharacterAttributesTable) },
</BR> 	{ "ResistanceMaxTable",			TOK_STRUCT(CharacterClass, ppTempResistanceMax,	ParseCharacterAttributesTable) },
</BR> 	{ "ModTable",					TOK_STRUCT(CharacterClass, ppNamedTables,        ParseNamedTable)            },
</BR> 	{ "ConnectHPAndStatus",			TOK_BOOL(CharacterClass, bConnectHPAndStatus, 0), BoolEnum},
</BR> 	{ "ConnectHPAndIntegrity",		TOK_REDUNDANTNAME|TOK_BOOL(CharacterClass, bConnectHPAndStatus, 0), BoolEnum},
</BR> 	{ "DefiantHitPointsAttrib",		TOK_AUTOINT(CharacterClass, offDefiantHitPointsAttrib, 0), ParsePowerDefines },
</BR> 	{ "DefiantScale",				TOK_F32(CharacterClass, fDefiantScale, 1.0f)  },

</BR> 	// These are for shared memory stuff. Ignore them.
</BR> 	{ "_FinalAttrMax_",				TOK_POINTER(CharacterClass, pattrMax, iNumBytesTables) },
</BR> 	{ "_FinalAttrMaxMax_",			TOK_POINTER(CharacterClass, pattrMaxMax, iNumBytesTables)    },
</BR> 	{ "_FinalAttrStrengthMax_",		TOK_POINTER(CharacterClass, pattrStrengthMax, iNumBytesTables)    },
</BR> 	{ "_FinalAttrResistanceMax_",	TOK_POINTER(CharacterClass, pattrResistanceMax, iNumBytesTables)    },

</BR> 	{ "}",                        TOK_END,      0 },
</BR> 	{ "", 0, 0 }
</BR> };
</BR> #endif


This Defines the expected layout of the information int he DEF File

WHICH GIVE YOU THIS


Class
{
Name "Class_Blaster"
DisplayName "P426732286"
PrimaryCategory "Blaster_RANGED"
SecondaryCategory "Blaster_SUPPORT"
PowerPoolCategory "Pool"
DisplayShortHelp "P2961504413"
DisplayHelp "P583029207"
Icon "archetypeicon_Blaster.tga"
AllowedOrigins Science, Magic, Natural, Mutation, Technology
SpecialRestrictions Hero
ConnectHpAndStatus kFalse

[CONTINUES]

Editing