CozmicUnicorn Posted January 29, 2017 Share Posted January 29, 2017 Hey, I'm new to the creation kit and so far I've been working on a mod that changes the Bloodskal Blade from the Dragonborn DLC.I'm done about 80% of the mod but I'm stuck on this last part because I think I need scripting to do it.My goal is to cast a spell on the player that I made called DLC2BloodskalBladeHealthDrain whenever the beam attack is cast (DLC2BloodskalBladeSpellHoriz and/or DLC2BloodskalBladeSpellVert). My first guess would be to add it to the DLC2BloodskalBladeScript which I tried but I either did wrong or it didn't work: Scriptname DLC2BloodskalbladeScriptV2 extends referenceAliasActor property selfRef auto hiddenSpell Property DLC2BloodskalBladeSpellHoriz autoSpell Property DLC2BloodskalBladeSpellVert autoSpell Property DLC2BloodskalBladeHealthDrain auto [ADDED]weapon property selfWeapon auto hidden hiddenammo property DLC2BloodskalAmmo autoReferenceAlias Property BloodskalBlade autoobjectReference Property ObjSelf auto hiddenEvent OnEquipped(Actor akActor);objSelf = self.getReference(); debug.trace(self + " has recieved OnEquipped")selfRef = akActor; ;debug.Trace("SelfRef = " + SelfRef)if (selfref == Game.GetPlayer());registerForAnimationEvent(selfRef, "PowerAttack_Start_End")registerForAnimationEvent(akActor, "AttackPowerStanding_FXstart")registerForAnimationEvent(akActor, "AttackPowerRight_FXstart")registerForAnimationEvent(akActor, "AttackPowerLeft_FXstart")registerForAnimationEvent(akActor, "AttackPowerBackward_FXstart")registerForAnimationEvent(akActor, "AttackPowerForward_FXstart")else;registerForAnimationEvent(selfRef, "PowerAttack_Start_End")registerForAnimationEvent(akActor, "AttackPowerStanding_FXstart")registerForAnimationEvent(akActor, "AttackPowerRight_FXstart")registerForAnimationEvent(akActor, "AttackPowerLeft_FXstart")registerForAnimationEvent(akActor, "AttackPowerBackward_FXstart")registerForAnimationEvent(akActor, "AttackPowerForward_FXstart")endif; ;debug.trace("Registering for Single Update");RegisterforSingleUpdate(0)endEventEvent OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)if akNewContainer as ActorselfWeapon = (self.getReference().getBaseObject() as weapon)utility.wait(0.1)if (akNewContainer as Actor).isEquipped(selfWeapon)OnEquipped(akNewContainer as Actor)endifendifBloodskalBlade.ForceRefTo(objSelf)endEventEvent OnUnequipped(Actor akActor); debug.trace(self + " has recieved onEffectFinish");unregisterForAnimationEvent(selfRef, "PowerAttack_Start_End")unregisterForAnimationEvent(akActor, "AttackPowerStanding_FXstart")unregisterForAnimationEvent(akActor, "AttackPowerRight_FXstart")unregisterForAnimationEvent(akActor, "AttackPowerLeft_FXstart")unregisterForAnimationEvent(akActor, "AttackPowerBackward_FXstart")unregisterForAnimationEvent(akActor, "AttackPowerForward_FXstart")ENDEVENTEvent OnAnimationEvent(ObjectReference akSource, string EventName); debug.trace(self + " has recieved AnimationEvent "); debug.trace(">>>>>>>>>>>>> AnimationEvent Name: " + EventName); debug.trace(">>>>>>>>>>>>> AkSource: " + akSource)if (selfref == Game.GetPlayer())if (eventName == "AttackPowerRight_FXstart") || \(eventName == "AttackPowerLeft_FXstart") || \(eventName == "AttackPowerBackward_FXstart")weapon SwordWeapon = selfRef.GetEquippedWeapon()DLC2BloodskalBladeSpellHoriz.cast(selfRef)elseif (eventName == "AttackPowerStanding_FXstart") || \(eventName == "AttackPowerForward_FXstart")weapon SwordWeapon = selfRef.GetEquippedWeapon()DLC2BloodskalBladeSpellVert.cast(selfRef)endifDLC2BloodskalBladeHealthDrain.cast(selfRef)[ADDED]endifendEVENT I also tried attaching a script dynamically to the player through a quest (I think?) but that didn't work: Scriptname DLC2BloodskalBladePlayerHealthCost extends ReferenceAliasSpell Property DLC2BloodskalBladeHealthDrain AutoSpell Property DLC2BloodskalBladeSpellVert AutoActor Property PlayerRef AutoEvent OnSpellCast(Form DLC2BloodskalBladeSpellVert) [This is only Vertical/I don't know how to add both horiz and/or vert]DLC2BloodskalBladeHealthDrain.cast(PlayerRef) [Feels like I have to specify the object or player casting something? But I don't know how]EndEvent For reference the mod makes the Bloodskal Blade steal health based on how low the player's health % is (Lower health=More life steal) and it makes the beam attack do more damage based on how high the players health % is (Beam does more damage the higher health the player is at). The only part I have to add is integrating this DLC2BloodskalBladeHealthDrain spell which damages the player based on how high their health % is (More damage when player is higher health). I hope to cast this spell whenever the Bloodskal Blade beams are cast that way it looks like you are fueling the beam with more power from your health. I'm kind of out of idea's and I'm very new to modding and the creation kit. Any ideas/help would be greatly appreciated. Link to comment Share on other sites More sharing options...
steve40 Posted February 7, 2017 Share Posted February 7, 2017 (edited) In the first script: DLC2BloodskalBladeHealthDrain.cast(self, selfRef) or probably... DLC2BloodskalBladeHealthDrain.cast(GetReference(), selfRef) as your script extends ReferenceAlias it must be attached to a quest alias. Edited February 7, 2017 by steve40 Link to comment Share on other sites More sharing options...
Recommended Posts