Difference between revisions of "Talk:Cast - Spell"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Cscottydont
 
(6 intermediate revisions by 3 users not shown)
Line 2: Line 2:
Magnitude of the spell will also benefit from skill level of the caster (maybe from active magic effects too?).  Tested with a destruction spell which had 10 magnitude in the ck, which did 15 damage coming from my 90 Destruction level character.<br>
Magnitude of the spell will also benefit from skill level of the caster (maybe from active magic effects too?).  Tested with a destruction spell which had 10 magnitude in the ck, which did 15 damage coming from my 90 Destruction level character.<br>
[[User:Cscottydont|Cscottydont]] 06:03, 19 February 2012 (EST)
[[User:Cscottydont|Cscottydont]] 06:03, 19 February 2012 (EST)
:Spells that are script-Cast with the player as the akSource will benefit from perks relevant to the spell being cast.<br>
:e.g. If FireSpell is a 100 magnitude spell with MagicDamageFire as a keyword,<br>
:<source lang="papyrus">FireSpell.Cast(ObjectReference akSource, ObjectReference akTarget)</source>
:^ will do 150 damage to akTarget if akSource has both augmented flames perks.<br>
:[[User:Cscottydont|Cscottydont]] 07:28, 3 March 2012 (EST)
<br><br>
Using this function will invalidate (cause it to return 0/false when it should return 1/true) any ongoing isDualCasting checks on akSource.  So any mod that makes use of the cast - spell function will conflict with any mod that utilizes the isDualCasting condition.  The same is true of [[RemoteCast - Spell]]. <br>
'''Test Method'''<br>
#Created a scripted ability to periodically fire a test spell using the Cast function with the player as akSource.
#Continuously dual cast the Flames spell.
#Used console to check "player.isDualCasting" - returned 1.00 (true)
#Scripted ability fired the test spell.
#Used console to check "player.isDualCasting" - returned 0.00 (flase)
<br>
[[User:Cscottydont|Cscottydont]] ([[User talk:Cscottydont|talk]]) 2013-01-29T15:32:26 (EST)
== Cast and unloaded cells  ==
This function returns an error if called when either akSource or akTarget is in unloaded cell.<br>
Check if cell the target (or caster, depending on your script) is currently in [[IsAttached_-_Cell|is attached]], to determine if it's safe to call Cast():
<source lang="papyrus">
If akTarget.GetParentCell().IsAttached()
    mySpell.Cast(akSource, akTarget)
EndIf
</source>
--[[User:Ingvion|Ingvion]] ([[User talk:Ingvion|talk]]) 07:07, 11 October 2023 (EDT)

Latest revision as of 06:07, 11 October 2023

Spells cast using this method will use conditionals defined for their effects with akSource as the caster. This was something I was curious about so I tested it. (not extensively but I was able to fire 2 different debug messages based on whether or not the player had a specific ability)
Magnitude of the spell will also benefit from skill level of the caster (maybe from active magic effects too?). Tested with a destruction spell which had 10 magnitude in the ck, which did 15 damage coming from my 90 Destruction level character.
Cscottydont 06:03, 19 February 2012 (EST)

Spells that are script-Cast with the player as the akSource will benefit from perks relevant to the spell being cast.
e.g. If FireSpell is a 100 magnitude spell with MagicDamageFire as a keyword,
FireSpell.Cast(ObjectReference akSource, ObjectReference akTarget)
^ will do 150 damage to akTarget if akSource has both augmented flames perks.
Cscottydont 07:28, 3 March 2012 (EST)




Using this function will invalidate (cause it to return 0/false when it should return 1/true) any ongoing isDualCasting checks on akSource. So any mod that makes use of the cast - spell function will conflict with any mod that utilizes the isDualCasting condition. The same is true of RemoteCast - Spell.
Test Method

  1. Created a scripted ability to periodically fire a test spell using the Cast function with the player as akSource.
  2. Continuously dual cast the Flames spell.
  3. Used console to check "player.isDualCasting" - returned 1.00 (true)
  4. Scripted ability fired the test spell.
  5. Used console to check "player.isDualCasting" - returned 0.00 (flase)


Cscottydont (talk) 2013-01-29T15:32:26 (EST)

Cast and unloaded cells[edit source]

This function returns an error if called when either akSource or akTarget is in unloaded cell.
Check if cell the target (or caster, depending on your script) is currently in is attached, to determine if it's safe to call Cast():

If akTarget.GetParentCell().IsAttached()
    mySpell.Cast(akSource, akTarget)
EndIf

--Ingvion (talk) 07:07, 11 October 2023 (EDT)