Jump to content

Activation Node Reference for Spellcasting Help


zack1293

Recommended Posts

I'm trying to make a mod casting spells from a hotkey. I'm using faceshifter's "shouts of the dovakiin" mod and tagging midas spells to the shouts. I've created a functional fire breath shout. The Midas Spells are activated by casting the script effects on the player for most of the spells I'm using. To get the fire breath spell to work I created a script to place an activator node at the player on cast then the script tells the node to cast another spell on the player that adds the fire breath script to the player as an ability. The fire breath ability is removed in the script that summons the node. I've been having problems with getting another effect to work in the same way but as far as I can tell the spells should work the same. When I use the addspell command in game to add the ability the spell activates like it should but when using the hotkey to cast the spell doesn't seem to activate at all. My question is do I need to create another node as a reference? I couldn't see why the same referance couldn't cast a different spell on the player. Is there a way to get some console feedback telling me if one of the scripts isn't working quite right?
Link to comment
Share on other sites

Working Scripts

 

On cast using hotkey:

scriptname flamebreathnodeactivatorscript

;Casts an aoe spell at the caster which calls lighting down in a radius around him.

 

ref me ;holds a reference to the actor who is casting

ref source ;holds a reference to the activator

 

Begin ScriptEffectStart

;get a reference to the caster

set me to GetSelf

me.removespell facefirebreathability

source.removespell facefirebreathability

 

;set the reference to the activator

set source to source

 

;add 200 to the height so it is above the actor

source.MoveTo me 0, 0, 0

 

;have the activator cast the AOE spell now

source.Cast faceflmbreath me

 

End

 

Spell effect after first script:

scriptname flamebreathspellscriptspray

 

 

ref me ;holds a reference to the actor who affected by this spell

ref source ;holds a reference to the activator

 

 

Begin ScriptEffectStart

;get a reference to this actor

set me to player

 

;set source to the activator

set source to source

 

;add 1000 to the height to simulate lightning coming from the sky

source.MoveTo me 0, 0, 0

source.addspell facefirebreathability

me.addspell facefirebreathability

End

 

the actual spell script by xilver modified to include new spell connected to correct reference:

scn MidasBreathShootScript

 

; - - Used for Multiple Breath Spells

 

ref me

ref myBall

float myz

 

; initial position vector

float xPos

float yPos

float zPos

 

; fly vector

float dx

float dy

float dz

 

; private

float ang

float xang

float yang

float zang

float x

float x2

float sin

float cos

 

 

 

Begin ScriptEffectStart

set me to GetSelf

set ang to me.GetAngle z

if ang > 180

set ang to (ang)-360

endif

set zang to ang

set x to ang*0.0174532925

set x2 to x*x

set sin to x*(1-(x2/6)*(1-(x2/20)*(1-(x2/42)*(1-(x2/72)*(1-x2/110)))))

set cos to 1-0.5*x2*(1-(x2/12)*(1-(x2/30)*(1-(x2/56)*(1-x2/90))))

set dx to 10*sin

set dy to 10*cos

 

; vertical fly vector

set ang to me.GetAngle x

set xang to ang*cos ; uses settings from Horizontal Vector

set yang to -ang*sin

 

set x to -ang*0.0174532925

set x2 to x*x

set sin to x*(1-(x2/6)*(1-(x2/20)*(1-(x2/42)*(1-(x2/72)*(1-x2/110)))))

set cos to 1-0.5*x2*(1-(x2/12)*(1-(x2/30)*(1-(x2/56)*(1-x2/90))))

set dz to 10*sin

 

; initial position vector (to add to player coords)

 

set xPos to 5*dx*cos

set yPos to 5*dy*cos

set zPos to 120-25*(me.IsSneaking)+5*dz

set MidasQuest.SpellZoff to 120

 

if me.isSpellTarget MidasFireBreathSpell

set myBall to MidasActivatorFireBreathRef

set MidasQuest.StreamSpell to MidasHeatBeamTouchSpell

elseif me.isSpellTarget facefireblast

set myBall to MidasActivatorFireBreathRef

set MidasQuest.StreamSpell to MidasHeatBeamTouchSpell

elseif me.isSpellTarget facefirebreathability

set myBall to MidasActivatorFireBreathRef

set MidasQuest.StreamSpell to facefirebreathabilitydamage

elseif me.isSpellTarget MidasFrostBreathSpell

set myBall to MidasActivatorFrostBreathRef

set MidasQuest.StreamSpell to MidasFreezeRayTouchSpell

elseif me.isSpellTarget MidasHolyBreathSpell

set myBall to MidasActivatorHolyBreathRef

set MidasQuest.StreamSpell to MidasHolyBeamTouchSpell

elseif me.isSpellTarget MidasPestilenceSpell

set myBall to MidasActivatorBugBreathRef

set MidasQuest.StreamSpell to MidasPestilenceTouchSpell

elseif me.isSpellTarget MidasPerfumeBreathSpell

set myBall to MidasActivatorPerfumeBreathRef

set MidasQuest.StreamSpell to MidasPerfumeCalmSpell

elseif me.isSpellTarget MidasSmokeBreathSpell

set myBall to MidasActivatorSmokeBreathRef

set MidasQuest.StreamSpell to MidasSmokeTouchSpell

elseif me.isSpellTarget MidasSandBlastSpell

set myBall to MidasActivatorSandBlastRef

set MidasQuest.StreamSpell to MidasSmokeTouchSpell

elseif me.isSpellTarget MidasFireballFrenzySpell

set myBall to MidasActivatorFireballFrenzyRef

set MidasQuest.SpellZoff to 75

set MidasQuest.StreamSpell to StandardFireDamageTarget1Novice

elseif isSpellTarget MidasVulcanSpell

set myBall to MidasActivatorVulcanRef

Set MidasQuest.StreamSpell to MidasMagmaStreamTouchSpell

Set MidasQuest.StreamStartSpell to MidasMagmaTouchSpell

endif

 

if myBall != me

set MidasQuest.Proj to myBall

myBall.SetDestroyed 0

myBall.Activate me 1

myBall.moveto me xpos ypos zpos

myBall.SetAngle z zang

myBall.SetAngle y yang

myBall.SetAngle x xang

set myZ to MyBall.Getpos z

myBall.Setpos z MyZ

endif

 

end

 

 

Not working:

 

On cast using hotkey:

scriptname faceholyfirenodeact

 

 

ref me ;holds a reference to the actor who is casting

ref source ;holds a reference to the activator

 

Begin ScriptEffectStart

;get a reference to the caster

set me to GetSelf

me.removespell facehfabil

source.removespell facehfabil

 

;set the reference to the activator

set source to source

 

;add 200 to the height so it is above the actor

source.MoveTo me 0, 0, 0

 

;have the activator cast the AOE spell now

source.Cast faceholyfireactivator me

source.cast faceholyfireactivator source

 

End

 

Spell effect after first script:

scriptname facehfnodecast

 

 

ref me ;holds a reference to the actor who affected by this spell

ref source2 ;holds a reference to the activator

 

 

Begin ScriptEffectStart

;get a reference to this actor

set me to player

 

;set source2 to the activator

set source2 to source2

 

;add 1000 to the height to simulate lightning coming from the sky

source2.MoveTo me 0, 0, 0

source2.addspell facehfabil me

me.addspell facehfabil me

End

 

Spell's script by xilver:

scn MidasHolyOrbsShootScript

 

 

ref me

ref myBall

float timer

float myX

float myY

float myZ

float fixZ

short doState

 

; initial position vector

float ang

float xPos

float yPos

float zPos

 

 

 

 

Begin ScriptEffectStart

set me to GetSelf

set ang to me.GetAngle z

; initial position vector (to add to player coords)

 

set zPos to 78-25*(me.IsSneaking)

 

set myBall to MidasActivatorHolyOrbsRef01

set MidasQuest.StreamSpell to MidasDamageHealth64Spell

 

if myBall != me

myBall.SetDestroyed 0

myBall.moveto me 0 0 zpos

myBall.SetAngle Z ang

myBall.Activate me 1

endif

 

end

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...