PDA

View Full Version : TSL: Cut Force Forms Restoration Mod


WRFan
06-27-2009, 04:08 PM
I am currently trying to restore Force Forms that have been cut from the game. I am particularly interested in the following forms:

FORM_CONSULAR_ENDURING_FORCE I-III: Increases the duration of all of your powers by 25-100 per cent. This is basically an Extend Spell Metamagic Feature

FORM_CONSULAR_FORCE_AMPLIFICATION I-III: Increases the range of your powers by 25-100 per cent.

FORM_CONSULAR_POWER_OF_THE_DARK_SIDE I-III: Increases the DC of all of your spells by 1 or 2 (basically a Spell/Force Focus in d20 terms), increases the damage dealt by offensive force powers.

FORM_CONSULAR_REGENERATION_III: Gives you 20 per cent of the base FPs spent when casting a spell back for free (so basically spells cost 20 per cent less)

So far I've managed to restore the Enduring Force Form I, which increases the duration of your powers by 25 per cent. This is how it is done:

nwscript.nss script:
Uncomment


int FORM_CONSULAR_ENDURING_FORCE_I = 226;


k_inc_force.nss include script:

Find and uncomment the following code, recompile k_sp1_generic.nss:


if( IsFormActive( OBJECT_SELF, FORM_CONSULAR_ENDURING_FORCE_I ) ) {
// Duration is increased by 25%.
fFinalDuration = fFinalDuration * 1.25f;
}


Because the GUI for force forms seems to be hard-coded into the engine, we have to activate the force forms through scripting (in the game, the force forms will appear in the friendly powers list, next to Heal or Force Valor). For that, create a new spell script and activate the force form:


case 226: //FORM_CONSULAR_ENDURING_FORCE_I
{

SetCurrentForm( OBJECT_SELF, FORM_CONSULAR_ENDURING_FORCE_I );

int oEnduringI = IsFormActive( OBJECT_SELF, FORM_CONSULAR_ENDURING_FORCE_I );
if (oEnduringI == 1)
{
SendMessageToPC(OBJECT_SELF, "The Form CONSULAR_ENDURING_FORCE_I has been activated" );
}

}
break;


Now fix the row 226 in spells.2da:

Label column: FORM_CONSULAR_ENDURING_FORCE_I

Name / Spelldesc columns: create new entries in dialog.tlk and reference them in spells.2da

Iconresref column: add an existing icon for the form

Impactscript column: k_sp1_generic

Forcefriendly column: add an unused number (defines the order of friendly force powers)

Copy all other column entries from an existing form (Force mastery or something).

Add the new form through Kotor savegame editor to your Jedi Consular's force powers. Activate the form in-game. To test the form, use your own Jedi Consular and Kreia to cast Force Valor and Force Armour simultaneously. You will notice that the force power cast by your Jedi Consular lasts 25 per cent longer than the power cast by Kreia.

I am going to look into the other forms as well. It's basically the same procedure for all forms

FaZzZa99
06-27-2009, 09:10 PM
Oo, cut force forms? never would have guessed, good luck with your restoration mod, maybe when its done you should chat with Team Gizka and see if they'll include it in the master restoration

Darth InSidious
06-27-2009, 09:13 PM
They won't appear in the Force/Saber forms GUI element, unfortunately, although you could implement them as passive FPs/plot useable items. The GUI element seems to be hardcoded.

WRFan
06-28-2009, 04:49 PM
They won't appear in the Force/Saber forms GUI element, unfortunately, although you could implement them as passive FPs/plot useable items. The GUI element seems to be hardcoded.

Yes, I mentioned this in my post above. They can be implemented as standard friendly force powers and will appear in the same list as other friendly force powers like Heal or Force Valor

WRFan
07-01-2009, 12:43 PM
In order to get the cut forms working properly, many TSL scripts must be adjusted, as their range/duration is not calculated properly. They should actually use the functions Sp_CalcRange for the Amplification Form and Sp_CalcDuration both for the Endurance Forms and the Force Mastery form, since both functions take force forms into account. E.g., Force Whirlwind doesn't calculate the spell duration properly, since the duration is set to float 12.0 seconds, so it doesn't take duration increasing forms into account. Should look like this:


float fDuration = Sp_CalcDuration( 12.0 );
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink1, oTarget, fDuration);


Same goes for Choke. It calculates duration properly for the Constitution decrease, but not for the incapacitation/damage application duration.

Other force powers are involved as well. I am still fixing all this stuff, so it may be some time before I upload a final version.