Script hack to enable coordinates display

A forum to discuss custom scenarios, campaigns and modding in general.

Moderators: Slitherine Core, The Lordz

Post Reply
Lieutenant Colonel - Panther D
Lieutenant Colonel - Panther D
Posts: 1272
Joined: Tue Nov 23, 2010 3:35 pm

Script hack to enable coordinates display

Post by Robotron » Sat May 07, 2016 8:41 pm

Quite a while ago a workaround was posted that enabled showing the coordinates of any hex under the date display. While knowing the coordinates is nice to have for the player and absolute vital if you want to mod the game for various reasons, the workaround prevented selecting units. Here is a way to enable coordinates while keeping anything selectable:

open the script "main.hud.lua" found in data/scripts/ui

and insert this line

Code: Select all

 hud:GetText("turn_text"):SetText(hex.x .. "," .. hex.y.. " " .. game.turn)
into lines 523 and 620 of an unmodified V1.66 installation.

The x,y coordinates and current turn will then be displayed in the date display. :)

Tulius Hostilius
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 48
Joined: Wed Aug 22, 2018 11:46 am

Re: Script hack to enable coordinates display

Post by Tulius Hostilius » Sat Aug 25, 2018 3:08 pm

Outstanding! Works perfectly! Thanks!

Post Reply

Return to “Commander the Great War : Mods & Scenario Design”