Difference between revisions of "Cast"

1,211 bytes added ,  11:00, 4 April 2010
m
imported>DragoonWraith
(can't be called by the player, actors use cast animation, non-actors don't, and only actors work as targets)
imported>UDUN
 
(11 intermediate revisions by 9 users not shown)
Line 1: Line 1:
'''Syntax:'''  
'''Syntax:'''  
  [[''ActorID''|''ActivatorID''.]Cast ''SpellID'' [''TargetRefID'']
  [''ActorID''|''ActivatorID''.]Cast ''SpellID'' [''TargetRefID'']
'''Example:'''
'''Example:'''
  Cast ShrineAkatoshSpeedMagicka Player
  Cast ShrineAkatoshSpeedMagicka Player


Calling object casts spell onto target, spells only.
Calling object casts the specified spell at the target.
The behavior of this function depends on the range of the spell and the types of the calling object and target reference:


==Notes==
==Notes==
 
*Does not require the casted spell to be in the caster's spell list (if any).
*This function cannot be called by the player, i.e. no ''player.Cast''.
*This function can be used to force the player to cast a spell on himself, but cannot force him to cast Touch or Target range spells at other actors or objects.
*If called by an actor, the actor will use his cast animation to cast the spell.
**If used when player controls are disabled it may cause the game to crash.
*If called by anything else, the spell will just fly out.
*If called by an actor, the actor will play his normal spellcasting animations while casting the spell. If the actor is a creature with no spellcasting animation, the function will not work. When called on anything other than an actor, the calling object does not animate.
*Only actors seem to work as targets. If the target is anything but an actor, the calling reference will shoot directly down the negative ''y''-axis, rather than in the direction of the target.
*Only certain types of objects appear to serve as valid targets. Actors and activators work, but when some other object types, such as Items, are supplied for the Target parameter, the spell projectile will travel down the negative ''y''-axis rather than in the direction of the target.
*This function is unreliable when used to force an actor to cast a Target-range spell  on a target which is not within Touch-range. Often the actor will attempt to walk into touch-range of the target and then cast the spell, but more frequently he will simply ignore the function.
*Cast must be called from a reference. Items in inventories aren't references. Therefore cast won't run if called from a scripted object in an inventory. See talk page for details and workarounds.


[[Category: Functions]]
[[Category: Functions]]
[[Category:Functions (CS)]]
[[Category: Functions (CS 1.0)]]
[[Category: Magic Functions]]
[[Category: Magic Functions]]
[[Category:Actor Functions]]
[[Category: Magic Functions (CS 1.0)]]
[[Category: Actor Functions]]
[[Category: Actor Functions (CS 1.0)]]
Anonymous user