Someone's LUA-Console


Run lua commands without losing achievements. Now remembers input-script. "game.player" works. By default opens with CONTROL + RIGHTBRACKET. Execute last input-script with CONTROL + ENTER.

Utilities
3 months ago
0.17 - 1.1
2.98K
Cheats

g 'remote.call' fails/errors

3 years ago

I'm trying to enable Creative Mod temporarily without disabling achievements with
remote.call("creative-mode","enable")

However the LUA-Console doesn't pass 'source_player' so the command fails
"Error when running interface function creative-mode.enable: creative-mod/scripts/cheats.lua:2432: attempt to index local 'source_player' (a nil value)

The command works fine from the default Factorio Lua Console.
Any chance you can pass the current player for remote.call's?

3 years ago

This seems impossible to fix, as game.player is a ro only field so I cannot create it if it doesnt exist and the other way would be the ability to rewrite functions on the fly using some kind of reflection which lua doesnt seem to offer. (lua sucks, sorry)

3 years ago

It's a bug in Creative Mod!

The remote interface is expecting to be called from the console and doesn't work when called from another mod. Which is obviously wrong, since remote calls are for inter-mod calls. The correct way for Creative Mod to make commands that enable it would be to register a command handler, like Eradicator's /sudo mod does for example. That way you wouldn't disable achievements either and would not even have to use an alternative console mod to run the command.

So go report the bug to Creative Mod!

New response