Unable to pick up a book in a mod

Post » Sat Mar 01, 2014 3:40 am

There are two books in Uvirith's Legacy that teach the player a spell upon activation, after which they act like a normal book (to my recollection at least). As in, they can be picked up, moved, etc.

For some reason, I'm having problems with one of these books not being able to be moved in Uvirith's Legacy. The "take" button is there, but when I hit it the book closes and the game forces a pause (as if in menu mode) and does not return to normal until I right click.

The script is as follows:

Begin gp_wraithTouch;Queen N'tashra quest reward;gives spell to player the first time the book Wraith Touch is readShort doOnce; Beginning of Book Rotate Script;Credits;Idea and some scripting taken from Heph's book mod;;Invaluable help from GhanBuiGhan's 'Morrowind Scripting for Dummies';;Delete timer scripting by Solaris and Riiak Shi Nal;global gbl_xyGridfloat xyGridfloat xDeltafloat yDeltafloat zDeltaSet zDelta to 14Set xyGrid to gbl_xyGridshort LastPos ;LastPos = 0 is normal, LastPos = 1 is vertical, LastPos = 2 is horizontal.short OnPCDropfloat bZposfloat playerZanglefloat Timerfloat TMaxfloat zDestfloat xDestfloat yDestfloat Resultfloat xAnglefloat yAnglefloat zAnglefloat x_Sinfloat yCoslong Integerif ( OnPCDrop != 1 )	if ( TMax < 5 )		Set TMax to Random 50		Set TMax to ( TMax / 10 ) + 5	endif	if ( CellChanged == 1 )		Set Timer to TMax + 1	endif	if ( bZpos != ( GetPos, Z ) )		Set Timer to TMax + 1	endif	if ( LastPos > 0 )		set Timer to Timer + GetSecondsPassed		if ( Timer > 5 )			if ( LastPos >= 1 )				SetPos X, xDest				SetPos Y, yDest				SetPos Z, zDest				SetAngle Z, zAngle				SetAngle X, xAngle				SetAngle Y, yAngle			endif			set bZpos to ( GetPos, Z )			set Timer to 0		endif	endif	;BEGIN original Book Script:If ( OnActivate )	If ( doOnce == 0 )		Player->AddSpell "gp_straelhcaeghs wraithtouch"		Say "Cr\clannf\moan.wav" "clannfear moan"		MessageBox "Straelhcaegh's Wraithtouch has been added to your Spellbook."		MessageBox "Acrid smells linger on the edges of the page, not unlike the scent of burning meat."		Set doOnce To 1	EndIf	ActivateEndif	;END original Book script.	returnendifset OnPCDrop to 0if ( LastPos == 2 )	set LastPos to 0	returnendifset playerZangle to ( "player"->GetAngle Z )set LastPos to ( LastPos + 1 )While ( playerZangle < 0 )	set playerZangle to playerZangle + 360endWhileWhile ( playerZangle > 360)	set playerZangle to playerZangle - 360endWhile;1 N  337.5 - 22.5;2 NE 22.5  - 67.5;3 E  67.5  - 112.5;4 SE 112.5 - 157.5;5 S  157.5 - 202.5;6 SW 202.5 - 247.5;7 W  247.5 - 292.5;8 NW 292.5 - 337.5if ( playerZangle > 337.5 )	SetAngle Z 270	Set x_Sin to 1	Set yCos to 0endifif ( playerZangle <= 22.5 )	SetAngle Z 270	Set x_Sin to 1	Set yCos to 0endifif ( playerZangle > 22.5 )	if ( playerZangle <= 67.5 )		SetAngle Z 315		Set x_Sin to -0.707107		Set yCos to 0.707107		Set xyGrid to xyGrid * 0.707107	endifendifif ( playerZangle > 67.5 )	if ( playerZangle <= 112.5 )		SetAngle Z 0		Set x_Sin to 0		Set yCos to 1	endifendifif ( playerZangle > 112.5 )	if ( playerZangle <= 157.5 )		SetAngle Z 45		Set x_Sin to 0.707107		Set yCos to 0.707107		Set xyGrid to xyGrid * 0.707107	endifendifif ( playerZangle > 157.5 )	if ( playerZangle <= 202.5 )		SetAngle Z 90		Set x_Sin to 1		Set yCos to 0	endifendifif ( playerZangle > 202.5 )	if ( playerZangle <= 247.5 )		SetAngle Z 135		Set x_Sin to -0.707107		Set yCos to 0.707107		Set xyGrid to xyGrid * 0.707107	endifendifif ( playerZangle > 247.5 )	if ( playerZangle <= 292.5 )		SetAngle Z 180		Set x_Sin to 0		Set yCos to 1	endifendifif ( playerZangle > 292.5 )	if ( playerZangle <= 337.5 )		SetAngle Z 225		Set x_Sin to 0.707107		Set yCos to 0.707107		Set xyGrid to xyGrid * 0.707107	endifendifif ( LastPos >= 1 )	if ( LastPos == 1 )		Set zDest to ( GetPos, Z ) + zDelta	else		Set zDest to ( GetPos, Z ) + 0.01	endif	Set xDest to ( GetPos, X )	Set yDest to ( GetPos, Y )	Set Result to xDest / xyGrid	Set Integer to Result	if ( Result < 0 )		Set Integer to ( Integer - 1 )	endif		Set xDest to Integer * xyGrid	Set xDest to xDest + ( ( xyGrid / 2 ) * x_Sin )	Set Result to yDest / xyGrid	Set Integer to Result	if ( Result < 0 )		Set Integer to ( Integer - 1 )	endif		Set yDest to Integer * xyGrid	Set yDest to yDest + ( ( xyGrid / 2 ) * yCos )	SetPos Z, zDest	SetPos X, xDest	SetPos Y, yDest	if ( LastPos == 1 )		SetAngle X, 270	endif	Set bZpos to ( GetPos, Z )	set xAngle to ( GetAngle, X )	set yAngle to ( GetAngle, Y )	set zAngle to ( GetAngle, Z )endifEnd
User avatar
trisha punch
 
Posts: 3410
Joined: Thu Jul 13, 2006 5:38 am

Post » Sat Mar 01, 2014 12:00 pm

While ( playerZangle > 360)
I can see a missing space before right bracket here. No more ideas, sorry
User avatar
Eibe Novy
 
Posts: 3510
Joined: Fri Apr 27, 2007 1:32 am


Return to III - Morrowind