Like what would be a force choke script, for a dialog sequence.
what would it be?
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.
But how do you make the thing your choking take damage as well?
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());
}
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"
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());
}
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.
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);