Difference between revisions of "User:Arocide"
Added a hopefully potential idea for Script Pages
imported>Arocide (Random Ideas!) |
imported>Arocide (Added a hopefully potential idea for Script Pages) |
||
Line 1: | Line 1: | ||
Hey, welcome to my corner of CK wiki... just put up random thoughts and ideas here. | Hey, welcome to my corner of CK wiki... I just put up random thoughts and ideas here. | ||
==Papyrus Script Pages== | |||
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}= | |||
::<source lang="papyrus">Function Cast(ObjectReference akSource, ObjectReference akTarget = None) native</source> | |||
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 == | |||
<source lang="papyrus"> | |||
mySpell.cast(myActivator, playerRef) | |||
; myActivator has cast mySpell on the player! | |||
</source> | |||
== 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]] | |||
Wiki Syntax for above: | |||
<source lang="text"> | |||
__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]] | |||
</source> | |||
==Papyrus Object Pages== | ==Papyrus Object Pages== |