Jump to content

Shapeshift script help


Blatte

Recommended Posts

Hello,

I'm new here, first topic (who cares?). Recently i tried the CS, and i must say i like the opportunity of creating something customized. So i managed to make an island, new buildings, NPCs, Quests etc... Everything works well BUT a script i took from the mod TERRAN vampire (from Zorak Ramone, but no contact insrted so i couldn't join him (her?), i also looked at the script from the Dryad mod of Luchaire and the Druid one of Pimpskinny ).

 

I'd like to give the ability to morph into butterflies to the player (using the effect of SI when transforming, when the walls disapear... and then using some butterflies as constant shape...).

 

So, can somebody resume the main lines of making a new spell. i'd like to now how many new files i need. I mean for example, i created 3 new magic type files:

-one the player activates, that check if it has 1 welkynd stone (works)

-one that consists of the new shape (doesnt work)

-one to pass through doors while shape shifted (not tested... need the previous one)

 

Well, it's just the TERRAN MIST FORM shapeshift VERY slightly changed for personnal use and training...

anyway, here's the script I need help for :

 

ScriptName 01butterfliesAbScript

 

ref self

ref activator1

ref activator2

float myheading ;;;heading of the player

float playerdistance ;;;distance from activator to player

float chestheight ;;;distance from the ground to activator1

float castheight ;;;distance from the ground to activator2

float theta ;;;angle for caculating position of activator

float xmod

float ymod

float myx ;;;player x position

float myy ;;;player y position

float myz ;;;player z position

float timer ;;;timer to prevent recasting

short replayeffect ;;;flag to replay mist effect after casting

 

Begin ScriptEffectStart

 

set self to GetSelf

PlayMagicShaderVisuals creatureEffectWraithFaded

DisablePlayerControls

self.SetGhost 1

 

set playerdistance to 200

set chestheight to 100

set timer to 0

set replayeffect to 0

 

End

 

Begin ScriptEffectUpdate

 

;;;Prevent fall damage

ResetFallDamageTimer

 

;;;counts down after casting

if timer > 0

set timer to timer - GetSecondsPassed

endif

 

;;;Check for replaying effect

if timer <= 0 && replayeffect == 1

set replayeffect to 0

PlayMagicShaderVisuals creatureEffectWraithFaded

endif

 

;;;;;;Check which buttons are pressed and decide what to do;;;;;

;;;E = End Mist Form

if (IsKeyPressed 69) == 1

RemoveSpell 01butterfliesAb

;;;C = Cast open door spell. Timer keeps rapid casting from occuring

elseif (IsKeyPressed 67) == 1 && timer <= 0

 

set timer to 1

set replayeffect to 1

StopMagicShaderVisuals creatureEffectWraithFaded

 

set activator1 to VmpMF51Activator1exp

set activator2 to VmpMF51Activator2exp

 

activator1.enable

activator2.enable

activator1.moveto Player

activator2.moveto Player

 

set myheading to GetAngle z

 

;;;this code figures out where to put the activator (in front of the player)

If myheading < 90

Set theta to (90 - myheading)

Set ymod to (sin theta) * playerdistance

Set xmod to (cos theta) * playerdistance

Elseif myheading < 180

Set theta to (180 - myheading)

Set xmod to (sin theta) * playerdistance

Set ymod to -1 * (cos theta) * playerdistance

Elseif myheading < 270

Set theta to (270 - myheading)

Set ymod to -1 * (sin theta) * playerdistance

Set xmod to -1 * (cos theta) * playerdistance

Else

Set theta to (360 - myheading)

Set xmod to -1 * (sin theta) * playerdistance

Set ymod to (cos theta) * playerdistance

endif

 

;;;Get Player's position

set myx to (GetPos x + xmod)

set myy to (GetPos y + ymod)

set myz to (GetPos z + chestheight)

 

;;;move the activator in front of the player

activator1.SetPos x, myx

activator1.SetPos y, myy

activator1.SetPos z, myz

 

;;;change height of activator2

set castheight to (myz + 50)

activator2.SetPos z, castheight

activator2.Cast 01butterfliesPassDoor activator1

 

activator1.disable

activator2.disable

 

;;;W + Shift = walk

elseif (IsKeyPressed 87) == 1 && (IsKeyPressed 160) == 1

PlayGroup Forward 1

;;;W only = run

elseif (IsKeyPressed 87) == 1

PlayGroup FastForward 1

;;;S + Shift = walk backwards

elseif (IsKeyPressed 83) == 1 && (IsKeyPressed 160) == 1

PlayGroup Backward 1

;;;S only = run backwards

elseif (IsKeyPressed 83) == 1

PlayGroup FastBackward 1

;;;A + Shift = Left sidestep

elseif (IsKeyPressed 65) == 1 && (IsKeyPressed 160) == 1

PlayGroup Left 1

;;;D + Shift = Right sidestep

elseif (IsKeyPressed 68) == 1 && (IsKeyPressed 160) == 1

PlayGroup Right 1

;;;A only = Left sidestep fast

elseif (IsKeyPressed 65) == 1

PlayGroup FastLeft 1

;;;D only = Right sidestep fast

elseif (IsKeyPressed 68) == 1

PlayGroup FastRight 1

;;;Otherwise, must be idle

else

PlayGroup Idle 1

endif

 

End

 

 

Begin ScriptEffectFinish

 

EnablePlayerControls

self.SetGhost 0

StopMagicShaderVisuals creatureEffectWraithFaded

PlayGroup Idle 1

 

End

 

ALL THE CREDITS GO TO Zorak Ramone

 

The problem is, when i use the spell: the welkynd stone is removed, i get the main effects (feather, chameleon...) but i'm still able to draw my weapon, hit ppl, jump etc. and i can't fly, i don't even have the aspect of a faded wraith...

 

I don't understand the thing in red... about the rest i guess i can understand it (part of it at least). So to be brief, what do I need to run this script well? i mean, the side files... for the script itself is supposedly working (it works in TERRAN vampires mod...). I just changed the references to fit in my .esp. (i Duplicated and changed the IDs of the initial mod, mainly...).

 

Thank you for your time, and helps.

Blatte :).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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