Ghosts in the Machine?
Posted: Sat Jun 15, 2019 12:27 am
I have no idea what is happening. In the scenario I am designing I have an event with a random trigger set for 1:15 to 1:30 after the scenario starts. The event has the following action
local unit=ScenEdit_GetUnit({side='US/UK/Poland', name='MV Canyon', guid='939c1135-c810-47b7-85cd-45681981bc2a'} )
ScenEdit_AddExplosion({warheadid=317,lat=unit.latitude, lon=unit.longitude, altitude=unit.altitude})
ScenEdit_SetUnitDamage({side='US/UK/Poland', name='MV Canyon', guid='939c1135-c810-47b7-85cd-45681981bc2a', dp=1420, flood=3, fire=2})
ScenEdit_MsgBox('SIGINT indicates that a coalition merchant ships has been struck in the Western Baltic.\n\nThe only possible explanation is that a German submarine in the area initiated hosilities rather than let the target escape.\n\n Commence your attack immediately! WEAPONS FREE', 1)
ScenEdit_SetSidePosture('EurCon', 'US/UK/Poland', 'H')
ScenEdit_SetSidePosture('US/UK/Poland', 'EurCon', 'H')
ScenEdit_AssignUnitToMission('48c2b130-41e6-494a-b4e8-c7a84d9029c7', 'TF22.1.3 Transit')
In the process of making sure the event worked as desired I copied the action into the lua console and ran it. I then reloaded the scenario and made any changes necessary. Saved the scenario and repeated.
My problem is that every time I start the scenario, the action runs and the merchant dies. The log does not show that the event fired. In fact the log shows nothing at all. Its like the game is remembering the test runs I ran through the console and repeats it as soon as I hit start. Did I make the mistake of saving the game while lua was running the action during my test and the action is now a permanent part of the scenario? I tried restarting the computer just to be sure nothing was hanging in the cache or memory and it didn't help.
I am flummoxed.
local unit=ScenEdit_GetUnit({side='US/UK/Poland', name='MV Canyon', guid='939c1135-c810-47b7-85cd-45681981bc2a'} )
ScenEdit_AddExplosion({warheadid=317,lat=unit.latitude, lon=unit.longitude, altitude=unit.altitude})
ScenEdit_SetUnitDamage({side='US/UK/Poland', name='MV Canyon', guid='939c1135-c810-47b7-85cd-45681981bc2a', dp=1420, flood=3, fire=2})
ScenEdit_MsgBox('SIGINT indicates that a coalition merchant ships has been struck in the Western Baltic.\n\nThe only possible explanation is that a German submarine in the area initiated hosilities rather than let the target escape.\n\n Commence your attack immediately! WEAPONS FREE', 1)
ScenEdit_SetSidePosture('EurCon', 'US/UK/Poland', 'H')
ScenEdit_SetSidePosture('US/UK/Poland', 'EurCon', 'H')
ScenEdit_AssignUnitToMission('48c2b130-41e6-494a-b4e8-c7a84d9029c7', 'TF22.1.3 Transit')
In the process of making sure the event worked as desired I copied the action into the lua console and ran it. I then reloaded the scenario and made any changes necessary. Saved the scenario and repeated.
My problem is that every time I start the scenario, the action runs and the merchant dies. The log does not show that the event fired. In fact the log shows nothing at all. Its like the game is remembering the test runs I ran through the console and repeats it as soon as I hit start. Did I make the mistake of saving the game while lua was running the action during my test and the action is now a permanent part of the scenario? I tried restarting the computer just to be sure nothing was hanging in the cache or memory and it didn't help.
I am flummoxed.