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
27 days ago
0.17 - 2.0
5.26K
Cheats

g creative mod compatibility

a month ago

hello there, maybe I'm plain stupid and not using the software properly.
anyway, I'm trying to execute "game.player.remote.call("creative-mode", "enable")" to enable the creative mod in an existing save.
do I need to specify the player I'm trying to activate it for?
is it even possible to use "Someone's LUA-Console" like that?

a month ago
(updated a month ago)

I THINK it would be remote.call("creative-mode", "enable").

If its not, I can look into it tomorrow when I get to run factorio. :)
Can you link me the specific mod that has this interface?

a month ago

this is the error I'm getting while running "remote.call("creative-mode", "enable")":
"Error when running interface function creative-mode.enable: creative-mod/scripts/cheats.lua:2344: attempt to index local 'source _ player' (a nil value)"

this is the mod:
https://mods.factorio.com/mod/creative-mod

thanks for checking <3 would love to see this work together

a month ago
(updated a month ago)

that mod is far tooo complex to quickly check it out.

I will investitage it further but for now it doesnt work^^

a month ago

got it. thanks for taking some time to check. =)

a month ago

Looks bad. I think I looked into that already a few years ago.

The issue is, i cant set game.player, since its a read only variable, so if the remote procedure that gets called uses game.player, it will be nil and crash.
You are interacting with the game as if you were the server and not a player thru my mod.

I dont think this can be fixed, since I cannot setup a player lua context from within the mod.

a month ago

Is it possible to send a variable (ie player name) so it can be assigned to a certain player? like calling the command in the name of $specified.player
similar to how you'd define an admin on a headless factorio server.
I know it's a bit hacky and accepted my fate. at this point I'm just curious ^^

a month ago
(updated a month ago)

I tried this: basically create a custom variable "game" and inject game.player into it. But it doesnt work.
Actually I think its a good thing that mods cant influence other mods on that level, but maybe im overseeing something trivial.

To your last question: sure, you can add any parameters in the call so you can transport more info to the other mods.

local _ame = game
local game = {}
game["player"] = _ame.players[1]
game["players"] = _ame.players
-- correctly prints someone1337
_ame.print(game["player"].name)
-- same as: game.player.name - but my mod fucks with the string "game.player"
-- still fails:
remote.call("creative-mode", "enable", game)

I cant come up with a way to inject a player-context into the remote call.

One idea i still have is to try monkey patching the other mods... But i dont understand the require/include mechanics of factorio good enought, but maybe im bored at some time and will look into it.

New response