InSidious

[K1] Properly Permanent Effects

Recommended Posts

So, chaps and chapesses, I have a query.

 

As we all know, fiddling with player attributes, skills, feats, powers and saves is (relatively) simple in TSL, since script functions directly affecting these things exist, and which allow for a permanently-permanent way of doing them.

 

Unfortunately, KotOR I doesn't seem to have a direct way of doing this, since DURATION_TYPE_PERMANENT is only permanent until the effect is dispelled or a ClearAllEffects() call is made.

 

What I'm looking to do is to permanently modify a player's saving throw score, in such a way that it can't be dispelled, and I'd like your opinions on how best to do this.

 

Is a creature hide the best way to go? And am I likely to cause incompatibilities with many mods? (I know redrobe used them for his playable aliens mod - does he use all of the slots at any point?)

 

Is there a scripting workaround I'm not aware of? Do you have any ideas for one?

Share this post


Link to post
Share on other sites

Update: Well, attempting to use DURATION_TYPE_INSTANT apparently simply causes the effect to not apply.

 

The script I tried:

 

void main()

{

object oPC = GetFirstPC();
effect e1 = EffectSavingThrowIncrease(3, 2, 10);

ApplyEffectToObject(0, e1, oPC, 0.0f);

}

 

N.B.: 0 is equivalent to DURATION_TYPE_INSTANT.

 

While this will give a bonus, it is removed by the first ClearAllEffects() call it comes across.

Share this post


Link to post
Share on other sites

 

int GetIsItemInSlot(string sItemtag, int iSlot)
//Not exactly in the Lexicon, but it's a helper for
//AddItemProperty.
{
object oTester = GetObjectByTag(sItemtag);
if(GetItemInSlot(iSlot) == oTester)
{
	return TRUE;
}
else
{
	return FALSE;
}
}

void AddItemProperty(object oItem, object oEquipper, effect eProp, int iSlot, float fDuration = 0.0f)
/*	My roundabout way of adding psuedo-effects, based on the function
"IPSafeAddItemProperty".

object oItem		= the object to check to add the effect
object oEquipper 	= the person to equip the item
effect eProp 		= effect to add
int iSlot 		= the slot that oItem is meant to be equipped into.
float fDuration	= the duration of the effect(by default this is permanent, or 0.0f)

You must specify an item and an effect, and as long as that item is equipped
you will have that effect on you!
*/
{
while(GetIsItemInSlot(GetTag(oItem), iSlot) == 1)
{
	if(fDuration == 0.0f)
	{
		ApplyEffectToObject(DURATION_TYPE_PERMANENT, eProp, oEquipper);
	}

	ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eProp, oEquipper, fDuration);
}
}

 

 

I've made these functions as part of a project of mine( link ) and you could edit it so that it was dependent upon a global boolean...Like this:

 

 

while(GetGlobalBoolean("Effect_Permanent") == 1)

 

 

Note that I haven't been able to test the scripts as of yet. Could you modify and test it, then report the results in this thread? I could send you the entire include if you want; it's all just adapted scripts from the NWN Lexicon and any helper functions I had to make. None of them are tested yet; can't get TSL to run without sound. :(

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.