Difference between revisions of "Minimizing your Script"

479 bytes added ,  07:43, 10 August 2009
de-emphasized importance of technique
imported>DragoonWraith
m (Reverted edits by KyleWollaston (Talk); changed back to last version by Halo112358)
imported>Sabar
(de-emphasized importance of technique)
Line 1: Line 1:
The following is only important when a script does a CPU intensive task that is known or has been tested to affect the frame rate.  This is generally reduced to situations that involve naive searching, sorting, or constant iteration through many references.  Code that must have inefficient algorithms can best take advantage of the techniques here.  Note that almost all code produced with the vanilla editor will already run well, regardless of programming technique.
== Gamemode Scripts ==
== Gamemode Scripts ==
Avoid using gamemode scripts wherever possible. Use quest scripts if you can, or try to find ways to put as much of the script work into OnLoad, OnEquip, and ScriptEffectStart blocks as possible.
Avoid using gamemode scripts wherever possible. Use quest scripts if you can, or try to find ways to put as much of the script work into OnLoad, OnEquip, and ScriptEffectStart blocks as possible.
Line 28: Line 30:
begin GameMode
begin GameMode
   if (some condition)
   if (some condition)
     (some extremely long code block)
     (some inefficient/complex algorithm)
   endif
   endif
end</pre>
end</pre>
Line 41: Line 43:
   endif
   endif


   (some extremely long code block)
   (some inefficient/complex algorithm)
end</pre>
end</pre>


Anonymous user