Boric123 Posted August 24, 2016 Share Posted August 24, 2016 So I've identified a segment within my script that is giving me an error ((200,0): mismatched input 'EndEvent' expecting ENDIF). Been sitting here for a while now trying different things out, but nothing is working. Any help would be more than welcome, thanks! Here's the script segment; Event OnOptionMenuAccept(int option, int index) If (option == iCurtains) IndexCurtains = index SetMenuOptionValue(iCurtains, CurtainsList[IndexCurtains]) If IndexCurtains == 0; Red Curtains DisCurtains() B123_CurtainsRed.enable() ShowMessage("Curtains Changed", false, "Understood") ElseIf IndexCurtains == 1; Cream Yellow Curtains DisCurtains() B123_CurtainsCreamYellow.enable() ShowMessage("Curtains Changed", false, "Understood") ElseIf IndexCurtains == 2; Green Curtains DisCurtains() B123_CurtainsGreen.enable() ShowMessage("Curtains Changed", false, "Understood") ElseIf IndexCurtains == 3; Pink Curtains DisCurtains() B123_CurtainsPink.enable() ShowMessage("Curtains Changed", false, "Understood") ElseIf IndexCurtains == 4; Purple Curtains DisCurtains() B123_CurtainsPurple.enable() ShowMessage("Curtains Changed", false, "Understood") ElseIf IndexCurtains == 5; Rugged Curtains DisCurtains() B123_CurtainsRugged.enable() ShowMessage("Curtains Changed", false, "Understood") ElseIf IndexCurtains == 6; White Curtains DisCurtains() B123_CurtainsWhite.enable() ShowMessage("Curtains Changed", false, "Understood") ElseIf IndexCurtains == 7; Yellow Curtains DisCurtains() B123_CurtainsYellow.enable() ShowMessage("Curtains Changed", false, "Understood") If (option == iShields) IndexShields = index SetMenuOptionValue(iShields, ShieldsList[IndexShields]) If IndexShields == 0; Redanian Shield DisShields() B123_ShieldRedania.enable() ShowMessage("Shield Changed", false, "Understood") ElseIf IndexShields == 1; Temerian Shield DisShields() B123_ShieldTemeria.enable() ShowMessage("Shield Changed", false, "Understood") ElseIf IndexShields == 2; Order of the Flaming Rose DisShields() B123_ShieldOrde.enable() ShowMessage("Shield Changed", false, "Understood") EndIf EndIf EndEvent Link to comment Share on other sites More sharing options...
TheMastersSon Posted August 24, 2016 Share Posted August 24, 2016 Unless I missed other parts of this script, you have a total of four IFs but only two ENDIFs. The error message isn't lying to you. :) Link to comment Share on other sites More sharing options...
Boric123 Posted August 24, 2016 Author Share Posted August 24, 2016 Thanks for the reply :) Yeah, I knew I was doing something wrong but wasn't sure what, since this is only my second or third real attempt at scripting. Does it matter where I place the ENBIFs? Would it be okay just to place them at the end of the script segment? Or one after each IF? Link to comment Share on other sites More sharing options...
TheMastersSon Posted August 24, 2016 Share Posted August 24, 2016 It does matter, and I usually leave it up to modders to figure out their logic. Tough love imo. :) Indent the script properly and it should become evident where the ENDIFs are missing. Use just a single tab character for each IF section instead of the major indents in your existing script. Just from a glance I'd first look at your two initial IF statements, according to the menu option being selected. Link to comment Share on other sites More sharing options...
Boric123 Posted August 24, 2016 Author Share Posted August 24, 2016 Okay, thank you for the advice :) I'll give this a try when I have some free time. I didn't really think indenting the script would be that important. Link to comment Share on other sites More sharing options...
TheMastersSon Posted August 24, 2016 Share Posted August 24, 2016 (edited) It's an effortless way to make sure every IF has an ENDIF, and locate proper position of the statements. Check out any of Bethesda's vanilla scripts for examples, they're handy in general for learning scripting. Edited August 24, 2016 by TheMastersSon Link to comment Share on other sites More sharing options...
Boric123 Posted August 24, 2016 Author Share Posted August 24, 2016 Will do! Thank you :) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now