Is there a lua print function that can print from game files to the firetuner lua console?

criZp

Emperor
Joined
Jul 19, 2013
Messages
1,963
Location
Nidaros, Norway
Yeah I tried to search but could not find anything about printing to the firetuner.

Because I need some way to check the values of these variables:

Code:
local eOperation = UI.GetInterfaceModeParameter(UnitOperationTypes.PARAM_OPERATION_TYPE);
local tResults = UnitManager.GetOperationTargets(pSelectedUnit, eOperation );
-- allPlots does not work when selecting a spy, only when clicking the travel button
local allPlots = tResults[UnitOperationResults.PLOTS];
 
print() not working for you ?

should output in lua.log and firetuner

Code:
print("hello world")
print(eOperation)
print(type(tResults))
for key, value in pairs(tResults) do print (key, value) end
 
Alright, see that. It was UI.GetInterfaceModeParameter(UnitOperationTypes.PARAM_OPERATION_TYPE) that was the problem, in some case not returning anything. But replacing the function with the number it should return, -1295211657, made the code work consistently. It's a pretty weird number, I don't really understand it.

Anyway is the UI.GetInterfaceModeParameter function defined somewhere, so I can see how it works?
 
In this picture, is there a particular reason why print("test 1") would not work, when print("test 2") is working? Because print("test 1") is the first line in a function that execute right before print("test 2"). Yet the lua console only shows test 2.

civ 6 print.jpg
 
If you are running Gathering Storm or Rise and Fall, Firaxis may be redefining function "RefreshDestinationList()" in a "replacement" file, which would make the version you are editing not be used at all.

Otherwise it would seem like "test 1" ought to be printed before "test 2".
 
A quick look shows they're repeating the RaF re-definition from the Expansion1 folder in the Gathering Storm Expansion2 folder. So there are actually three different versions of the function held within the game's base files. Altho the definitions appear identical between RaF and GS, you'd have to edit the GS version if you are directly-editing the original game-files and also running Gathering Storm.
 
But replacing the function with the number it should return, -1295211657, made the code work consistently. It's a pretty weird number, I don't really understand it.
It is a hash number. They are used quite often in the code. Most of them are stored in Types table.
The one you posted is for UNITOPERATION_SPY_TRAVEL_NEW_CITY.
 
Top Bottom