View Full Version : scripting woes undeclared identifier addbonusforcepoints

04-19-2009, 04:02 PM
i am working on a series of force powers based on the idea of bathing in either the light or the dark sides of the force these powers also have powerful effects with the power attached to focusing on the darkside supposed to increase your maximum force points by 5 but disabling your automatic health regen however i have encountered an issue whereby i cannnot make the script add bonus forcepoionts any help would be greatly appreciated

void main()
object oPC = GetSpellTargetObject();
AdjustAlignment(GetFirstPC(), ALIGNMENT_DARK_SIDE,9);
AddBonusForcePoints(oPC, 25);
if (!GetIsInCombat(oPC)){
DelayCommand(1.0, AssignCommand(oPC, ActionPlayAnimation( ANIMATION_LOOPING_MEDITATE, 1.0, 6.0 )));
DelayCommand( 3.0, ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectVisualEffect(1010) , oPC));
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ClearAllEffects());
int nHealAmount = GetMaxForcePoints(oPC) - GetCurrentForcePoints(oPC);
if( nHealAmount > 0 )
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHealForcePoints(nHealAmount), oPC);


04-19-2009, 06:58 PM
More information would be useful. Is this for K1 or TSL? And is your problem that it won't compile or that it won't work in game?

04-19-2009, 07:09 PM
for tsl and i gave you the exact error it gives me on compile attempt im sorry but i thought anyone replying would know that already based on the error message and the function i was attempting to use

04-19-2009, 07:19 PM
Thats what I thought, but it compiles fine for me using Kotor Tool. What are you using to compile?

EDIT: Also, not sure if it will help, but I found this in the function filter:
// RWT-OEI 02/06/04
// 801: SetBonusForcePoints - This sets the number of bonus force points
// that will always be added to that character's total calculated
// force points.

void SetBonusForcePoints( object oCreature, int nBonusFP );

04-19-2009, 08:33 PM
im using kotor tool

04-19-2009, 08:35 PM
funny i reqrote it from scratch and it works fine

is there anyway to apply a bonus to the force points for a timed duration ie increase the force points total by 200 for 30 seconds

04-19-2009, 08:37 PM
im using kotor tool

The only problem that I can see is that you may be selecting "script is for Kotor 1" instead of "Kotor 2." Like Malxados said, the script compiles fine for me as well. If you are compiling for K2, maybe restarting Windows would help? That has actually worked for me before. :p

04-19-2009, 08:53 PM
Im not sure what it does, but there's an effect I found called "EffectTemporaryForcePoints"

04-19-2009, 10:20 PM
I rewrote the script from scratch and that worked trying to work out what are the best bonuses for the two meditation abilities i am using so far light increases your light_side aliggnment as well as giving a small experience bonus (the whole use it for knowledge and defense thing) wheras the darkside one gives additional force points (ie the whole faster easier ) and it gives a large darkside alignment change, currently they can easily be abused to change your alignment but the idea is for a of a more roleplay element

you bath in the lightside you get a bonus you bath bin the darkside and you get a bonus was going to make a neutral meditation power but theres no set alignment function which does indeed annoy me