Costume: Difference between revisions

From OuroDev
pc>Herald
No edit summary
m 8 revisions imported: Importing Portal Corps Wiki pages and history - Feb 6, 2020
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
See also: [[Building_Costumes.bin_from_the_I24_def_dump]]
<source>
<source>
         kBodyType_Male        = 0,  // All the values in body type MUST match the
         kBodyType_Male        = 0,  // All the values in body type MUST match the
Line 23: Line 27:
// Sets the geometry to be used for a body part.
// Sets the geometry to be used for a body part.
// This name will be magically munged with the bodytype's entname prefix.
// This name will be magically munged with the bodytype's entname prefix.
// Stores data for a costume set
//
typedef struct CostumeSetSet
{
const char *filename;
const char *name;
const char *displayName;
const char *npcName;
const char **keys; // the set isn't shown unless the player has all keys or
const char **storeProductList; // the set isn't shown unless the player has all products
} CostumeSetSet;
if( !part->pchGeom || !stricmp( part->pchGeom, "none" )  )
{
if( stricmp( pchName, "pants" ) == 0 ||  // These parts must be set
stricmp( pchName, "chest" ) == 0 ||
stricmp( pchName, "gloves") == 0 ||
stricmp( pchName, "boots" ) == 0 )
{
return false;
}
else
bMatchGeo = true;
}
if( !part->pchTex1 || !stricmp( part->pchTex1, "base" ) || !stricmp( part->pchTex1, "none" ) )
{
if( stricmp( pchName, "pants" ) == 0 ||  // These parts must be set
stricmp( pchName, "chest" ) == 0 ||
stricmp( pchName, "gloves") == 0 ||
stricmp( pchName, "boots" ) == 0 )
{
return false;
}
else
bMatchTex1 = true;
}
// "numParts" must be less than MAX_COSTUME_PARTS because that's how many
// parts containersaveload.c is hardcoded to save/load.
//
// This is also the reason why we always allocate MAX_COSTUME_PART parts even
// though the number of parts in use is likely to be less.
// Create and fill the CostumeParts array with emtpy parts for this costume.
// JS: It is required that these things be filled with emtpty entries because
// the contaier loading code does not know how to create this kind of
// structure on its own.
{
if(!stricmp(e->pchar->pclass->pchName, "Class_Arachnos_Soldier") ||
!stricmp(e->pchar->pclass->pchName, "Class_Arachnos_Widow"))
{
// If this is a VEAT, we will attempt to clone the 1st slot, since slot 0
// contains the uniform
costume->appearance.costumeFilePrefix = allocAddString_checked(bodyName);
// If you have either crab spider powerset you must have at least one
// power from them (they're specialization powersets, so they're only
// added to buy a power). All crab spiders need a backpack on all their
// costumes because the attack powers don't work properly without it.
if( ( crab_primary && character_OwnsPowerSetInAnyBuild( e->pchar, crab_primary ) ) ||
( crab_secondary && character_OwnsPowerSetInAnyBuild( e->pchar, crab_secondary ) ) )
{
has_crab_powers = true;
}
// Find the appropriate backpacks based on the character's body type.
// We'll need the 'uniform' one if they're wearing crab/bane spider armor
// in a given slot and the 'civilian' one in all other cases.


</source>
</source>

Latest revision as of 10:02, 6 February 2020

See also: Building_Costumes.bin_from_the_I24_def_dump


        kBodyType_Male        = 0,  // All the values in body type MUST match the
	kBodyType_Female      = 1,  // ones which are read in the menu file.
	kBodyType_BasicMale   = 2,
	kBodyType_BasicFemale = 3,
	kBodyType_Huge        = 4,
	kBodyType_Enemy       = 5,
	kBodyType_Villain     = 6, // Except this one. This one is only set by code.
	kBodyType_Enemy2	  = 7, // Except this one. This one is only set by code.
	kBodyType_Enemy3	  = 8, // Except this one. This one is only set by code.

		
        F32 fScale;       // ranges from -9 to 9. Yields approx +/-20% size change
	F32 fBoneScale;	// -1 = skinniest guy, 0 = normal guy, 1 = fattest guy

void costume_PartSetTexture1(Costume* costume, int iIdxBone, const char *pchTex);
void costume_PartSetTexture2(Costume* costume, int iIdxBone, const char *pchTex);
void costume_PartSetFx(Costume* costume, int iIdxBone, const char *pchFx);
// Sets the primary/secondary base texture name for a body part.
// This name will be magically munged with the bodytype's texture prefix.

void costume_PartSetGeometry(Costume* costume, int iIdxBone, const char *pchGeom);
// Sets the geometry to be used for a body part.
// This name will be magically munged with the bodytype's entname prefix.

// Stores data for a costume set
//
typedef struct CostumeSetSet
{
	const char *filename;
	const char *name;
	const char *displayName;
	const char *npcName;
	const char **keys;					// the set isn't shown unless the player has all keys or
	const char **storeProductList;		// the set isn't shown unless the player has all products
} CostumeSetSet;

	if( !part->pchGeom || !stricmp( part->pchGeom, "none" )  )
	{
		if( stricmp( pchName, "pants" ) == 0 ||  // These parts must be set
			stricmp( pchName, "chest" ) == 0 ||
			stricmp( pchName, "gloves") == 0 ||
			stricmp( pchName, "boots" ) == 0 )
		{
			return false;
		}
		else
			bMatchGeo = true;
	}

	if( !part->pchTex1 || !stricmp( part->pchTex1, "base" ) || !stricmp( part->pchTex1, "none" ) )
	{
		if( stricmp( pchName, "pants" ) == 0 ||  // These parts must be set
			stricmp( pchName, "chest" ) == 0 ||
			stricmp( pchName, "gloves") == 0 ||
			stricmp( pchName, "boots" ) == 0 )
		{
			return false;
		}
		else
			bMatchTex1 = true;
	}

// "numParts" must be less than MAX_COSTUME_PARTS because that's how many
	// parts containersaveload.c is hardcoded to save/load.
	//
	// This is also the reason why we always allocate MAX_COSTUME_PART parts even
	// though the number of parts in use is likely to be less.

// Create and fill the CostumeParts array with emtpy parts for this costume.
	// JS:	It is required that these things be filled with emtpty entries because
	//		the contaier loading code does not know how to create this kind of
	//		structure on its own.
	{

		if(!stricmp(e->pchar->pclass->pchName, "Class_Arachnos_Soldier") ||
			!stricmp(e->pchar->pclass->pchName, "Class_Arachnos_Widow"))
		{
			// If this is a VEAT, we will attempt to clone the 1st slot, since slot 0
			//	contains the uniform

costume->appearance.costumeFilePrefix = allocAddString_checked(bodyName);

// If you have either crab spider powerset you must have at least one
	// power from them (they're specialization powersets, so they're only
	// added to buy a power). All crab spiders need a backpack on all their
	// costumes because the attack powers don't work properly without it.
	if( ( crab_primary && character_OwnsPowerSetInAnyBuild( e->pchar, crab_primary ) ) ||
		( crab_secondary && character_OwnsPowerSetInAnyBuild( e->pchar, crab_secondary ) ) )
	{
		has_crab_powers = true;
	}

	// Find the appropriate backpacks based on the character's body type.
	// We'll need the 'uniform' one if they're wearing crab/bane spider armor
	// in a given slot and the 'civilian' one in all other cases.