Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

For Kotor 1, how do you force choke someone in a dialogue?

Page: 1 of 1
 jezter
02-18-2007, 4:01 PM
#1
Like what would be a force choke script, for a dialog sequence.

what would it be?
 stoffe
02-18-2007, 4:25 PM
#2
Like what would be a force choke script, for a dialog sequence.

what would it be?

If the victim should just be "visually" choked and not take any damage, and the conversing player character should do the choking, something like this might work:


void main() {
object oChoker = GetPCSpeaker();
object oVictim = GetObjectByTag("ChokeMe");

ActionPauseConversation();
AssignCommand(oChoker, SetFacingPoint(GetPosition(oVictim)));
AssignCommand(oChoker, DelayCommand(0.5, PlayAnimation(ANIMATION_FIREFORGET_FORCE_CAST)));

DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectChoke(), oVictim, 6.0));
DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_CHOKE), oVictim));
DelayCommand(6.0, ActionResumeConversation());
}


Change the text in Yellow to the tag of the NPC that should be choked.
 jezter
02-18-2007, 5:53 PM
#3
But how do you make the thing your choking take damage as well?
 stoffe
02-18-2007, 7:30 PM
#4
But how do you make the thing your choking take damage as well?


void main() {
object oChoker = GetPCSpeaker();
object oVictim = GetObjectByTag("ChokeMe");

ActionPauseConversation();
AssignCommand(oChoker, SetFacingPoint(GetPosition(oVictim)));
AssignCommand(oChoker, DelayCommand(0.5, PlayAnimation(ANIMATION_FIREFORGET_FORCE_CAST)));

DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectChoke(), oVictim, 6.0));
DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_CHOKE), oVictim));
DelayCommand(6.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oVictim));
DelayCommand(6.0, ActionResumeConversation());
}
 jezter
02-18-2007, 8:14 PM
#5
The script got a few errors when I compiled it,

which were:

Error: Undeclared identifier "ANIMATION FIREFORGET_FORCE_CAST"

Error: Required argument missing in call to "PlayAnimation"

Error: Required argument missing in call to "DelayCommand"

Error: Required argument missing in call to "AssignCommand"
 stoffe
02-18-2007, 8:21 PM
#6
Error: Undeclared identifier "ANIMATION FIREFORGET_FORCE_CAST"


Right, that constant probably does not exist in KotOR1. Try this instead:


void main() {
object oChoker = GetPCSpeaker();
object oVictim = GetObjectByTag("ChokeMe");

ActionPauseConversation();
AssignCommand(oChoker, SetFacingPoint(GetPosition(oVictim)));
AssignCommand(oChoker, ClearAllActions());
AssignCommand(oChoker, ActionCastFakeSpellAtObject(FORCE_POWER_CHOKE, oVictim));

DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectChoke(), oVictim, 6.0));
DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_CHOKE), oVictim));
DelayCommand(6.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oVictim));
DelayCommand(6.0, ActionResumeConversation());
}
 jezter
02-18-2007, 10:07 PM
#7
Well, I tried it in the game, and apparently my character does the

choking animation, but to the right of the selkath person, and the slekath

person doesn't choke, and he doesn't lose life either.
 stoffe
02-18-2007, 10:38 PM
#8
Well, I tried it in the game, and apparently my character does the

choking animation, but to the right of the selkath person, and the slekath

person doesn't choke, and he doesn't lose life either.

Did you change the tag in the script to the tag of the NPC who should be choked?Also make sure the victim has a unique tag, or the script might target the wrong NPC if there are others in the same area with an identical tag. If the intended victim is the NPC you are in conversation with you can replace...

object oVictim = GetObjectByTag("ChokeMe");

...with...

object oVictim = OBJECT_SELF;

...instead, which will always be the conversation owner. Further, the victim will not take any damage if it is plot-flagged, since that makes it invulnerable. So make sure you aren't trying to choke a plot-flagged NPC. If you want to take the risk of doing it anyway you can remove the plot-flag from the victim by adding this at line 3 of the main() function in the script:

SetPlotFlag(oVictim, FALSE);
 jezter
02-18-2007, 11:07 PM
#9
It worked like a charm
Page: 1 of 1