Unused bound arrow script.

Post » Mon Jun 18, 2012 8:56 pm

Scriptname BoundBowEffectScript extends ActiveMagicEffect  ; Modder's Note - this feature was removed for functionality reasons.  However; I'm leaving the script in for anybody who may want to play with bound arrows. -JBAmmo Property boundArrow  Auto  MagicEffect Property BoundBowFFSelf  Auto  EVENT OnEffectStart(Actor Target, Actor Caster);     debug.trace("Bound Bow - Effect Starting - add and equip bound arrows")    caster.additem(boundArrow,100,TRUE)    caster.equipItem(boundArrow, TRUE, TRUE)endEVENTEVENT onLoad();     debug.trace("Bound Bow caught Cell Attach")    if !(getCasterActor().hasMagicEffect(BoundBowFFSelf));         debug.trace("Bound Bow - Cell Attached, script active, but effect not found on "+getCasterActor())        dispel()    endifendEVENTEVENT OnEffectFinish(Actor Target, Actor Caster);     debug.trace("Bound Bow - Effect Finishing, remove any bound arrows")    caster.removeitem(boundArrow,caster.getItemCount(boundArrow),TRUE)endEVENT

I'm not familiar with Papyrus and similiar scripting languages. Can anyone explain what this script is supposed to do? Especially onLoad event.
User avatar
Adrian Powers
 
Posts: 3368
Joined: Fri Oct 26, 2007 4:44 pm

Post » Tue Jun 19, 2012 1:36 am

Modder's Note - this feature was removed for functionality reasons. However; I'm leaving the script in for anybody who may want to play with bound arrows. -JB
That's very nice of Joel! :smile:

Well, the code within the EVENT and endEVENT blocks runs when the game triggers the specific event.
  • onLoad - this is triggered when the script is loaded by the engine, in this case probably when the spell is cast that this magic effect is part of.

    http://www.creationkit.com/Trace_-_Debug puts a message in the papyrus logs.

    The rest of the code checks if the player has currently a bound bow active and dispells this effect (the arrows) otherwise.
  • OnEffectStart - this is triggered after onLoad, just before an magic effect takes effect.

    http://www.creationkit.com/AddItem_-_ObjectReference adds 100 arrows to the caster of this spell.

    http://www.creationkit.com/EquipItem_-_Actor equips the arrows that were just added.
  • OnEffectFinish - this is triggered after the magic effect wears off.

    http://www.creationkit.com/RemoveItem_-_ObjectReference - this removes all remaining bound arrows from the caster.
User avatar
Andrew
 
Posts: 3521
Joined: Tue May 08, 2007 1:44 am

Post » Mon Jun 18, 2012 4:46 pm

So if this script add 100 arrows to actor after summoning bound bow, what feature was removed by JB?

By the way, are there any good tutorials for Papyrus already?
User avatar
Louise Andrew
 
Posts: 3333
Joined: Mon Nov 27, 2006 8:01 am

Post » Mon Jun 18, 2012 3:28 pm

That's very nice of Joel! :smile:
You're welcome!
User avatar
Josee Leach
 
Posts: 3371
Joined: Tue Dec 26, 2006 10:50 pm

Post » Mon Jun 18, 2012 10:47 pm

So if this script add 100 arrows to actor after summoning bound bow, what feature was removed by JB?
Perhaps the script is removed from the magic effect. If it's not attached to something, then it won't run.

For papyrus tutorials see http://www.creationkit.com/Category:Papyrus, and possibly http://www.creationkit.com/Video_Tutorials#Community_Video_Tutorials and http://www.creationkit.com/Category:External_Tutorials as well.
User avatar
liz barnes
 
Posts: 3387
Joined: Tue Oct 31, 2006 4:10 am


Return to V - Skyrim