This wiki is a copy of the original Oblivion CS wiki created and maintained by the UESP.net. See CSwiki:Copy Notice for more info.

Difference between revisions of "GetSummoner"

Jump to navigation Jump to search
673 bytes added ,  07:54, 26 December 2009
Updated the code to work for player summons
imported>Kyoma
(New page: __NOTOC__ A User Function for use with Oblivion Script Extender '''Syntax:''' (summoner:ref) reference.Call GetSummoner Returns a reference to...)
 
imported>Kyoma
(Updated the code to work for player summons)
Line 9: Line 9:
*This function must be called on a reference (Ref.call <function>)  
*This function must be called on a reference (Ref.call <function>)  
*If the summoner is not in the same cell as the summon then it will return 0.  
*If the summoner is not in the same cell as the summon then it will return 0.  
*When called on a summon that is in the process of disappearing it will return 0, [[GetDead]] will be true in those cases.


==Examples:==
==Examples:==
Line 25: Line 26:
  Begin Function {}
  Begin Function {}
  let rSummon := GetSelf
  let rSummon := GetSelf
let arSummons := player.GetFollowers
let iFollower := player.GetNumFollowers
While iFollower > 0
let iFollower -= 1
let rFollower := player.GetNthFollower iFollower
ar_Erase arSummons (ar_Find rFollower arSummons )
Loop
if eval (ar_Find rSummon arSummons) != -99999
SetFunctionValue player
let arSummons := ar_Null
return
endif
  let rActor := GetFirstRef 69 2
  let rActor := GetFirstRef 69 2
  While rActor
  While rActor
  if rActor.GetDead == 0 && rActor.GetDisabled == 0
  if rActor.GetDead == 0 && rActor.GetDisabled == 0
  let arSummons := GetFollowers
  let arSummons := rActor.GetFollowers
  let iFollower := GetNumFollowers
  let iFollower := rActor.GetNumFollowers
  While iFollower > 0
  While iFollower > 0
  let iFollower -= 1
  let iFollower -= 1
  let rFollower := GetNthFollower iFollower
  let rFollower := rActor.GetNthFollower iFollower
  ar_Erase arSummons (ar_Find rFollower arSummons )
  ar_Erase arSummons (ar_Find rFollower arSummons )
  Loop
  Loop
Line 52: Line 67:
  Begin Function {}
  Begin Function {}
  let rSummon := GetSelf
  let rSummon := GetSelf
let arSummons := player.Call GetSummons
if eval (ar_Find rSummon arSummons) != -99999
SetFunctionValue player
let arSummons := ar_Null
return
endif
  let rActor := GetFirstRef 69 2
  let rActor := GetFirstRef 69 2
  While rActor
  While rActor
Anonymous user

Navigation menu