Surviving Mars

Surviving Mars

Not enough ratings
Lua Console
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
277.271 KB
19 Mar, 2018 @ 6:35am
8 Apr, 2018 @ 5:03am
10 Change Notes ( view )

Subscribe to download
Lua Console

Description
Adds a Lua console to the game that lets you run lua code.

Evaluate, trace, or watch lua expressions. Write your own helper functions and put them in your scratch pad. Reload your mod code directly inside the game, we'll even do a syntax check for you first!

Additional options are available if Waywocket's Mod Config mod is installed, including window transparency and a bundled monospace font (Inconsolata Regular).

Github page: https://github.com/thatfool/SMars-Lua-Console
18 Comments
akarnokd 12 Aug, 2018 @ 9:42am 
Hi, could you update this mod to support the Da Vinci patch of the game?
SkiRich 21 Apr, 2018 @ 2:11am 
Is there a how to or help/example faq included to show how to use the console?
akarnokd 8 Apr, 2018 @ 5:30am 
Thanks, the history is working. I was trying to call UICity:OutsourceResearch but apparently with the wrong arguments - my mistake.
special_snowcat  [author] 8 Apr, 2018 @ 5:08am 
@akamokd I fixed the history. Could you give an example of a command that doesn't print a result? Note that statements don't have results in lua so e.g. "a=3" will show no result, and that's normal.
akarnokd 6 Apr, 2018 @ 8:50am 
Hi. The mod stopped working since the official patch. Pressing the up key does not bring up older commands and looks like some (?) commands do not work (no result is printed).
special_snowcat  [author] 3 Apr, 2018 @ 3:54am 
@Browneyes the mod installs its own TTF font file into the "Fonts" folder in the game's install location. Check out the source code on github (linked above), search for "function LuaConsoleWindow:UseBundledFont" for the code that installs it. I'm not sure what exactly you have to do to make the game use different fonts for some parts of the UI though.
Browneyes 30 Mar, 2018 @ 3:41am 
How did you change font? I made Korean Localization MOD but I'm not modder, so I don't know how to use Lua. Anyway, My localization is not nice because game has only one Korean font. All texts have same appearance. But your Lua Console MOD has your own font even applied. I need your advise. thank you :) I'm not good at English. sorry.

* I tried with this code but there's no change. not applied. T_T
===============================================
function OnMsg.ModsLoaded()

Unmount("Fonts")

MountPack("Fonts", Mods["bpoUrm4"].path .. "Fonts/Nfonts.hpk")


end
Waywocket 27 Mar, 2018 @ 1:39pm 
Now I have to add a "button" data type to Mod Config, for the "Reset Window Position" option...
special_snowcat  [author] 27 Mar, 2018 @ 7:57am 
@William this is because of table.sort(). You can't call that on tables that contain multiple different types of elements, but you'll inevitably find some in _G.

This being said I would not recommend reverse engineering on feet like this. Check out the Modding discord (https://discord.gg/gZtkVSv) , in particular the #resources thread has a bunch of pinned stuff including decompiled Lua code from the game.