Difference between revisions of "Category talk:Scripting"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Simetrical
m (Bah)
imported>Simetrical
m (Misplaced parenthesis)
Line 33: Line 33:
  else
  else
     effect
     effect
:Note the presence of the condition for both <tt>if</tt> and <tt>elseif</tt>; this is mandatory, and if it's omitted and still compiles, that's a compiler bug.  (By the way, use four tildes to sign: <nowiki>~~~~</nowiki>. &mdash;[[User:Simetrical|Simetrical]] ([[User_talk:Simetrical|talk]]&nbsp;&bull;&nbsp;[[Special:Contributions/Simetrical|contribs]]) 21:13, 4 April 2006 (EDT))
:Note the presence of the condition for both <tt>if</tt> and <tt>elseif</tt>; this is mandatory, and if it's omitted and still compiles, that's a compiler bug.  (By the way, use four tildes to sign: <nowiki>~~~~</nowiki>.) &mdash;[[User:Simetrical|Simetrical]] ([[User_talk:Simetrical|talk]]&nbsp;&bull;&nbsp;[[Special:Contributions/Simetrical|contribs]]) 21:13, 4 April 2006 (EDT)

Revision as of 20:15, 4 April 2006

Line number limit

Is there a limit to the number of lines a script can contain? I'm currently editing a script with about 52 lines (including debug code to later be stripped), and the CS refuses to save changes beyond a certain point. If I click on the save button, and then try to edit the script editor, I get the "do you want to save this script" message; if I say "yes", it just returns me to the editor. If I say "no", it closes the editor but the changes are not saved.

It _appears_ that if I put any function below line 39, it causes a problem (endifs and ENDS are fine). Perhaps I'm just doing something wrong? Eallman 16:20, 4 April 2006 (EDT)

Later: obviously not the case, since I just found a Beth script with about 150 lines.

Well, very strange. Apparently the problem was that I was passing an elseif without a specific parameter:

if var==1
   somecode here

      else if
         someothercode here

This SHOULD be a legal structure, and the compiler didn't seem to dislike it. BUt as soon as I changed it to

if var==1
....
  elseif var!=1


my saveprob disappeared. Now to debug the script itself, instead of the CS <G> Eallman 16:44, 4 April 2006 (EDT)


That's because else if implies some other condition. Try else instead of else if.--Tegid 12:51, 4 April 2006 (EDT)

if and elseif (or else if, whichever Oblivion uses) require conditions:
if (condition)
    effect
elseif (condition)
    effect
else
    effect
Note the presence of the condition for both if and elseif; this is mandatory, and if it's omitted and still compiles, that's a compiler bug. (By the way, use four tildes to sign: ~~~~.) —Simetrical (talk • contribs) 21:13, 4 April 2006 (EDT)