Jump to content

making a spell that you can toggle


talore008

Recommended Posts

ok here is the script its for a a flying spell that i dled it works pretty good but kinda bleh with out the ability to turn it on or off hehe.

 

scn WaldelfLevi01EffectScript

 

float angleZ

 

float X

float Y

float Z

float DX

float DY

float DZ

float oldX

float oldY

float oldZ

float oldDX

float oldDY

float oldDZ

float maxDXY

float t1

float t2

float t5

float t6

float sina

float turbo

 

begin ScriptEffectStart

 

if GetInWorldSpace Tamriel == 0

messageBox "Levitation needs wild spaces and nature's forces"

dispel WaldelfLevi01

endif

 

enableFastTravel 0

 

set oldX to getPos x

set oldY to getPos y

set oldZ to getPos z

end

 

 

begin ScriptEffectFinish

enableFastTravel 1

end

 

 

begin ScriptEffectUpdate

if isInInterior

dispel WaldelfLevi01

endif

 

set X to getPos x

set Y to getPos y

set Z to getPos z

set DZ to Z - oldZ

; Levitation

 

set DX to x - oldX

set DY to y - oldY

 

if (DX*DX)>(DY*DY)

set maxDXY to DX

else

set maxDXY to DY

endif

 

if maxDXY < 0

set maxDXY to -maxDXY

endif

 

set Z to oldZ

 

if isSneaking==0

set turbo to 64

else

set turbo to 4

endif

 

 

if (DX*DX+DY*DY>8)

set X to oldX + turbo*DX/maxDXY

set Y to oldY + turbo*DY/maxDXY

; endif

setPos x , X

setPos y , Y

 

set angleZ to GetAngle x

;Message angleZ+1

;set Z to Z - (angleZ/180)

 

if angleZ < -180

set angleZ to angleZ + 360

elseif angleZ > 180

set angleZ to angleZ - 360

endif

 

set t1 to angleZ / 57.29577951 ; precalculate powers of "angle"

set t2 to t1*t1

set t5 to t2*t2*t1

set t6 to t5*t1

set sina to t1 - t1*t2/6 + t5/120 - t5*t2/5040 + t6*t2*t1/362880

 

set Z to Z - turbo*(sina)

endif

setPos z , Z

 

set oldX to X

set oldY to Y

set oldZ to Z

set oldDZ to DZ

resetFallDamageTimer

end

Link to comment
Share on other sites

you need to change your flying spell into an ability, then create a new spell with this as a script effect:

 

 

 

 

ScriptName flyingspellScript

 

Begin ScriptEffectStart

If ( Player.IsSpellTarget flyingability == 0 )

Player.AddSpell flyingability

ElseIf ( Player.IsSpellTarget flyingability == 1 )

Player.RemoveSpell flyingability

EndIf

End

 

 

 

 

hope this helps.

Link to comment
Share on other sites

I'm usually quite good at giving this sort of advice but the script you posted above is a bit too complicated for me to work out how it works.

 

Maybe if you give me a link to the mod in question, I can download it and take a look at how it works and maybe give appropriate advice.

Link to comment
Share on other sites

I've finally finished making levitation togglable. Please find the new ESP attached to this post. I haven't tested it but it should work as expected. If not, please tell me. I would probably suggest you save your game before trying any of the new spells, which you can buy from Volanaro or Edgar.

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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