How to use the in-game console to reload .Artdef files and a few other tips

Gedemon

Modder
Super Moderator
Joined
Oct 4, 2004
Messages
11,599
Location
France
First enable the console, open AppOptions.txt in "..\Documents\my games\Sid Meier's Civilization VI" and change
Code:
;Enable Debug menu.
EnableDebugMenu 0
to
Code:
;Enable Debug menu.
EnableDebugMenu 1

and save the file, then start the game.

You can enable the console at any moment, in a game or on the start menu by pressing the "~" key (US keyboard: usually the top left key under "Esc", to use it with my french Azerty keyboard I've installed "US keyboard" in windows langage preferences, and switch to EN input with Alt+Shift when I need to activate the console...)

Once activated, enter "help" in the text field and press the 3rd down arrow from the left to toggle the log display...
Spoiler :
Clipboard-2.jpg
Clipboard-3.jpg
Clipboard-5.jpg


For example, to reload an artdef file you've just modified and saved, you enter the corresponding function while in game, like
Code:
artdef reload Units


Also note that there is a function to call console commands from Lua:
Code:
AutoProfiler.RunCommand( "toggle vfx" )
 
Last edited:
Attached is a small half-sea/half-land map with a script to generate all units from the DB for the player 1.

Active the mod (ignore the compatibility warning), load the TestMap with a few civs
Spoiler :
upload_2020-4-9_17-45-1.png


Open the FireTuner, select the testScript context and call that function:
Code:
AllUnits()
Spoiler :
upload_2020-4-9_17-49-1.png


And hop !
Spoiler :
upload_2020-4-9_17-51-57.png

upload_2020-4-9_17-52-22.png


There is also a function to delete all units except on the 3-4 first rows in the bottom (to keep the settlers alive)
Code:
DeleteAllUnits()
 

Attachments

  • upload_2020-4-9_17-44-30.png
    upload_2020-4-9_17-44-30.png
    85.7 KB · Views: 233
  • Test Map.zip
    3 KB · Views: 179
Top Bottom