» Tue Feb 01, 2011 10:19 am
Well, the scripts seem to be working fine in game despite the errors in the CS. (they're not my scripts by the way, their from the mod spell deflection) could someone with scripting experience tell me how to fix them anyway? (for my own personal use) the CS identifies problems with lines 95, 167, 175, and 180. saying something like "invalid block" or "invalid begin end." All i really want to do is change the alpha transparency controller keys to 74 and 78, and the alpha transparency to 1.0 instead of 0.5. i'm unable to do that though because of these four lines. thanks again for the help and the responses, i really do appreciate it.
scn SpellDeflectionCollisionMeshQuestScript
short isBlocking
short isCasting
short castTimer
short startBlocking
short success
short startMod
short keyPlusDown
short keyMinusDown
int framesPassed ;used to create a time gap between enabling and disabling references while moving them so that collision models are moved correctly
int framesPassed2
int blockKey
int castKey
int blockSkill
float chanceOfSuccess ;tied to blockSkill
float alphaValue
ref spellDetector0
ref spellDetector1
ref spellDetector2
ref spellDetector3
float fQuestDelayTime
Begin GameMode
Set fQuestDelayTime to 0.005
;PENALTIES
Set blockSkill to Player.GetActorValue Block
Set chanceOfSuccess to blockSkill * 0.90 + ( 100 - blockSkill ) / 2 ;Sets the cap of blocking to 90% success chance, a block skill of 50 has a 45% chance
if chanceOfSuccess > GetRandomPercent
Set success to 1
else
Set success to 0
endif
;END PENALTIES
;ALPHA CONTROLLER
if startMod == 0
Set alphaValue to 0.5
Set startMod to 1
endif
if isKeyPressed2 13
Set keyPlusDown to 1
Set alphaValue to ( alphaValue + 0.01 )
elseif keyPlusDown == 1 && isKeyPressed2 13 == 0
MessageBox "You have increased your deflection alpha to %.2f", alphaValue
Set keyPlusDown to 0
endif
if isKeyPressed2 12
Set keyMinusDown to 1
Set alphaValue to ( alphaValue - 0.01 )
elseif keyMinusDown == 1 && isKeyPressed2 12 == 0
MessageBox "You have decreased your deflection alpha to %.2f", alphaValue
Set keyMinusDown to 0
endif
if alphaValue > 1.0
Set alphaValue to 1.0
elseif alphaValue < 0
Set alphaValue to 0.0
endif
;END ALPHA CONTROLLER
if Player.IsShieldOut == 1 ;check if player is blocking
Set blockKey to GetControl 6
if ( IsKeyPressed2 blockKey ) || ( IsKeyPressed2 257 )
Set isBlocking to 1
Player.SetActorAlpha alphaValue
else
Set isBlocking to 0
Player.SetActorAlpha 1.0
endif
endif
Set castKey to GetControl 7
if ( IsKeyPressed2 castKey ) ;check if player is casting
Set isCasting to 1
Set castTimer to 0
endif
if isCasting && castTimer < 15 ;if casting, prevent effect from working
Set castTimer to castTimer + 1
elseif isCasting && castTimer > 14
Set castTimer to 0
Set isCasting to 0
endif
elseif isBlocking && SpellDeflectionEffectQuest.stage == 0 && isCasting == 0 && success
if startBlocking == 0
Set spellDetector0 to SpellDeflectionCollisionMesh01
spellDetector0.MoveTo Player
Set spellDetector1 to SpellDeflectionCollisionMesh02
spellDetector1.MoveTo Player
Set spellDetector2 to SpellDeflectionCollisionMesh03
spellDetector2.MoveTo Player
Set spellDetector3 to SpellDeflectionCollisionMesh04
spellDetector3.MoveTo Player
Set startBlocking to 1
Set framesPassed to 0
Set framesPassed2 to 1
else
if framesPassed < 2
if spellDetector1.GetDisabled == 1
spellDetector1.Enable
endif
if spellDetector0.GetDisabled == 0
spellDetector0.Disable ;disable then position correctly to ensure collision mesh moves
Set SpellDeflectionCollisionMeshMovementQuest.collisionMeshRef to spellDetector0
Set SpellDeflectionCollisionMeshMovementQuest.stage to 1
endif
Set framesPassed to ( framesPassed + 1 )
elseif framesPassed < 4
if spellDetector0.GetDisabled == 1
spellDetector0.Enable
endif
if spellDetector1.GetDisabled == 0
spellDetector1.Disable
Set SpellDeflectionCollisionMeshMovementQuest.collisionMeshRef to spellDetector1
Set SpellDeflectionCollisionMeshMovementQuest.stage to 1
endif
Set framesPassed to ( framesPassed + 1 )
else
Set framesPassed to 0
endif
if framesPassed2 < 2
if spellDetector3.GetDisabled == 1
spellDetector3.Enable
endif
if spellDetector2.GetDisabled == 0
spellDetector2.Disable ;disable then position correctly to ensure collision mesh moves
Set SpellDeflectionCollisionMeshMovementQuest.collisionMeshRef to spellDetector2
Set SpellDeflectionCollisionMeshMovementQuest.stage to 1
endif
Set framesPassed2 to ( framesPassed2 + 1 )
elseif framesPassed2 < 4
if spellDetector2.GetDisabled == 1
spellDetector2.Enable
endif
if spellDetector3.GetDisabled == 0
spellDetector3.Disable
Set SpellDeflectionCollisionMeshMovementQuest.collisionMeshRef to spellDetector3
Set SpellDeflectionCollisionMeshMovementQuest.stage to 1
endif
Set framesPassed2 to ( framesPassed2 + 1 )
else
Set framesPassed2 to 0
endif
endif
elseif isBlocking == 0
if startblocking == 1
Set startBlocking to 0
endif
spellDetector0.Disable
spellDetector1.Disable
spellDetector2.Disable
spellDetector3.Disable
else
spellDetector0.Disable
spellDetector1.Disable
spellDetector2.Disable
spellDetector3.Disable
endif
End