I'm trying to create a "Unique Power" wand which will summon a creature (a sheep!) at the location targeted by the player when they "use" the wand.
I can get everything working if I summon the creature at the PC's location (ignoring where the player targeted).
I can only get a visual effect to work if I try to summon the creature at the targeted location.
Here is what is working:
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSummon, oPC, 1.0);
EDIT: derp, had oWP instead of oPC in the quote box. I've been playing with the code a lot. oPC works, oWP does not, even if I've defined oWP properly.
Here is what is inexplicably NOT working:
ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, eSummon, lTarget, 1.0);
This is the whole script, a mishmash of stuff from Lilac's script generator, stuff I found online, and stuff I wrote myself.
#include "x2_inc_switches"
#include "x2_inc_spellhook"
void main()
{
int nEvent = GetUserDefinedItemEventNumber();
// Exit if not an activate event
if(nEvent != X2_ITEM_EVENT_ACTIVATE)return;
object oPC = GetItemActivator();
location lTarget = GetItemActivatedTargetLocation();
effect eSummon = EffectSummonCreature("lum_sheepy", VFX_FNF_SUMMON_CELESTIAL, 3.0, 1);
effect eEffect = EffectVisualEffect(VFX_FNF_SUMMON_CELESTIAL);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC, 1.0);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSummon, oPC, 1.0);
}
I know that eEffect and eSummon are calling the same visual effect. I planned to change one to VFX_FNF_MYSTICAL_EXPLOSION as soon as I got this working.
'>
I have also tried creating a waypoint at the targeted location and summoning the creature there using ApplyEffectToObject, with no success.
Does anybody know how to successfully summon a creature at a targeted location, rather than right next to the PC?
Thank you!
Modifié par chlorinesea, 30 mai 2011 - 07:14 .