Difference between revisions of "GetNthSpell"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Haama
(Added note)
imported>Haama
(Standardized)
Line 1: Line 1:
GetNthSpell - returns the reference's Nth spell.  whichSpell is an index that starts at 0 for the first spell in the list. Note that the CS compiler doesn't expect spells to be returned as a ref.  If you are calling this function multiple times to set the same ref variable you need to assign that variable to some other type (say a weapon) in between your calls to this function. Otherwise the ref will continue to keep the value from the first call.
A command for [[:Category:Oblivion Script Extender|Oblivion Script Extender]]
        (spell:ref) reference.GetNthSpell whichSpell:long
 
'''Syntax:'''
  (count:long) reference.GetNthSpell whichSpell:long
 
Returns the reference's Nth spell.


==Notes==
==Notes==
*Only works on NPCs; won't work on creatures.
*Only works on NPCs; won't work on creatures.
*whichSpell is an index that starts at 0 for the first spell in the list.
*Note that the CS compiler doesn't expect spells to be returned as a ref.  If you are calling this function multiple times to set the same ref variable you need to assign that variable to some other type (say a weapon) in between your calls to this function.  Otherwise the ref will continue to keep the value from the first call.


[[Category:Functions]]
[[Category:Functions]]

Revision as of 15:33, 13 February 2008

A command for Oblivion Script Extender

Syntax:

(count:long) reference.GetNthSpell whichSpell:long

Returns the reference's Nth spell.

Notes

  • Only works on NPCs; won't work on creatures.
  • whichSpell is an index that starts at 0 for the first spell in the list.
  • Note that the CS compiler doesn't expect spells to be returned as a ref. If you are calling this function multiple times to set the same ref variable you need to assign that variable to some other type (say a weapon) in between your calls to this function. Otherwise the ref will continue to keep the value from the first call.