RemoteCast - Spell

From the CreationKit Wiki
Revision as of 13:53, 11 November 2011 by imported>Scornett (Reverted edits by Scornett-Bot (talk) to last revision by Jlundin)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Member of: Spell Script

Casts this spell from the specified object reference with a specified Actor getting the "blame" for the spell if it could cause a crime to occur, optionally toward a target object reference.

Syntax

Function RemoteCast(ObjectReference akSource, Actor akBlameActor, ObjectReference akTarget = None) native

Parameters

  • akSource: The ObjectReference from which to cast the spell. The source must be able to cast this spell.
  • akBlameActor: The Actor who will be taking blame for the spell if adding it to a target would cause a crime.
  • akTarget: An optional ObjectReference at which to aim the spell. If None is passed and the spell needs a direction, it will be aimed in a default direction.
    • Default: None

Return Value

None.

Examples

; Have the box cast a fireball, but blame the player!
Fireball.RemoteCast(Box, Game.GetPlayer())


; Have the box cast a fireball at the victim, but blame the player!
Fireball.RemoteCast(Box, Game.GetPlayer(), Victim)

Notes

  • This function casts the spell instantaneously. This is mainly desirable only for non-actors, because it will not animate an actor. For instance, the spell will be cast even if the actor's hands are not readied.
  • If you wish to make an actor cast a spell using all the normal spellcasting behaviors, please instead use an AI package that includes the UseMagic procedure.
  • Actor races can be set to cast magic only in the direction that the actor is facing; if the source is an actor with this racial setting, this parameter will be ignored.

See Also