Surviving Mars

Surviving Mars

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.
Ratchet the Wusky | Lost 27 Mar, 2018 @ 7:12am 
I'm trying to get it to tell me the global values of Lua in the game. I replaced the scratchpad code with the following:
[H1]-- globals.lua
-- show all global variables

local seen={}

function dump(t,i)
print("hi")
seen[t]=true
local s={}
local n=0
for k in pairs(t) do
n=n+1 s[n]=k
end
table.sort(s)
for k,v in ipairs(s) do
print(i,v)
v=t[v]
if type(v)=="table" and not seen[v] then
dump(v,i.."\t")
end
end
end

dump(_G,"")[/h1]
However, it appears it is saying it can't compare string with a number... I added a few prints for debugging, (see just below 'dump' function) however it still is erroring using print send the string to the console, or no? Also, if anyone can see anything I'm blind to? Such as an end I forgot... The code seems to work on standalone Lua, but in the game...
Shibe 24 Mar, 2018 @ 10:22pm 
Just wanted to lay down some appreciation for your work on this. It's wonderful, thank you.
Thorik 24 Mar, 2018 @ 4:03am 
Yes, but it's only, as you say, undefined globals and callstack: https://pastebin.com/Dxu0D5a6
special_snowcat  [author] 24 Mar, 2018 @ 2:40am 
@Thorik it "works for me". Does the game log have anything to say about it? (Warnings about undefined globals etc. can be ignored, but maybe something is interrupting the mod loading process.)
Thorik 23 Mar, 2018 @ 6:09am 
I can't see the console after game updates - is it only me? (I might've modded a file too far.)
Bacon 21 Mar, 2018 @ 8:08pm 
Thank you!
Grizzwald 21 Mar, 2018 @ 12:56pm 
This is amazing, thanks for this
Waywocket 19 Mar, 2018 @ 5:28pm 
This is unbelievably useful, thanks.