Editing
AddSpell - Actor
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
[[Category:Scripting]] [[Category:Papyrus]] '''Member of:''' [[Actor Script]] Adds the specified [[Spell Script|spell]] to this actor. == Syntax == <syntaxhighlight lang="papyrus"> bool Function AddSpell(Spell akSpell, bool abVerbose = true) native </syntaxhighlight> == Parameters == *akSpell: The [[Spell Script|spell]] to add to this actor. *abVerbose: Pass false to suppress UI messages for spells added to the player. Spells added to NPCs never result in a UI message. **'''Default''': True == Return Value == True on success. == Examples == <syntaxhighlight lang="papyrus"> ; Adds the sheep spell to the player if (Game.GetPlayer().AddSpell(SheepSpellProperty)) Debug.Trace("Sheep spell added to the player") endIf </syntaxhighlight> <br> <syntaxhighlight lang="papyrus"> ; Adds the sheep spell to the player, silently if (Game.GetPlayer().AddSpell(SheepSpellProperty, false)) Debug.Trace("Sheep spell added to the player (like a ninja!)") endIf </syntaxhighlight> == Notes == * Adding a Spell marked as an Ability to the Player without at least one [[Effect Item]] set in the Spell's Effects List will result in a crash to desktop when the Player attempts to view their Active Effects in the menu. ** You can get away with an Effect-less Ability by applying the AbBlank Effect to an Ability. This will prevent crashing, but keep the Ability from appearing in Active Effects. * This function was confirmed to be one of the culprits associated with the dual casting bug where the bool returned by isDualCasting is not correct. This has been addressed by the following mod here: [https://www.nexusmods.com/skyrimspecialedition/mods/92454 Po3's Dual Casting Fix] == See Also == *[[Actor Script]] *[[RemoveSpell - Actor]]
Summary:
Please note that all contributions to the CreationKit Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
CreationKit:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Landing page
Tutorials
Game Systems
Editor Reference
Scripting Reference
Recent changes
Help
Tools
What links here
Related changes
Special pages
Page information
Page values