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.

Force Power Script

Page: 1 of 1
 Marius Fett
10-28-2007, 5:35 AM
#1
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
 stoffe
10-28-2007, 8:04 AM
#2
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);

}
 Marius Fett
10-28-2007, 9:23 AM
#3
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?
Page: 1 of 1