[aquaria] Updating 3rd-party mods to the lua-changes branch syntax

Henrique de Moraes Holschuh hmh+aquaria at hmh.eng.br
Sat Feb 12 10:20:27 EST 2011


On Tue, 18 Jan 2011 19:51 +0000, "Andrew Church" <achurch+aquaria at achurch.org> wrote:
> >Is there consolidated documentation anywhere on the changes required on the
> >lua scripts to run with your devel branch?
> 
> All the information you'll need should be in Aquaria/ScriptInterface.cpp,
> but the short version is:
> 
> - Add a line saying "v = getVars()" at the top of _every_ script.
> 
> - Prefix _every_ global variable reference with "v.".  (It's also okay to
>   declare variables local if they're only used within a single block.
>   The important thing is to not use global variables.)
> 
> - Declare _every_ non-interface function as local.  (Interface functions
>   are init(), update(), etc.; see interfaceFunctions[] for a full list.)
> 
> - _Never_ make function calls (math.random(), etc.) at file scope.  Since
>   Lua tables are actually references, this also means you can't declare
>   tables at file scope -- initialize them to nil and assign a table value
>   in init() instead.

Thank you.  I apologise for not replying right back.

I will try to fix some of the mods.  If I am successful, I will send in
the patches.   Aquaria seems to be doing a lot of hand-holding by itself
already if these mods with incorrect case on filenames, and the whole
\ versus / deal in path separators are even able to almost load...

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh



More information about the aquaria mailing list