Bardic Knowledge - reverse engineering

Post » Wed Jul 03, 2013 7:24 am

I want to make a summonable floating object which follows the player around and applies buffs to closeby allies or debuffs to closeby enemies. Basically the same as the floating drum you get with the Bardic Knowledge power. I'm trying to get my head around how it works and I'm in dire need of help.

Went into the CK and found the magical effect attached to the spell and found out it has this script attached:

Spoiler
Scriptname DLC2FXInsturmentsSummonSCRIPT extends ActiveMagicEffect conditional
{moves the instruments actor to player on effect start and moves actor back to holding cell on effect end}

import utility
import debug

ObjectReference property myMarker auto
ObjectReference property myBard auto
Activator property myFX Auto
Quest property myQuest auto
MagicEffect property myMagicEffect auto
Spell property myBardSpell auto
sound property IntroSoundFX auto
sound property OutroSoundFX auto

;******************************************************

Event OnEffectStart(Actor Target, Actor Caster)
(myBard as actor).StopCombat()

if(IntroSoundFX)
IntroSoundFX.play((target as objectReference))
endif
myBard.enable()
myBard.moveTo(game.GetPlayer())
myQuest.setStage(500)
wait(2)
myBardSpell.Cast(myBard as actor)
endEvent

;******************************************************

Event OnEffectFinish(Actor Target, Actor Caster)
if(game.getPlayer().HasMagicEffect(myMagicEffect))
;bard is already there, no need to disable
else
(myBard as Actor).PlaySubGraphAnimation("stopeffect")
if(OutroSoundFX)
OutroSoundFX.play((target as objectReference))
endif
wait(0.5)
myBard.MoveTo(myMarker)
(myBard as actor).StopCombat()
myQuest.setStage(600)
endif
endEvent

;******************************************************

Dug around a little more and this one is right after it:

Spoiler
Scriptname DLC2FXInsturmentsAttachSCRIPT extends ActiveMagicEffect conditional
{Attaches Instruments FX to actor}

import utility
import debug

VisualEffect property myFX Auto
ObjectReference selfRef

;******************************************************

Event OnEffectStart(Actor Target, Actor Caster)
selfRef = caster
while !(selfRef.is3dLoaded())
;wait for 3D to load before attach FX
wait(0.25)
endWhile
;3D is loaded
myFX.play(selfref, -1)
endEvent

;******************************************************

Event OnEffectFinish(Actor Target, Actor Caster)
myFX.Stop(selfRef)
endEvent

;******************************************************

Can this be modified to suit my needs (changing the drum into another floating object and also changing the effects)? The entire thing is heavily scripted with conditions and the emergency solution would be to make a dummy summonable creature with effects attached.

User avatar
Tom
 
Posts: 3463
Joined: Sun Aug 05, 2007 7:39 pm

Return to V - Skyrim