Task #609

Test all Lua scripts with Lua 5.3 before next release

Added by IR4T4 almost 5 years ago. Updated about 3 years ago.

Status:New% Done:

10%

Priority:Normal
Assignee:-
Category:Lua scripts
Target version:ET: Legacy Development - ALL

Description

I’ve noticed some scripts in our repository don’t work properly with Lua 5.2 (see dynamite.lua f.e.) when tables are used.

Associated revisions

Revision 7baf2e4d
Added by Radegast almost 5 years ago

dynatimer: quick and dirty fix for lua 5.2.3, refs #609

Revision 3dcf3eb8
Added by Spyhawk about 3 years ago

fixed attempt to index a number value error

History

#1 Updated by RaFaL almost 5 years ago

Legacyconst.lua loads corectly

Dynamite.lua
Lua API: et_InitGame error running lua script: [string "dyna.lua"]:100: bad argument #2 to 'insert’ (position out of bounds)
Lua API: et_RunFrame error running lua script: [string "dyna.lua"]:139: attempt to call field 'foreach’ (a nil value)

Xpsave.lua closing server without an error

#2 Updated by Spyhawk almost 5 years ago

See also changes done in issue #289.

#3 Updated by Radegast almost 5 years ago

RaFaL wrote:

Dynamite.lua
Lua API: et_InitGame error running lua script: [string "dyna.lua"]:100: bad argument #2 to 'insert’ (position out of bounds)
Lua API: et_RunFrame error running lua script: [string "dyna.lua"]:139: attempt to call field 'foreach’ (a nil value)

table.insert(client_msg, i, false) - i starts at 0 which is out of bounds since lua 5.2.2. We just have to adapt the code to count sv_maxclients at 1. Easy fix.

Xpsave.lua closing server without an error

Strange. You most likely don’t have sqlite module installed.

#4 Updated by RaFaL almost 5 years ago

I got sqlite module installed just downloaded a new one and this

Lua API: G_LuaStartVM error running lua script: error loading module 'luasql.sqlite3’ from file 'E:\etlegacy\legacy\lualibs\luasql\sqlite3.dll’:
Nie można odnaleźć określonej procedury.

#5 Updated by Radegast almost 5 years ago

  • % Done changed from 0 to 10

dynatimer now works with the bundled lua

#6 Updated by Spyhawk about 3 years ago

  • Subject changed from Test all Lua scripts with Lua 5.2 before next release to Test all Lua scripts with Lua 5.3 before next release

xpsave.lua gives this error at server shotdown:

Lua API: et_ShutdownGame error running lua script: [string "xpsave.lua"]:159: attempt to index a number value (upvalue 'cur’)

and

Lua API: et_ShutdownGame error running lua script: [string "xpsave.lua"]:160: LuaSQL: there are open cursors

Also available in: Atom PDF