Tinting Powers

From OuroDev
Revision as of 17:05, 1 May 2020 by Baaleos (talk | contribs) (Created page with "Some powers within City of Heroes are not currently tintable - most noted would be the villain/monster powers - which were never meant for public consumption / use. Other powe...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Some powers within City of Heroes are not currently tintable - most noted would be the villain/monster powers - which were never meant for public consumption / use. Other powers such as Peacebringer + Warshade powers are tintable in SCoRE but not in Ouroboros code base. This is because the Powers were modified in SCoRE to add that power customization option. Through some experimentation, the process of how to enable tinting has been discovered - although it currently requires the modification of numerous files to get even a single power to be tintable in an acceptable manner.

The Power File

Elsewhere in this wiki, a description of the Power def structure will be explained, but the part that we care about is the VisualFX and include segments. For example: If you locate: Power Warshade_Offensive.Umbral_Blast.Ebon_Eye Within the Warshade_Offensive_Umbral_Blast.powers file

You will find the VisualFX and include options set to:

	VisualFX             "menu\Powers\AnimFX\Warshadow_EyeBeam.pfx"
	include              menu\Powers\AnimFX\Warshadow_EyeBeam.pfx

It is important to note - that in its current format, this power is sharing its visual effects with those of the enemy Nictus in the game. We don't want that - because if we enable tinting on the Warshade powers globally, then Primary / Secondary tint information will not be available for the NPC/Critters. The powers may not show correctly.

What we want to do is decouple the players power, from the critters.

To do this - change the VisualFX and include to read:

	VisualFX             "menu\Powers\AnimFX\PlayerPowers\Warshadow_EyeBeam.pfx"
	include              menu\Powers\AnimFX\PlayerPowers\Warshadow_EyeBeam.pfx

Note the inclusion of PlayerPowers sub-directory.

Note - the pfx does not exist in that location yet. Navigate to menu\Powers\AnimFX\ and copy the Warshadow_EyeBeam.pfx to menu\Powers\AnimFX\PlayerPowers\

The PFX File

The Power FX file or PFX - contains information about the emotes/animations that the power plays, as well as the base FX that plays during the powers use.


The default Ebon Eye PFX will look like this:

// -------------------------  ANIMATION RELATED FIELDS --------------------------------//
	ModeBits			ANIM_COMBAT
	AttackBits			ANIM_COMBAT, ANIM_HEADCAST
	HitBits				ANIM_HIT, ANIM_QUICK
	FramesBeforeHit			25
	AttackFrames			50

// -------------------------  FX RELATED FIELDS  --------------------------------------//
	AttackFx			"POWERS\CosmicPowers\Nictus\XRayBeam\XRayBeam.fx"
	HitFx				"POWERS\CosmicPowers\Nictus\NictusQuickBlast\NictusQuickBlastHit.fx"
	DelayedHit			1
	ProjectileSpeed			150

ModeBits - I think indicates that using the power will engage combat mode (combat aura's will kick in)
AttackBits - Animations that play when you are casting
HitBits - Animations your target plays when hit.
FramesBeforeHit - How long in frames before the power hits the target (assume 30 fps - so 25 f would be close to 1 second)
AttackFrames - How many frames in total do the attack animations play for.

FX related fields is where it gets intricate. These default values point at the 'POWERS' directory - which is where the default FX reside for the critters and npcs in the game. These are not tinted.

AttackFx - The Visual Effect of your power - Eg: The effect of it emanating from your eyes and the projectile.
HitFx - The impact Effect of it hitting an enemy - usually an explosion or impact effect of some sort.
DelayedHit - Possibly a boolean to indicate that it is not instant and should use ProjectileSpeed to calculate impact time.
ProjectileSpeed - Possibly used to calculate the time to impact - useful when targeting enemies flying away etc.

What you want to do now is copy the following directory in the POWERS directory (in fx directory)

POWERS\CosmicPowers

To

CustomizeablePowers\

So you should now have: CustomizeablePowers\CosmicPowers inside the FX directory.


The PFX file is where we can add additional animations and palette options for our power tinting.

Modify the PFX to look like this:


// -------------------------  ANIMATION RELATED FIELDS --------------------------------//
	ModeBits			ANIM_COMBAT
	AttackBits			ANIM_COMBAT, ANIM_HEADCAST
	HitBits				ANIM_HIT, ANIM_QUICK
	FramesBeforeHit			25
	AttackFrames			50

// -------------------------  FX RELATED FIELDS  --------------------------------------//
	AttackFx			"POWERS\CosmicPowers\Nictus\XRayBeam\XRayBeam.fx"
	HitFx				"POWERS\CosmicPowers\Nictus\NictusQuickBlast\NictusQuickBlastHit.fx"
	DelayedHit			1
	ProjectileSpeed			150
    
CustomFX "Bright Flames"
AltTheme "Bright Fire"
// -------------------------  ANIMATION RELATED FIELDS --------------------------------//
	ModeBits			ANIM_COMBAT
	AttackBits			ANIM_COMBAT, ANIM_HEADCAST
	HitBits				ANIM_HIT, ANIM_QUICK
	FramesBeforeHit			25
	AttackFrames			50

// -------------------------  FX RELATED FIELDS  --------------------------------------//
        Palette                         "Additive"
	AttackFx			"CustomizeablePowers\CosmicPowers\Nictus\XRayBeam\XRayBeam.fx"
	HitFx				"CustomizeablePowers\CosmicPowers\Nictus\NictusQuickBlast\NictusQuickBlastHit.fx"
	DelayedHit			1
	ProjectileSpeed			150
End

CustomFX "Dark Flames"
AltTheme "Dark Fire"
// -------------------------  ANIMATION RELATED FIELDS --------------------------------//
	ModeBits			ANIM_COMBAT
	AttackBits			ANIM_COMBAT, ANIM_HEADCAST
	HitBits				ANIM_HIT, ANIM_QUICK
	FramesBeforeHit			25
	AttackFrames			50

// -------------------------  FX RELATED FIELDS  --------------------------------------//
        Palette                         "Subtractive"
	AttackFx			"CustomizeablePowers\CosmicPowers\Nictus\XRayBeam\XRayBeam.fx"
	HitFx				"CustomizeablePowers\CosmicPowers\Nictus\NictusQuickBlast\NictusQuickBlastHit.fx"
	DelayedHit			1
	ProjectileSpeed			150
End

The above will add 3 options in the Power Customization menu for Ebon Eye.

Default - which is the purple
Bright Fire - Bright additive colors
Dark Fire - Dark palette etc

Note - the names Bright and Dark fire/flames can be changed.

We now want to keep the default entry untouched - so make sure you do not touch these files

	AttackFx			"POWERS\CosmicPowers\Nictus\XRayBeam\XRayBeam.fx"
	HitFx				"POWERS\CosmicPowers\Nictus\NictusQuickBlast\NictusQuickBlastHit.fx"

The files we want to look at and modify are:

	AttackFx			"CustomizeablePowers\CosmicPowers\Nictus\XRayBeam\XRayBeam.fx"
	HitFx				"CustomizeablePowers\CosmicPowers\Nictus\NictusQuickBlast\NictusQuickBlastHit.fx"

Which are the newly copied over files you did above.

The FX File