PDA

View Full Version : script problem


ace92
07-31-2008, 05:04 PM
i've wrote a force power and here is the script:

void main()
{
int iIdx;
effect eDisguise = EffectDisguise(671);
effect eLink1 = EffectAbilityIncrease(ABILITY_STRENGTH, 75);
eLink1 = EffectLinkEffects(eLink1, EffectBlasterDeflectionIncrease(100));
eLink1 = EffectLinkEffects(eLink1, EffectAttackIncrease(3));
object oParty = GetPartyMemberByIndex(iIdx);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink1, oParty, 20.0f);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDisguise, OBJECT_SELF, 20.0f);
}

everytime i try to use the force power the game stuck in the middle of the force power

TriggerGod
07-31-2008, 05:14 PM
Ok, a few questions:
1) Did you follow the Force Power tutorial?
4) Did you insert into the k_inc_force script?

ace92
07-31-2008, 05:33 PM
1)yes i did
4)no i dont' think so...you mean the:

#include "k_inc_force"

than if so no i didn't...*embarrassed*

TriggerGod
07-31-2008, 05:51 PM
1) KK
4) That is only if your using TSL, which, by the looks of your last post, you are.
That tutorial should explain how to do it..

ace92
07-31-2008, 05:59 PM
so what your saying that because i didn't add the #include "k_inc_force" it get stucked?

TriggerGod
07-31-2008, 06:42 PM
No.
The script k_inc_force is an actual script. Search for it in the KTool Script section.
I haven't done any k_inc_force script modifying before, but there are some who have, such as Darth InSidious. Maybe they'd like the help ^_^

Darth InSidious
07-31-2008, 06:43 PM
That's only part of the problem, as far as I can tell:

#include "k_inc_force"

void main()
{
int iIdx; //Undefined. How is this number being arrived at?

effect eDisguise = EffectDisguise(671); //The DISGUISE_TYPE_ integers defined in nwscript only go up to 308 - you're calling a number that isn't there.

effect eLink1 = EffectAbilityIncrease(ABILITY_STRENGTH, 75);
eLink1 = EffectLinkEffects(eLink1, EffectBlasterDeflectionIncrease(100));
eLink1 = EffectLinkEffects(eLink1, EffectAttackIncrease(3));
object oParty = GetPartyMemberByIndex(iIdx);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink1, oParty, 20.0f);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDisguise, OBJECT_SELF, 20.0f);
}

My comments follow the // .

ace92
08-01-2008, 08:37 AM
ok...
I decided i don't need the iIdx because i want it to be a force power on the PC only.

effect eDisguise = EffectDisguise(671);

the 671 is the row in the appearance.2da, if that's not the right command so what is?

Darth InSidious
08-01-2008, 08:51 AM
You have to choose one of the predefined DISGUISE_TYPE_ integers in nwscript.nss - which only go up to 308.

Also, you haven't told the script what iIdx is.

stoffe
08-01-2008, 09:28 AM
ok...
I decided i don't need the iIdx because i want it to be a force power on the PC only.

effect eDisguise = EffectDisguise(671);

the 671 is the row in the appearance.2da, if that's not the right command so what is?

EffectDisguise() does use the line numbers in appearance.2da (which the DISGUISE_TYPE_* constants correspond to for default appearance types). Keep in mind that appearance.2da is indexed by line number (starting at the first line with 0 and counting down) and not row label (the number in the leftmost column in KotorTool's 2DA editor). Thus for the above to work your line would have to be number 762 counting from the top down.

If the game crashes it sounds fairly likely that you are trying to use a non-existing or improperly set line in appearance.2da. The game has rather poor error handling when it comes to missing model data, generally resulting in crashes. A common source for crashes relating to appearance is when you give a NPC that is wearing armor or robes an appearance type that has no model assigned for the body variation used by that armor/robe's base item.

ace92
08-01-2008, 11:30 AM
ok i fixed it thanks stoffe and Darth InSidious, but there is a problem the force power does work, but the head that suppose be to be changed to isn't there just no head...
any solutions?