KnightHawk75
Posts: 1450
Joined: 11/15/2018 Status: offline
|
Rory, is it possible you have a version of Iron Hand that hasn't actually shipped with the game or an update yet? I can repo it with my local copy last modified 9/18/2020 (attached). If you let it run for an hour, at 17:00Z you should get the issue and the reported errors in the exception log and the message log. Function WeatherReportIsDue does not exist as function in the scene setup code (nor in the \lua\iron hand\ files for the scene, not that they're used), so the hourly event (Game_HourlyActions) that runs that calls it fails, that error then causes WeatherReportRUS to not run as well, and there is also a line to call CleanUpIdleCivilianShips() that never runs cause of it - but it too would fail as there is no such function. Additionally in LuaInit there is a pointless call to ScenEdit_RunScript('DeveloperMode.lua'), a file which does not exist, it doesn't matter other then the error getting logged. The follow appears to be missing from LuaInit Action (based on other scenes):
function WeatherReportIsDue()
local result = false
local hourZulu = TimeIs().hour
local hourLocal = hourZulu + scenarioZuluOffset
if hourLocal %6 == 0 then
result = true
end
return result
end function CleanUpIdleCivilianShips()
local unitList = VP_GetSide({side='Civilian'}).units
local numberOfCivilianUnits = #unitList
local numberOfUnitsDeleted = 0
for k,v in ipairs (unitList) do
local unit = ScenEdit_GetUnit({guid=v.guid})
if (unit.course[1] == nil or unit.speed == 0) and
unit.type == 'Ship' then
ScenEdit_DeleteUnit({guid=v.guid})
numberOfUnitsDeleted = numberOfUnitsDeleted + 1
end
end
if DebugModeIsOn() and numberOfUnitsDeleted > 0 then
ScenEdit_SpecialMessage('playerside','Civ_Cleanup fired. <BR>Initial civilian Units:
'..numberOfCivilianUnits..' <BR>;Civilian units cleaned up: '..numberOfUnitsDeleted)
end
end
I've tried adding the above and removing the developermode.lua call, and scene then runs without issue and you get the weather reports as intended.
Attachment (1)
< Message edited by KnightHawk75 -- 5/1/2021 6:39:09 PM >
|