SorryIWontDoThatAnymore Posted January 7, 2012 Share Posted January 7, 2012 Greets! So far, this is my first post, but that's not the thing. I am a newbie on scripting, and, I get an error: 'Script AltarofSUmmoningScript', line 18 Mismatched begin/end blocks starting on line 18.' Here is the script:scn AltarofSummoningScript short buttonshort summoned begin OnActivate if ( IsActionRef Player == 1 ) if ( Summoned < 1 ) Messagebox "What kind of creature do you wish to summon?","Xivilai","Clannfear","Spider Daedra","Done" else Message "You may only have one Familiar at a time." endifendif end begin gamemode set button to getbuttonpressedif button > -1 if button == 0 if ( Player.GetItemCount DaedraHeart >= 1 ) Playsound SPLPoisonCast XivilaiSummon.Placeatme SUmmonXivilai Player.RemoveItem DaedraHeart 1 set Summoned to 1 else Message "This requires 1 Daedra Heart." endif elseif button == 1 if ( Player.GetItemCount ClannfearClaws >= 2 ) Playsound SPLPoisonCast ClannfearSummon.Placeatme ClannfearSummon Player.RemoveItem ClannfearClaws 2 set Summoned to 1 else Message "This requires 2 Clannfear Claws." endif elseif button == 2 if ( Player.GetItemCount DaedraSilk >= 3 ) Playsound SPLPoisonCast SpiderDaedraSummon.Placeatme SummonSpiderDaedra Player.RemoveItem DaedraSilk 3 set Summoned to 1 else Message "This requires 3 Daedra Silk." endif elseif button == 3 endif endifendif I know, I copied it off the Frostcrag script, but whatever. Help, please? Link to comment Share on other sites More sharing options...
SorryIWontDoThatAnymore Posted January 7, 2012 Author Share Posted January 7, 2012 Whoop. The forums made it in one line. Yes, I did have spaces everywhere.scn AltarofSummoningScript short buttonshort summoned begin OnActivate if ( IsActionRef Player == 1 ) if ( Summoned < 1 ) Messagebox "What kind of creature do you wish to summon?","Xivilai","Clannfear","Spider Daedra","Done" else Message "You may only have one Familiar at a time." endifendif end begin gamemode set button to getbuttonpressedif button > -1 if button == 0 if ( Player.GetItemCount DaedraHeart >= 1 ) Playsound SPLPoisonCast XivilaiSummon.Placeatme SUmmonXivilai Player.RemoveItem DaedraHeart 1 set Summoned to 1 else Message "This requires 1 Daedra Heart." endif elseif button == 1 if ( Player.GetItemCount ClannfearClaws >= 2 ) Playsound SPLPoisonCast ClannfearSummon.Placeatme ClannfearSummon Player.RemoveItem ClannfearClaws 2 set Summoned to 1 else Message "This requires 2 Clannfear Claws." endif elseif button == 2 if ( Player.GetItemCount DaedraSilk >= 3 ) Playsound SPLPoisonCast SpiderDaedraSummon.Placeatme SummonSpiderDaedra Player.RemoveItem DaedraSilk 3 set Summoned to 1 else Message "This requires 3 Daedra Silk." endif elseif button == 3 endif endifendif Link to comment Share on other sites More sharing options...
David Brasher Posted January 7, 2012 Share Posted January 7, 2012 Don't write your scripts in block format. This makes it so it is hard for you to visually find your mismatched begin/end blocks. You should indent in the fashion that Bethesda used. BAD:begin OnActivate if ( IsActionRef Player == 1 ) if ( Summoned < 1 ) Messagebox "What kind of creature do you wish to summon?","Xivilai","Clannfear","Spider Daedra","Done" else Message "You may only have one Familiar at a time." endif endif end GOOD:begin OnActivate if ( IsActionRef Player == 1 ) if ( Summoned < 1 ) Messagebox "What kind of creature do you wish to summon?","Xivilai","Clannfear","Spider Daedra","Done" else Message "You may only have one Familiar at a time." endif endif end Line 18 in your script is probably:begin OnActivate You do not have this at the end of your script:End You need to use one "End" at the end of each block of scripting that uses "Begin *****" Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted January 7, 2012 Share Posted January 7, 2012 The forum software always strips away the leading blanks unless it's inside a "code" tag. The last "endif" in this script needs to be replaced by an "end", as it's now 1 "endif" too much and an "end" missing. With a later version of OBSE the syntax checking got improved, so while previously the editor let those broken scripts pass compilation (perhaps was more forgiving, ignored the bogus "endif" and added the missing "end" itself), now it won't anymore. That's why the original script is indeed broken in syntax but works. You just can't compile it anymore unless you fixed it now. Link to comment Share on other sites More sharing options...
Septfox Posted January 7, 2012 Share Posted January 7, 2012 Also, if you are, don't use the CS's script editor for writing up scripts. It's just terrible. Notepad++ features full syntax highlighting for most scripting languages: including Oblivion with the appropriate script definitions. It also marks indents, so you have a visual marker indicating how far down each IF case goes so you can make sure you get them all capped. An example snippet from one of my old scripts:http://i1192.photobucket.com/albums/aa336/septfox/screxample.png Link to comment Share on other sites More sharing options...
SorryIWontDoThatAnymore Posted January 7, 2012 Author Share Posted January 7, 2012 Well, David, actually the line 18 is 'begin gamemode'. I replaced the last 'endif' with an end. Still doesn't work. Link to comment Share on other sites More sharing options...
Septfox Posted January 7, 2012 Share Posted January 7, 2012 Actually, he was right; that last endif should be an end. You can see it if you indent the script properly. Changing that and the placeatme functions to reference the player, the script compiles without any complaints for me. scn AltarofSummoningScript short button short summoned begin OnActivate if ( IsActionRef Player == 1 ) if ( Summoned < 1 ) Messagebox "What kind of creature do you wish to summon?","Xivilai","Clannfear","Spider Daedra","Done" else Message "You may only have one Familiar at a time." endif endif end begin gamemode set button to getbuttonpressed if button > -1 if button == 0 if ( Player.GetItemCount DaedraHeart >= 1 ) Playsound SPLPoisonCast player.Placeatme SUmmonXivilai Player.RemoveItem DaedraHeart 1 set Summoned to 1 else Message "This requires 1 Daedra Heart." endif elseif button == 1 if ( Player.GetItemCount ClannfearClaws >= 2 ) Playsound SPLPoisonCast player.Placeatme ClannfearSummon Player.RemoveItem ClannfearClaws 2 set Summoned to 1 else Message "This requires 2 Clannfear Claws." endif elseif button == 2 if ( Player.GetItemCount DaedraSilk >= 3 ) Playsound SPLPoisonCast player.Placeatme SummonSpiderDaedra Player.RemoveItem DaedraSilk 3 set Summoned to 1 else Message "This requires 3 Daedra Silk." endif elseif button == 3 endif endif end Link to comment Share on other sites More sharing options...
SorryIWontDoThatAnymore Posted January 8, 2012 Author Share Posted January 8, 2012 Actually, he was right; that last endif should be an end. You can see it if you indent the script properly. Changing that and the placeatme functions to reference the player, the script compiles without any complaints for me. scn AltarofSummoningScript short button short summoned begin OnActivate if ( IsActionRef Player == 1 ) if ( Summoned < 1 ) Messagebox "What kind of creature do you wish to summon?","Xivilai","Clannfear","Spider Daedra","Done" else Message "You may only have one Familiar at a time." endif endif end begin gamemode set button to getbuttonpressed if button > -1 if button == 0 if ( Player.GetItemCount DaedraHeart >= 1 ) Playsound SPLPoisonCast player.Placeatme SUmmonXivilai Player.RemoveItem DaedraHeart 1 set Summoned to 1 else Message "This requires 1 Daedra Heart." endif elseif button == 1 if ( Player.GetItemCount ClannfearClaws >= 2 ) Playsound SPLPoisonCast player.Placeatme ClannfearSummon Player.RemoveItem ClannfearClaws 2 set Summoned to 1 else Message "This requires 2 Clannfear Claws." endif elseif button == 2 if ( Player.GetItemCount DaedraSilk >= 3 ) Playsound SPLPoisonCast player.Placeatme SummonSpiderDaedra Player.RemoveItem DaedraSilk 3 set Summoned to 1 else Message "This requires 3 Daedra Silk." endif elseif button == 3 endif endif end FInally. Thanks, thanks, thanks! Link to comment Share on other sites More sharing options...
Recommended Posts