简体   繁体   English

Love2d-尝试索引字段“文件系统”(nil值)

[英]Love2d- attempt to index field 'filesystem' (a nil value)

Whenever I try to open my program I get the error. 每当我尝试打开程序时,都会出现错误。 Attempt to index field 'filesystem' (a nil value) does anyone know what could be causing this problem? 尝试索引字段“文件系统”(nil值),有人知道导致此问题的原因吗? help would be appreciated. 帮助将不胜感激。

Love2d has no global filesystem object that I'm aware of. Love2d没有我知道的全局filesystem对象。 You want love.filesystem . 您需要love.filesystem

Make sure you're not excluding the module from the conf.lua file. 确保您没有从conf.lua文件中排除该模块。 If you are, either enable the module or use include "love.filesystem" 如果是这样,请启用该模块或使用include "love.filesystem"

Make sure you use love.filesystem, love2d doesn't define a filesystem value. 确保使用love.filesystem,love2d没有定义filesystem值。

Make sure that you're not excluding any related modules from conf.lua. 确保您没有从conf.lua中排除任何相关模块。 I had the same problem with love.audio. 我对love.audio也有同样的问题。 It turned out that I was excluding love.sound in conf.lua! 原来我在conf.lua中排除了love.sound! ¬_¬ Caused me no end of headache. ¬_¬使我头疼不已。

Derp! 德普

EDIT: Also, check that you're not using incorrect syntax from an outdated version of Love2D. 编辑:此外,请检查您是否从过时的Love2D版本中使用了不正确的语法。 That can be checked here . 可以在这里检查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM