Jump to content

The game does not work after compilation if I use this script


Recommended Posts

Posted
local file1 = io.open(self.text_en, "r")
	for line in file1:lines() do
		table.insert (self.monolog_en, line);
	end
	file1:close()

During the test, everything works as it should, but after compilation, the map simply does not open and the game closes without any errors. Why is this happening, does anyone know?

Posted
1 minute ago, Josh said:

Вы должны отключить Lua sandboxing из C ++, чтобы использовать команды ввода-вывода Lua.

 

image.png.386798e227282ae647b0af59c191f375.png

It's disabled

Posted
4 minutes ago, Josh said:

You must disable Lua sandboxing, from C++, in order to use the Lua IO commands.

Maybe there is some kind of analog, how to do the same thing, but without Lua IO?

Posted

You can disable sandboxing by creating a shortcut to the game executable with "+sandbox 0" added to the command line.

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted
11 minutes ago, Josh said:

No, the Lua sandboxing makes it so Lua cannot read or write files.

Hmm, it's strange, but then why does the script of notes in the style of Amnesia work without problems?

Posted

There's also the issue that if the files you are loading are packaged in an encrypted zip file, the engine won't be able to read the files. File reading is not supported because it would break the protection. You would need to keep those files in the game's folder, not in a zip file.

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted
22 minutes ago, Josh said:

There's also the issue that if the files you are loading are packaged in an encrypted zip file, the engine won't be able to read the files. File reading is not supported because it would break the protection. You would need to keep those files in the game's folder, not in a zip file.

What should I do if I just want to read the files and not change them?

Posted

Place a copy of those files in the game's folder, or whatever subfolder they are supposed to be in.

My job is to make tools you love, with the features you want, and performance you can't live without.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...