Jump to content

MCM scripting help


Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...