User:Arocide

From the CreationKit Wiki
Jump to navigation Jump to search

Hey, welcome to my corner of CK wiki... I just put up random thoughts and ideas here.

Papyrus Script Pages[edit | edit source]

Over the time I've spent here there's never been a be all to end all template for Functions or Event pages and some pages depart from what is conventionised by others so as an attempt spark conversation on that as well here is an example of what I think is a good layout for Script pages(taken from Cast - Spell) I might run with it a bit and produce a template in the near future but for now it's an idea.

{TITLE}[edit | edit source]

Function Cast(ObjectReference akSource, ObjectReference akTarget = None) native


Casts this spell from the specified object reference, optionally toward a target object reference.

Parameters[edit | edit source]

  • akSource: The ObjectReference from which to cast the spell. The source must be able to cast this spell (testings seem to show anything will work, regardless whether they have the spell or not).
  • akTarget: An optional ObjectReference at which to aim the spell. If None is passed and the spell needs a direction, it will be aimed in a default direction.
    • Default: None

Return Value[edit | edit source]

None.

Examples[edit | edit source]

mySpell.cast(myActivator, playerRef)
; myActivator has cast mySpell on the player!

Notes[edit | edit source]

  • This function casts the spell instantaneously. This is mainly desirable only for non-actors, because it will not animate an actor. For instance, the spell will be cast even if the actor's hands are not readied.
  • If you wish to make an actor cast a spell using all the normal spellcasting behaviors, please instead use an AI package that includes the UseMagic procedure.
  • Actor races can be set to cast magic only in the direction that the actor is facing; if the source is an actor with this racial setting, the target will be ignored. (Exception: if the spell is a Target Actor spell, it will hit regardless of distance or direction)
  • Using this function on an actor that doesn't have the spell will work. To add, it will also work on Objects, such as a rock.
  • Using this function will invalidate (cause it to return 0/false when it should return 1/true) any ongoing isDualCasting condition checks on akSource.
    • isDualCasting will continue to return false after the Cast function is called until akSource stops dual casting.

Bug[edit | edit source]

In rare circumstances, this may start working sporadically or quit altogether. Don't use this for functionality that is expected to trigger very frequently throughout a character's lifetime.

See Also[edit | edit source]


Wiki Syntax for above:

__NOTOC__
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Latent Functions]]
::Function Cast(ObjectReference akSource, ObjectReference akTarget = None) native {Omitted Source Tags}

Casts this spell from the specified object reference, optionally toward a target object reference.

=== Parameters ===
*akSource: The [[ObjectReference Script|ObjectReference]] from which to cast the spell.  The source must be able to cast this spell (testings seem to show anything will work, regardless whether they have the spell or not).
*akTarget: An optional [[ObjectReference Script|ObjectReference]] at which to aim the spell. If None is passed and the spell needs a direction, it will be aimed in a default direction.
**'''Default''': None

=== Return Value ===
None.

== Examples ==
mySpell.cast(myActivator, playerRef)
; myActivator has cast mySpell on the player!
{Ommited Source Tags}

== Notes ==
*This function casts the spell instantaneously.  This is mainly desirable only for non-actors, because it will not animate an actor.  For instance, the spell will be cast even if the actor's hands are not readied.
*If you wish to make an actor cast a spell using all the normal spellcasting behaviors, please instead use an AI package that includes the [[Procedure_UseMagic|UseMagic procedure]].
*Actor races can be set to cast magic only in the direction that the actor is facing; if the source is an actor with this racial setting, the target will be ignored. (Exception: if the spell is a Target Actor spell, it will hit regardless of distance or direction)
*Using this function on an actor that doesn't have the spell will work. To add, it will also work on Objects, such as a rock.
*Using this function will invalidate (cause it to return 0/false when it should return 1/true) any ongoing '''isDualCasting''' condition checks on akSource.  
**'''isDualCasting''' will continue to return false after the '''Cast''' function is called until akSource stops dual casting.

== Bug ==
In rare circumstances, this may start working sporadically or quit altogether. Don't use this for functionality that is expected to trigger very frequently throughout a character's lifetime.

== See Also ==
*[[Spell Script]]
*[[RemoteCast - Spell]]
*[[InterruptCast - ObjectReference]]
*[[Procedure_UseMagic|UseMagic procedure]]
*[[DoCombatSpellApply - Actor]]




Papyrus Object Pages[edit | edit source]

Am I the only one who finds them difficult to read at a glance? all the syntactical information is wasted on me I don't get why such specialised information is not only on a function / events page (I know alot don't exist yet but still) why couldn't the Script Object lists be easier to read say something like this? (Took syntax from ColorForm Script)

SKSE Member Functions[edit | edit source]

GetColor Gets the Alpha-Red-Green-Blue (ARGB) color code of the color form.
SetColor Sets the Color Form's color to the specified ARGB code.
GetRed Gets the red component value of this color form. (0 to 255)
GetGreen Gets the green component value of this color form. (0 to 255)
GetBlue Gets the blue component value of this color form. (0 to 255)
GetHue Gets the hue value of this color form.
GetSaturation Gets the saturation of this color form.
GetValue Gets the value (Brightness) of this color form.