1) Only 10 levels deep!
if iHateYou if NoYouDoNot if ThirdLevel endif endifendif
Ten levels is the max (actually 9 is, it won't let you do 10)
2) Watch for variables in If/ElseIf lists.
set A to 0 if A == 0 set A to 1 elseif A == 1 set A == 2 elseif A == 2 set A == 3 elseif A == 3 set A to 4 endif MessageBoxEx "%g" A
After one frame A will be 4. The best way to avoid that is to make sure the A variable gets set so that it doesn't see the next ElseIf and match. The way Oblivion reads the If/ElseIf nests is once the section is done, it checks the other ElseIf's to see if any of them apply. It's handy, but when you don't know it does that, it can be a PAIN. With the updates I was doing to a mod, I had to reverse the "A" variable so the highest number was checked first, then work my way backwards. This way, the "A" variable never got to the next section in the same frame (because that would often CTD the game or worse, Microsoft Visual C++ error).
Of course I found this all out the hard way.
GuruSR.
I found out the hard way about return. It doesn't just kill the block of code its in, it kills the entire contents of the script after that. I couldn't even get a test message to display one night and was going crazy!
2.) I thought elseif didn't run unless the first IF wasn't true. So if A was 0 and it was set to 1, then why would elseifA == 1 get processed?
Ok big mod update: I got all the powers switched over to a non cast animation hokey. After the player no longer cast to activate the power, I felt it was a little lacking. So I made some custom sounds to go along with activating, deactivating, and messages to make sure you know the power is off, since active powers increase your cravings for blood faster.
I think this video came out pretty cool. Its a little hard to hear my sound effects, for some reason fraps records the music really loud, even though in my game it doesn't seem that loud in comparison to sounds.
http://downloads.4drulers.com/Oblivion_Mods/unholydarkness/Unholy%20Darkness%20vampire%20power%20hotkeys.wmv