Standard lua globals do not exist?

Thalassicus

Bytes and Nibblers
Joined
Nov 9, 2005
Messages
11,057
Location
Texas
Runtime Error: [string "Assets\UI\InGame\InfoTooltipInclude.lua"]:64: attempt to index global 'print' (a nil value)

PHP:
63: GetDefaultBuildingTagData = GetDefaultBuildingTagData or function (iBuildingID, tagType, bExcludeName, bExcludeHeader, bNoMaintenance)
64:    print("Running GetDefaultBuildingTagData ")
This happens regardless of what function or global variable (like Game or UI) I attempt to put here. I don't understand how it's possible for all lua globals to be nil?

This sometimes happens when I'm loading a game from within an existing game, but not always. It does not happen if I load from the main menu, either. I've encountered this error in another place before:

PHP:
Game.ActiveUnitRefreshPromotions = Game.ActiveUnitRefreshPromotions or function()
  if UI == nil then
    return
  end
  local unit = UI.GetHeadSelectedUnit()
  BalancePromotions(unit, unit:GetOwner(), true)
end
^ Same problem there. I can't figure out what these two things have in common. :think:

GetDefaultBuildingTagData is stored in a function table and called from the same file it's defined. Game.ActiveUnitRefreshPromotions is a standalone function called from a different file from where it's defined.
 
Back
Top Bottom