PDA

View Full Version : Some script questions


Exile007
01-02-2008, 09:58 PM
Ok, in the mod the PC will need to use a forcepower on a npc while still in the dialog. I scripted a force power set the damage and yeah it fires fine, but the npc isn't effected at all, here is the script.


Code:

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

effect eBeam = EffectBeam(2026, oSource, 3);
effect eVFX = EffectVisualEffect(1014);
effect eSource = EffectVisualEffect(1014);
effect eDamage = EffectDamage(1000000);

ApplyEffectToObject(1, eBeam, oTarget, 5.0f);
ApplyEffectToObject(1, eVFX, oTarget, 8.0f);
ApplyEffectToObject(1, eSource, oSource, 2.0f);

}




Did I do anything wrong?

stoffe
01-03-2008, 08:12 AM
Ok, in the mod the PC will need to use a forcepower on a npc while still in the dialog. I scripted a force power set the damage and yeah it fires fine, but the npc isn't effected at all, here is the script.
(snip)
Did I do anything wrong?

You are not applying the damage effect, just the beam and visual ones. :)


(If this is only meant to be used once automatically during dialog you could just script the whole thing entirely in a dialog action script so you won't have to add it as a real force power.)

Exile007
01-03-2008, 11:56 AM
Well I'm not a script genius, but isn't the 1000000 the damage? I just did that in script generator. So can you give me an example of what damage effect would look like?

Qui-Gon Glenn
01-03-2008, 12:09 PM
effect eBeam = EffectBeam(2026, oSource, 3);
effect eVFX = EffectVisualEffect(1014);
effect eSource = EffectVisualEffect(1014);
effect eDamage = EffectDamage(1000000);

ApplyEffectToObject(1, eBeam, oTarget, 5.0f);
ApplyEffectToObject(1, eVFX, oTarget, 8.0f);
ApplyEffectToObject(1, eSource, oSource, 2.0f);

Notice that the first list is one item longer than the second? You declared the action for eDamage, but you never called it into effect.

I think that is what Master Stoffe was referring to.

Exile007
01-03-2008, 02:46 PM
So how do I apply the effect?

Stream
01-03-2008, 04:36 PM
As qui_gon_glenn said, you just forgot to apply the effect, try this;
void main()
{
object oSource = OBJECT_SELF;
object oTarget = GetSpellTargetObject();

effect eBeam = EffectBeam(2026, oSource, 3);
effect eVFX = EffectVisualEffect(1014);
effect eSource = EffectVisualEffect(1014);
effect eDamage = EffectDamage(1000000);

ApplyEffectToObject(1, eBeam, oTarget, 5.0f);
ApplyEffectToObject(1, eVFX, oTarget, 8.0f);
ApplyEffectToObject(1, eSource, oSource, 2.0f);
ApplyEffectToObject(1, eDamage, oTarget, 2.0f);

}
Kind Regards
--Deadly Stream

Exile007
01-03-2008, 08:10 PM
Ok, I got the effect working, but now no damage is being done. But I found and alternative solution, so thanks anyway.