Jump to content

Home

Force Power Script


Marius Fett

Recommended Posts

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

Link to comment
Share on other sites

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() { 
   [color=PaleGreen]// ST: This variable has not been declared, and is not used for anything
   //     anyway, so might as well remove it.[/color]
   // 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);

   [color=PaleGreen]// ST: The below line was incomplete, no visualeffect index set
   //     and missing closing paranthesis and ending semicolon.[/color]
   effect eVFX = EffectVisualEffect(VFX_IMP_FLAME);

   [color=PaleGreen]// 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.[/color]
   effect eDamage = EffectDamage(50, DAMAGE_TYPE_FIRE);

   [color=PaleGreen]// ST: The duration value had "Duration" on front of them on both lines below,
   //     which is not a valid float value.[/color]
   ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam, oTarget, 4.0f);
   ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVFX, oTarget, 4.0f);

   [color=PaleGreen]// ST: Added line to apply damage effect created above.[/color]
   ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);

} 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...