Aller au contenu

Photo

More fun with Area of Effects...


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
Ivanovich

Ivanovich
  • Members
  • 74 messages
So I am trying to design an AOE that goes into effect once an item is equipped.  I have "ExecuteScript("scriptname", GetPCItemLastEquippedBy(); in the "on player equip" section of the module, referencing the tag of the item (in the case, a shield).

When the shield is equipped it is supposed to create an AreaOfEffect around the player equipping it.  The AOE is to move around with the player.  However, as the player moves around, no NPCs seem affected by it.  I was wondering if someone can tell why.

The item's script is:

void main()
{
object oPC = OBJECT_SELF;
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectAreaOfEffect(AOE_PER_INVIS_SPHERE, "spellabsorbent", "test", "spellabsorbex"), oPC);
}

with OBJECT_SELF being passed as the player from the onequip script.

The AOE enter script is:

#include "nw_i0_plot"

void main()
{
object oPC = GetEnteringObject();
effect eEffect = GetFirstEffect(oPC);

    while(GetIsEffectValid(eEffect))
    {
    RemoveEffect(oPC, eEffect);
    eEffect = GetNextEffect(oPC);
    }

ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_DISPEL), oPC, 1.0);
AssignCommand(oPC, ActionSpeakString("I entered the effect!", TALKVOLUME_SHOUT));
}

the last line is entered for debugging purposes.  But no NPC shouts that they've entered into the effect, nor do they experience the remove effect part.

Anyone?  Bueller?

TIA.

#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

 void main()
{
object oPC = OBJECT_SELF;
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectAreaOfEffect(AOE_PER_INVIS_SPHERE, "spellabsorbent", "test", "spellabsorbex"), oPC);
}



IF this is running in an onEquip event then the script in running on the module.(OBJECT_SELF). 
So your script is applying the area of effect to the module.  Use GetItemLastEquiptedBy or whatever it is to get the PC equiping the item.

Modifié par Lightfoot8, 30 juin 2011 - 07:26 .


#3
Ivanovich

Ivanovich
  • Members
  • 74 messages
I thought that is what I did. I am calling the script with ExecuteScript("scriptname", GetPCItemLastEquippedBy()); and hence, in "scriptname" isn't OBJECT_SELF the PC automatically??

#4
Ivanovich

Ivanovich
  • Members
  • 74 messages
I changed the OBJECT_SELF in the script to GetPCLastEquippedBy and nothing changed. As I thought, it's already bringing in the pc who last equipped an item.

Anyone else have a suggestion?

#5
Ivanovich

Ivanovich
  • Members
  • 74 messages
What I've figured out through debugging is that - for some reason - the AOE goes up and instantly down. It does not remain in effect, though I cannot figure out why.

Just goes into effect for a split second before removing itself permanently.

Modifié par Ivanovich, 01 juillet 2011 - 01:05 .


#6
Ivanovich

Ivanovich
  • Members
  • 74 messages
I solved it. When I was removing effects, I was removing the effect I had created as well. Disregard, thanks.