disable warnings/force save in CS

Post » Tue Feb 01, 2011 3:48 pm

I'm editing the scripts to a mod I've installed: http://www.tesnexus.com/downloads/file.php?id=11477. so that my character no longer becomes transparent. for whatever reason the + key doesn't work to increase transparency. However, I cannot save any changes I make in the CS without getting some kind of error. for example "begin end block on line 95..." i load the construction set via obse and I still get these problems. I was wondering if there is another program to edit scripts, or if there's a way to force a save on a script even if it's incorrect. Thanks for the help.
User avatar
Sebrina Johnstone
 
Posts: 3456
Joined: Sat Jun 24, 2006 12:58 pm

Post » Wed Feb 02, 2011 2:04 am

It's only a guess, but if the CS is working and you can edit your mod/script, then everything should be fine as long as you're coding it correctly. I have no experience with obse and have always used just the CS by itself. Maybe there's a conflict? I'm not sure. Hopefully someone else can help :)
User avatar
Bereket Fekadu
 
Posts: 3421
Joined: Thu Jul 12, 2007 10:41 pm

Post » Tue Feb 01, 2011 9:59 pm

Copy your script to notepad, then look at that to find if there's something wrong. If CS warns about syntax error, there's really error on your script, usually.
User avatar
naomi
 
Posts: 3400
Joined: Tue Jul 11, 2006 2:58 pm

Post » Tue Feb 01, 2011 3:31 pm

You probably don't have an "End" somewhere in your script.

You can't just ignore the warnings, because the script won't work if you don't fix them.
User avatar
Samantha hulme
 
Posts: 3373
Joined: Wed Jun 21, 2006 4:22 pm

Post » 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
User avatar
Amiee Kent
 
Posts: 3447
Joined: Thu Jun 15, 2006 2:25 pm

Post » Tue Feb 01, 2011 6:23 pm

Line 95: 'elseif' without previous 'if'? When I paste it to NotePad++, then adding tabs, I found it's like this:
line 71~96:
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	endifendifSet castKey to GetControl 7if ( IsKeyPressed2 castKey ) ;check if player is casting	Set isCasting to 1	Set castTimer to 0endifif isCasting && castTimer < 15 ;if casting, prevent effect from working	Set castTimer to castTimer + 1elseif isCasting && castTimer > 14	Set castTimer to 0	Set isCasting to 0endifelseif isBlocking && SpellDeflectionEffectQuest.stage == 0 && isCasting == 0 && successif startBlocking == 0-snip-

Can you see what is wrong?
User avatar
Janette Segura
 
Posts: 3512
Joined: Wed Aug 22, 2007 12:36 am


Return to IV - Oblivion