Surviving Mars

Surviving Mars

Lua Console
18 条留言
akarnokd 2018 年 8 月 12 日 上午 9:42 
Hi, could you update this mod to support the Da Vinci patch of the game?
SkiRich 2018 年 4 月 21 日 上午 2:11 
Is there a how to or help/example faq included to show how to use the console?
akarnokd 2018 年 4 月 8 日 上午 5:30 
Thanks, the history is working. I was trying to call UICity:OutsourceResearch but apparently with the wrong arguments - my mistake.
special_snowcat  [作者] 2018 年 4 月 8 日 上午 5:08 
@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 2018 年 4 月 6 日 上午 8:50 
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  [作者] 2018 年 4 月 3 日 上午 3:54 
@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 2018 年 3 月 30 日 上午 3:41 
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 2018 年 3 月 27 日 下午 1:39 
Now I have to add a "button" data type to Mod Config, for the "Reset Window Position" option...
special_snowcat  [作者] 2018 年 3 月 27 日 上午 7:57 
@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 2018 年 3 月 27 日 上午 7:12 
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 2018 年 3 月 24 日 下午 10:22 
Just wanted to lay down some appreciation for your work on this. It's wonderful, thank you.
Thorik 2018 年 3 月 24 日 上午 4:03 
Yes, but it's only, as you say, undefined globals and callstack: https://pastebin.com/Dxu0D5a6
special_snowcat  [作者] 2018 年 3 月 24 日 上午 2:40 
@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 2018 年 3 月 23 日 上午 6:09 
I can't see the console after game updates - is it only me? (I might've modded a file too far.)
Bacon 2018 年 3 月 21 日 下午 8:08 
Thank you!
Grizzwald 2018 年 3 月 21 日 下午 12:56 
This is amazing, thanks for this
Waywocket 2018 年 3 月 19 日 下午 5:28 
This is unbelievably useful, thanks.