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.

Scripting Help - Drain Life style power

Page: 1 of 1
 Darth InSidious
12-22-2005, 2:54 PM
#1
I was trying to create a Force Power which works in a similar way to Drain Life and Death Field. While this one will compile, it won't actually work in game, and my PC does the casting anim, but nothing else happens (except I get decimated by Jedi Masters). What have I done wrong?

// Generated by jmac7142's KotOR Script Generator
// Offensive FP
#include "k_inc_force"

void main()
{
SWFP_DAMAGE_TYPE = DAMAGE_TYPE_DARK_SIDE;

object oSource = OBJECT_SELF;
object oTarget = GetSpellTargetObject();

effect eBeam = EffectBeam(VFX_PRO_DEATH_FIELD, oSource, BODY_NODE_CHEST, FALSE);
effect eSource = EffectVisualEffect(VFX_IMP_HEAL);

int nDamage = GetCasterLevel(oSource)/3;
effect eDamage = EffectDamage(nDamage);
effect eHeal= EffectHeal(SWFP_DAMAGE);

ApplyEffectToObject(1, eBeam, oTarget);
AssignCommand(oTarget, PlayAnimation(460, 1.0, 2.0 ) );

ApplyEffectToObject(1, eSource, oSource, 2.0f);
ApplyEffectToObject(1, eHeal, oSource, 1.0f);
ApplyEffectToObject(0, eDamage, oTarget, 2.0f);
}
 Det. Bart Lasiter
12-22-2005, 3:55 PM
#2
Well, I did try to plan around all options, however it's not possible for the most part. However, the damage effect should not be set to a time, so you should have left that blank. I also never added an 'AssignCommand' option either. Also, your damage amount is fairly low- even at level 50 it will only inflict 17 damage points. Anyways, this should work:


void main() {
object oSource = OBJECT_SELF;
object oTarget = GetSpellTargetObject();

effect eBeam = EffectBeam(VFX_PRO_DEATH_FIELD, oSource, BODY_NODE_CHEST, FALSE);
effect eSource = EffectVisualEffect(VFX_IMP_HEAL);

int nDamage = GetCasterLevel(oSource)/3;
effect eDamage = EffectDamage(nDamage);
effect eHeal = EffectHeal(nDamage);

ApplyEffectToObject(1, eBeam, oTarget);
AssignCommand(oTarget, PlayAnimation(460, 1.0, 2.0);

ApplyEffectToObject(1, eSource, oSource, 2.0f);
ApplyEffectToObject(1, eHeal, oSource, 1.0f);
ApplyEffectToObject(0, eDamage, oTarget, 2.0f);
}
 Darth InSidious
12-22-2005, 5:37 PM
#3
Thanks!
Just one more question - Doesn't the fixed script need ЈSWFP_DAMAGE_TYPE = DAMAGE_TYPE_DARK_SIDE;" to define the damage type? Just curious ;)
 Det. Bart Lasiter
12-22-2005, 6:24 PM
#4
I actually am not sure why I added that in, and I can't check now because I don't have the original solution. However, I am in the process of making a new version now that will be ready next week. The new version will support 4 beam effects, 4 dur/imp-type effects, 4 miscellaneous effects (AC increase, damage increase, ect...), and various other things as well. Also, if you want the power to inflict DS damage, change

effect eDamage = EffectDamage(nDamage);

// To:

effect eDamage = EffectDamage(nDamage, 512);
 stoffe
12-22-2005, 9:59 PM
#5
effect eBeam = EffectBeam(VFX_PRO_DEATH_FIELD, oSource, BODY_NODE_CHEST, FALSE);


VFX_PRO_DEATH_FIELD is not a beam visual effect, you'll need to use one of the VFX_BEAM_* constant values in EffectBeam() for it to work. I believe VFX_BEAM_DEATH_FIELD_TENTACLE is the one you are after.

Also, using BODY_NODE_CHEST as beam origin will cause the beam to shoot out from the chest of the caster. You should use BODY_NODE_HAND_LEFT for "cast out" animation powers, or BODY_NODE_HEAD for "cast up" animation powers (like death field, wave etc) to make it appear like it comes from the hand instead.
 Darth InSidious
12-23-2005, 7:31 AM
#6
Thanks :)
I got it working in the end and it doesn't look too shabby :)
I had to change the PlayAnimation thingy to EffectCrush() to get it to work, though.
Page: 1 of 1