Jump to content

Home

Force Enlightenment


Recommended Posts

Amazingly I managed to script the Force Enlightenment to activate 5 powers instead of 3, but for my surprise it didnt work in game.

I compiled the k_sp1_generic.nss together with these:

k_inc_debug.nss

k_inc_force.nss

nwnscript.nss

It didnt showed errors. It compiled normally, but in game it only activated the normal powers.

I'm trying to include Energy Resistance and Force Barrier in Force Enlightenment. If anyone could help I would appreciate :p

Link to comment
Share on other sites

I'd be curious in knowing.. a) in the file, did you actually have .nss as part of the file, or just the file name? and b) I'm by far no expert, but the nwnscript file isn't included in the original k_sp1_generic, so why would it be for adding a few force powers to enlightenment?

 

Like I said, I'm no expert, but wouldn't you just have to edit k_inc_force to change the powers activated by enlightenment?

Link to comment
Share on other sites

Ok here is the Force Barrier I'm tryng to make it activate too.

What is wrong in this one will be wrong in the Energy Resistance.

 

Force Barrier:

//Barrier
if( GetSpellAcquired( FORCE_POWER_MASTER_FORCE_BARRIER ) ) {

    // Remove any lower level or equal versions of this power.
           Sp_RemoveRelatedPowers( OBJECT_SELF, FORCE_POWER_MASTER_FORCE_BARRIER );

           SWFP_HARMFUL = FALSE;
           eLink1 = EffectDamageResistance(DAMAGE_TYPE_BLUDGEONING, 15);
           eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_PIERCING, 15));
           eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_SLASHING, 15));
           eLink1 = SetEffectIcon(eLink1, 66);
           eLink2 = EffectVisualEffect(VFX_PRO_FORCE_ARMOR);
           eLink2 = EffectLinkEffects(eLink2, EffectVisualEffect(VFX_PRO_FORCE_SHIELD));

    float fDuration = Sp_CalcDuration( 180.0 );
           Sp_ApplyEffects(FALSE, OBJECT_SELF, 0.0, 1, eLink1, fDuration, eLink2, 3.0);
    //RWT-OEI 12//29/03 - Added support for the ForceChain FEAT
               //  Will add this bonus to anyone else w/Force Chain for free.
               if ( GetHasFeat(FEAT_FORCE_CHAIN, OBJECT_SELF) ) {
                   int index = 0;
                   for ( ; index < 3; ++index ) {
                       object oCharacter = GetPartyMemberByIndex(index);
                       if ( oCharacter != OBJECT_SELF
                            && GetHasFeat(FEAT_FORCE_CHAIN, oCharacter)
                            && !Sp_BetterRelatedPowerExists( oCharacter, FORCE_POWER_MASTER_FORCE_BARRIER)) {
                            Sp_RemoveRelatedPowers( oCharacter, FORCE_POWER_MASTER_FORCE_BARRIER);

                           SWFP_HARMFUL = FALSE;
           		    eLink1 = EffectDamageResistance(DAMAGE_TYPE_BLUDGEONING, 15);
                           eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_PIERCING, 15));
                           eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_SLASHING, 15));
           	            eLink1 = SetEffectIcon(eLink1, 66);
           		    eLink2 = EffectVisualEffect(VFX_PRO_FORCE_ARMOR);
           		    eLink2 = EffectLinkEffects(eLink2, EffectVisualEffect(VFX_PRO_FORCE_SHIELD));

		    Sp_ApplyEffects(FALSE, OBJECT_SELF, 0.0, 1, eLink1, fDuration, eLink2, 3.0);
                       }
                   }
               }
           }
    else if( GetSpellAcquired( FORCE_POWER_IMPROVED_FORCE_BARRIER ) ) {

               // Remove any lower level or equal versions of this power.
           	Sp_RemoveRelatedPowers( OBJECT_SELF, FORCE_POWER_IMPROVED_FORCE_BARRIER );

	SWFP_HARMFUL = FALSE;
               eLink1 = EffectDamageResistance(DAMAGE_TYPE_BLUDGEONING, 8);
               eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_PIERCING, 8));
               eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_SLASHING, 8));
               eLink1 = SetEffectIcon(eLink1, 65);
               eLink2 = EffectVisualEffect(VFX_PRO_FORCE_ARMOR);
               eLink2 = EffectLinkEffects(eLink2, EffectVisualEffect(VFX_PRO_FORCE_SHIELD));

	float fDuration = Sp_CalcDuration( 180.0 );
               Sp_ApplyEffects(FALSE, OBJECT_SELF, 0.0, 1, eLink1, fDuration, eLink2, 3.0);
	//RWT-OEI 12//29/03 - Added support for the ForceChain FEAT
               //  Will add this bonus to anyone else w/Force Chain for free.
               if ( GetHasFeat(FEAT_FORCE_CHAIN, OBJECT_SELF) ) {
                   int index = 0;
                   for ( ; index < 3; ++index ) {
                       object oCharacter = GetPartyMemberByIndex(index);
                       if ( oCharacter != OBJECT_SELF
                            && GetHasFeat(FEAT_FORCE_CHAIN, oCharacter)
                            && !Sp_BetterRelatedPowerExists( oCharacter, FORCE_POWER_IMPROVED_FORCE_BARRIER)) {
                            Sp_RemoveRelatedPowers( oCharacter, FORCE_POWER_IMPROVED_FORCE_BARRIER);


                           SWFP_HARMFUL = FALSE;
               	    eLink1 = EffectDamageResistance(DAMAGE_TYPE_BLUDGEONING, 8);
               	    eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_PIERCING, 8));
               	    eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_SLASHING, 8));
               	    eLink1 = SetEffectIcon(eLink1, 65);
               	    eLink2 = EffectVisualEffect(VFX_PRO_FORCE_ARMOR);
               	    eLink2 = EffectLinkEffects(eLink2, EffectVisualEffect(VFX_PRO_FORCE_SHIELD));

                           Sp_ApplyEffects(FALSE, OBJECT_SELF, 0.0, 1, eLink1, fDuration, eLink2, 3.0);
                       }
                   }
               }
           }
    else if( GetSpellAcquired( FORCE_POWER_RESIST_POISON_DISEASE_SONIC ) ) {

	// Remove any lower level or equal versions of this power.
               Sp_RemoveRelatedPowers( OBJECT_SELF, FORCE_POWER_RESIST_POISON_DISEASE_SONIC );

	SWFP_HARMFUL = FALSE;
               eLink1 = EffectDamageResistance(DAMAGE_TYPE_COLD, 6);
               eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_FIRE, 6));
               eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_SONIC, 6));
               eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_ELECTRICAL, 6));
               eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_BLASTER, 6));
               eLink1 = SetEffectIcon(eLink1, 26);
               eLink2 = EffectVisualEffect(VFX_PRO_RESIST_ELEMENTS);

	float fDuration = Sp_CalcDuration( 120.0 );
               Sp_ApplyEffects(FALSE, OBJECT_SELF, 0.0, 1, eLink1, fDuration, eLink2, 1.0);
	//RWT-OEI 12//29/03 - Added support for the ForceChain FEAT
               //  Will add this bonus to anyone else w/Force Chain for free.
               if ( GetHasFeat(FEAT_FORCE_CHAIN, OBJECT_SELF) ) {
                   int index = 0;
                   for ( ; index < 3; ++index ) {
                       object oCharacter = GetPartyMemberByIndex(index);
                       if ( oCharacter != OBJECT_SELF
                            && GetHasFeat(FEAT_FORCE_CHAIN, oCharacter)
                            && !Sp_BetterRelatedPowerExists( oCharacter, FORCE_POWER_RESIST_POISON_DISEASE_SONIC)) {
                            Sp_RemoveRelatedPowers( oCharacter, FORCE_POWER_RESIST_POISON_DISEASE_SONIC);


                           SWFP_HARMFUL = FALSE;
               	    eLink1 = EffectDamageResistance(DAMAGE_TYPE_COLD, 6);
               	    eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_FIRE, 6));
               	    eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_SONIC, 6));
              		    eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_ELECTRICAL, 6));
               	    eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_BLASTER, 6));
               	    eLink1 = SetEffectIcon(eLink1, 26);
               	    eLink2 = EffectVisualEffect(VFX_PRO_RESIST_ELEMENTS);

                           Sp_ApplyEffects(FALSE, OBJECT_SELF, 0.0, 1, eLink1, fDuration, eLink2, 3.0);
                       }
                   }
               }
           }

Link to comment
Share on other sites

Since I just realised Energy Resistance is different I'm posting it too.

 

Energy Resistance:

 

// Energy Resistance
    if( GetSpellAcquired( FORCE_POWER_MASTER_ENERGY_RESISTANCE ) ) {

        // Remove any lower level or equal versions of this power.
               Sp_RemoveRelatedPowers( OBJECT_SELF, FORCE_POWER_MASTER_ENERGY_RESISTANCE ); 

	SWFP_HARMFUL = FALSE;
               eLink1 = EffectDamageResistance(DAMAGE_TYPE_COLD, 20);
               eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_FIRE, 20));
               eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_SONIC, 20));
               eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_BLASTER, 20));
               eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_ELECTRICAL, 20));
               eLink1 = SetEffectIcon(eLink1, 104);
               eLink2 = EffectVisualEffect(VFX_PRO_RESIST_ELEMENTS);

	// Keep in mind that enemies can also cast this, although
           // only the caster will receive benfit. If a PC casts it,
           // the entire party is affected regardless of distance.
           if(!IsObjectPartyMember(OBJECT_SELF))
           {
               // Remove any lower level or equal versions of this power.
               Sp_RemoveRelatedPowers( OBJECT_SELF, FORCE_POWER_MASTER_ENERGY_RESISTANCE );

               // Do not apply the effects of this power if a more powerful
               // version is already attached to the target.
               if( !Sp_BetterRelatedPowerExists( OBJECT_SELF, FORCE_POWER_MASTER_ENERGY_RESISTANCE ) ) {
                   float fDuration = Sp_CalcDuration( 120.0 );
                   ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink1, OBJECT_SELF, fDuration);
                   ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink2, OBJECT_SELF, 1.0);
               }
           }
           else if(IsObjectPartyMember(OBJECT_SELF))
           {
               int nCnt = 0;
               object oParty;
               for(nCnt; nCnt < 3; nCnt++)
               {
                   oParty = GetPartyMemberByIndex(nCnt);
                   if(GetIsObjectValid(oParty))
                   {
                       // Remove any lower level or equal versions of this power.
                       Sp_RemoveRelatedPowers( oParty, FORCE_POWER_MASTER_ENERGY_RESISTANCE );

                       // Do not apply the effects of this power if a more powerful
                       // version is already attached to the target.
                       if( !Sp_BetterRelatedPowerExists( oParty, FORCE_POWER_MASTER_ENERGY_RESISTANCE ) ) {

                           // Make sure to send the event signal to anyone other
                           // than the caster that gets the benefit of this power.
                           if( oParty != OBJECT_SELF ) {
                               SignalEvent(oParty, EventSpellCastAt(oParty, GetSpellId(), SWFP_HARMFUL));
                           }
                           float fDuration = Sp_CalcDuration( 180.0 );
                           ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink1, oParty, fDuration);
                           ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink2, oParty, 1.0);
                       }
                   }
               }
           }
       }
else if( GetSpellAcquired( FORCE_POWER_RESIST_COLD_HEAT_ENERGY ) ) {

    // Remove any lower level or equal versions of this power.
           Sp_RemoveRelatedPowers( OBJECT_SELF, FORCE_POWER_RESIST_COLD_HEAT_ENERGY );

    SWFP_HARMFUL = FALSE;
           eLink1 = EffectDamageResistance(DAMAGE_TYPE_COLD, 12);
           eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_FIRE, 12));
           eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_SONIC, 12));
           eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_BLASTER, 12));
           eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_ELECTRICAL, 12));
           eLink1 = SetEffectIcon(eLink1, 24);
           eLink2 = EffectVisualEffect(VFX_PRO_RESIST_ELEMENTS);

    // Keep in mind that enemies can also cast this, although
           // only the caster will receive benfit. If a PC casts it,
           // the entire party is affected regardless of distance.
           if(!IsObjectPartyMember(OBJECT_SELF))
           {
               // Remove any lower level or equal versions of this power.
               Sp_RemoveRelatedPowers( OBJECT_SELF, FORCE_POWER_RESIST_COLD_HEAT_ENERGY );

               // Do not apply the effects of this power if a more powerful
               // version is already attached to the target.
               if( !Sp_BetterRelatedPowerExists( OBJECT_SELF, FORCE_POWER_RESIST_COLD_HEAT_ENERGY ) ) {
                   float fDuration = Sp_CalcDuration( 120.0 );
                   ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink1, OBJECT_SELF, fDuration);
                   ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink2, OBJECT_SELF, 1.0);
               }
           }
           else if(IsObjectPartyMember(OBJECT_SELF))
           {
               int nCnt = 0;
               object oParty;
               for(nCnt; nCnt < 3; nCnt++)
               {
                   oParty = GetPartyMemberByIndex(nCnt);
                   if(GetIsObjectValid(oParty))
                   {
                       // Remove any lower level or equal versions of this power.
                       Sp_RemoveRelatedPowers( oParty, FORCE_POWER_RESIST_COLD_HEAT_ENERGY );

                       // Do not apply the effects of this power if a more powerful
                       // version is already attached to the target.
                       if( !Sp_BetterRelatedPowerExists( oParty, FORCE_POWER_RESIST_COLD_HEAT_ENERGY ) ) {

                           // Make sure to send the event signal to anyone other
                           // than the caster that gets the benefit of this power.
                           if( oParty != OBJECT_SELF ) {
                               SignalEvent(oParty, EventSpellCastAt(oParty, GetSpellId(), SWFP_HARMFUL));
                           }
                           float fDuration = Sp_CalcDuration( 180.0 );
                           ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink1, oParty, fDuration);
                           ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink2, oParty, 1.0);
                       }
                   }
               }
           }
       }
else if( GetSpellAcquired( FORCE_POWER_RESIST_POISON_DISEASE_SONIC ) ) {

    // Remove any lower level or equal versions of this power.
           Sp_RemoveRelatedPowers( OBJECT_SELF, FORCE_POWER_RESIST_POISON_DISEASE_SONIC );

    SWFP_HARMFUL = FALSE;
               eLink1 = EffectDamageResistance(DAMAGE_TYPE_COLD, 6);
               eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_FIRE, 6));
               eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_SONIC, 6));
               eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_ELECTRICAL, 6));
               eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_BLASTER, 6));
               eLink1 = SetEffectIcon(eLink1, 26);
               eLink2 = EffectVisualEffect(VFX_PRO_RESIST_ELEMENTS);
               float fDuration = Sp_CalcDuration( 120.0 );
               Sp_ApplyEffects(FALSE, OBJECT_SELF, 0.0, 1, eLink1, fDuration, eLink2, 1.0);


           //RWT-OEI 12//29/03 - Added support for the ForceChain FEAT
           //  Will add this bonus to anyone else w/Force Chain for free.
           if ( GetHasFeat(FEAT_FORCE_CHAIN, OBJECT_SELF) ) {
               int index = 0;
               for ( ; index < 3; ++index ) {
                   object oCharacter = GetPartyMemberByIndex(index);
                   if ( oCharacter != OBJECT_SELF
                        && GetHasFeat(FEAT_FORCE_CHAIN, oCharacter)
                        && !Sp_BetterRelatedPowerExists( oCharacter, FORCE_POWER_RESIST_POISON_DISEASE_SONIC)) {
                        Sp_RemoveRelatedPowers( oCharacter, FORCE_POWER_RESIST_POISON_DISEASE_SONIC );
                        eLink1 = EffectDamageResistance(DAMAGE_TYPE_COLD, 6);
                        eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_FIRE, 6));
                        eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_SONIC, 6));
                        eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_ELECTRICAL, 6));
                        eLink1 = EffectLinkEffects(eLink1, EffectDamageResistance(DAMAGE_TYPE_BLASTER, 6));
                        eLink1 = SetEffectIcon(eLink1, 26);
                        eLink2 = EffectVisualEffect( VFX_PRO_RESIST_ELEMENTS);
                        float fDuration = Sp_CalcDuration( 120.0 );
                        Sp_ApplyEffects(FALSE, oCharacter, 0.0, 1, eLink1, fDuration, eLink2, 1.0);
                   }
               }
           }
       }

Link to comment
Share on other sites

I assume you copied those chunks inside

case FORCE_POWER_EBLIGHTEMENT:
{

} break;

block. If so, then it should work ...in theory.

 

When you test this in game, does your character actually posess those powers (barrier and resistance)?

 

Also what compiler are you using? HazardX or Fred Tetra's... and what version.

Link to comment
Share on other sites

Originally posted by Uchiha Itachi

Yeah I am using those.

and I'm using Fred's compiler. version 1.02 I think.

 

If you want I can send you the files Xcom.

 

Well, I've already tried to make it work and it did. So I guess, I will give the files instead. :p

 

I didn't included all sub-powers, and only added

 

FORCE_POWER_IMPROVED_FORCE_BARRIER

FORCE_POWER_MASTER_ENERGY_RESISTANCE

 

for the sake of experiment. Here is my k_inc_force.nss and compiled k_sp1_generic

 

http://www.matrixrain.com/kotor/f_enl.zip

 

I suggest you try compiling YOUR k_sp1_generic with my k_inc_force.nss. If that doesn't work, then there is probably some compiler issue, unless you made some kind of error in the script. (but it's difficult to say).

Link to comment
Share on other sites

Originally posted by Uchiha Itachi

what compiler you used?

 

Fred's .. v1.01 I think. The one that didn't have support for TSL. LOL!

 

and how you putted the powers there?You scripted again or copied the original powers to there?

 

copy-pasted, basically.

 

I can't use your k_inc_force cuz I modiified my ones to make the powers more powerful and last longer.

 

Yes, you can. You don't have to use it permanently.

Just back up yours, try to compile with mine. See if it works, and then revert back to your own k_inc_force.

Link to comment
Share on other sites

Originally posted by Uchiha Itachi

Heh....

Guess what, I may be doing it right, I tried compiling mine k_sp1_generic.nss with your k_inc_force.nss and surprise.

Didnt worked.

My command was: nwnnsscomp -c -g 2 k_sp1_generic.nss

 

hmm..

 

did you try using my compiled k_sp1_generic.ncs which I included in the zip?

Link to comment
Share on other sites

my compile.bat file is like this when opened with notepad++

 

1) nwnnsscomp -c -g 2 k_sp1_generic.nss

2) pause

 

All the files need to be in the same folder:

k_sp1_generic.nss

k_inc_debug.nss

k_inc_force.nss

nwnnsscomp.exe

nwscript.nss

Link to comment
Share on other sites

Ok.... I'm a moron and I'm embarrassed....

Guess what I did, before I started changing the k_inc_force I made a backup and placed in my Override folder :xp:

Meanwhile my test file was in a folder inside the Override folder.

So I guess the original one kept overwriting the test one in game.

I just tested my first attempt and it worked...

Ok you can all call me retard and kill me now :(:o:stick:

Well at least I think I could say I'm starting to learn how to script?

 

[EDIT]: Xcom when you can please take a look here again

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...