I'm Trying To Make A Custom Force Power But The Script Won't Compile :(
Here Is The Script I Am Using:
void main()
{
SWFP_DaMAGE_TYPE = DAMAGE_TYPE_FIRE;
object oSource = OBJECT_SELF;
object oTarget = GetSpellTargetObject();
effect eBeam = EffectBeam(2053, oSource, 3);
effect eVFX = EffectVisualEffect(
effect eDamage = EffectDamage(50);
ApplyEffectToObject(1, eBeam, oTarget, Duration 04.0f);
ApplyEffectToObject(1, eVFX, oTarget, Duration 04.0f);
}
Is There Something Wrong With It?
-DarthDingDong
I'm Trying To Make A Custom Force Power But The Script Won't Compile :(
Here Is The Script I Am Using:
Is There Something Wrong With It?
Yes the script has a number of mistakes. I've added descriptions of them in the green colored code comments above the line in the fixed variant of your script below:
void main() {
// ST: This variable has not been declared, and is not used for anything
// anyway, so might as well remove it.
// SWFP_DaMAGE_TYPE = DAMAGE_TYPE_FIRE;
object oSource = OBJECT_SELF;
object oTarget = GetSpellTargetObject();
effect eBeam = EffectBeam(VFX_BEAM_FLAME_SPRAY, oSource, BODY_NODE_HAND_LEFT);
// ST: The below line was incomplete, no visualeffect index set
// and missing closing paranthesis and ending semicolon.
effect eVFX = EffectVisualEffect(VFX_IMP_FLAME);
// ST: Damage type was not set to fire, while the visuals used are flames.
// This effect was never applied to anything either. Added line for that below.
effect eDamage = EffectDamage(50, DAMAGE_TYPE_FIRE);
// ST: The duration value had "Duration" on front of them on both lines below,
// which is not a valid float value.
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam, oTarget, 4.0f);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVFX, oTarget, 4.0f);
// ST: Added line to apply damage effect created above.
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);
}
Thanks Stoffe :)
I Have A New Problem Now :(
I Granted Myself The Power Through KSE To Test It Out And It Worked
Though When I Went To The Power Screen To See If The Icon Showed Up Ok But The Power Isn't There!
Any Advice?