EffectSummonCreature(string, int, float)

Creates a summon creature effect.

effect EffectSummonCreature(
    string sCreatureResref,
    int nVisualEffectId = VFX_NONE,
    float fDelaySeconds = 0.0f
);

Parameters

sCreatureResref

Identifies the creature to be summoned by resref name. Not case sensitive.

nVisualEffectId

VFX_* (Default: VFX_NONE)

fDelaySeconds

There can be delay between the visual effect being played, and the creature being added to the area. (Default: 0.0f)


Description

Returns a Summon Creature effect which will create a creature of type sCreatureResRef using the visual effect of type nVisualEffectID.

fDelay is the delay between when the visual effect starts and the creature appears. This allows the scriptor to create a much more believable effect.

Can only be applied from creature objects (PC or NPC), no other objects. You can fire this at a specific location, because the default summoning scripts do this. It also seems to create an actual getable effect on the caster/creator of the effect, which can be dispelled.

This effect cannot be applied instantly, only temporarily or permanently. It can be applied at a location, or a target (but it will mearly use the targets location).



Remarks

nVisualEffectId is fired at the NEW location of the summoned creature - not the target location, say, of the spell, if the summoned creature couldn't fit there. This is very useful. Note that only an instant effect should be put here, such as VFX_FNF_SUMMON_MONSTER_1.

You can only have 1 summoned monster on 1 creature at a time - any new ones (and incurances of EffectSwarm()) will cancel out and just remove the old summoned associate as if they had been unsummoned.

The creator of the effect (the caller of the script) will be the master - not who it is targeted on (as this is really a location effect, and should normally just be applied with ApplyEffectAtLocation()).

This writer wished there could be a way to add multiple summons as you can add multiple henchmen now.

Effect functions are Constructors, which are special methods that help construct effect "objects". You can declare and link effects, and apply them using an ApplyEffectToObject() Command. Once applied, each effect can be got seperately via. looping valid effects on the caster (GetFirst/NextEffect()). See the Effect Tutorial for more details.


Version

1.62

Example

// The following script is for an OnUsed event.  It 
// will summon a werewolf and add it to the PC's party.  The 
// werewolf effect will last for 30 minutes, by executing a special
// "Summon werewolf" script, "sum_werewolf", below this one.

void main()
{
    object oPC = GetLastUsedBy();
    // Execute the script
    ExecuteScript("sum_werewolf", oPC);
}

// The "sum_werewolf" script - this makes sure that the werewolf
// will actually follow the PC around and act as if he is its master,
// and for 30 minutes.

void main()
{
    location lTarget = GetLocation(OBJECT_SELF);
    effect eSummon = EffectSummonCreature("nw_werewolf", VFX_FNF_GAS_EXPLOSION_EVIL, 0.5f);
    ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, lTarget, 1800.0);
}

See Also

functions: ApplyEffectAtLocation | ApplyEffectToObject | SetSummonEffect | SummonAnimalCompanion | SummonFamiliar
categories: Effects Functions


 author: Brett Lathrope, editor: Jasperre, Mistress, additional contributors: Enigmatic, Aiko Gieskens, Jasperre, Fireboar