[FIXED] Lua “World GetLocation()” function returns error (Build 1273.1)

Post bug reports and ask for game support here.

Moderator: MOD_Command

Post Reply
eclair
Posts: 27
Joined: Tue Feb 15, 2022 9:44 pm

[FIXED] Lua “World GetLocation()” function returns error (Build 1273.1)

Post by eclair »

It seems that “World GetLocation()” function returns error for some locations which have convergence zone.

Try each of following code at attached scenario: if works properly, it returns location details for unit's position.
Note that location of Sub #4 and #5 have convergence zone.

Code: Select all

local name = "Sub #1"
local status = ScenEdit_GetUnit({name=name})
print(status.latitude)
print(status.longitude)
print(World_GetLocation({latitude=status.latitude, longitude=status.longitude}))

Code: Select all

local name = "Sub #2"
local status = ScenEdit_GetUnit({name=name})
print(status.latitude)
print(status.longitude)
print(World_GetLocation({latitude=status.latitude, longitude=status.longitude}))

Code: Select all

local name = "Sub #3"
local status = ScenEdit_GetUnit({name=name})
print(status.latitude)
print(status.longitude)
print(World_GetLocation({latitude=status.latitude, longitude=status.longitude}))

Code: Select all

local name = "Sub #4"
local status = ScenEdit_GetUnit({name=name})
print(status.latitude)
print(status.longitude)
print(World_GetLocation({latitude=status.latitude, longitude=status.longitude}))

Code: Select all

local name = "Sub #5"
local status = ScenEdit_GetUnit({name=name})
print(status.latitude)
print(status.longitude)
print(World_GetLocation({latitude=status.latitude, longitude=status.longitude}))
Sub #1 to #3 works fine, but #4 and #5 returns “Object reference not set to an instance of an object” error (Japanese: “ERROR: オブジェクト参照がオブジェクト インスタンスに設定されていません。”).
It is well that war is so terrible: otherwise we should grow too fond of it.
User avatar
michaelm75au
Posts: 12457
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

Re: Lua “World GetLocation()” function returns error (Build 1273.1)

Post by michaelm75au »

Thanks.

The CZ function was changed but someone forgot to pass thru a parameter.
Fix for next build.
Michael
Post Reply

Return to “Tech Support”