I'm describing a specific case here, since, unfortunately, I have failed to isolate this issue so far - it doesn't manifest itself in the test maps I have built. But there is one case where it always happens -
Daedalus.
The scripts in this WAD use world variables to track some of the player's stats, for example, the state of his "aural translator". It uses two variables for this purpose: TRANA_STAT and TRANA_CHARG. Defined in D2KIncl.acs, lines 172 and 174:
Code: Select all
world int 1:TRANA_CHARG; // Aural translator charge - 20 min
...
world int 3:TRANA_STAT; // Aural translator status - 1 owned and working, 2 needs charge
At the start of the game, a script sets the value of TRANA_STAT to 1 and TRANA_CHARG to 1240. This happens in script 1 of D2KGG01.ACS (lines 97 and 98):
Code: Select all
Script 1 OPEN
{
...
trana_stat = 1;
trana_charg = 1240; // granularity is 10 seconds
...
}
However, as soon as the game is saved and reloaded, the values of these variables are reset to 0 for some reason. This triggers the following part of the code in function "msgpush" to execute in LIBMOut.acs when a new message arrives (lines 282-286):
Code: Select all
if (TranA_Stat == 0) // no translator
{
// msgNormal("Can't understand anything. Maybe you need a translator.");
print(s:"Can't understand anything. Maybe you need a translator.");
}
The player will see the "Can't understand..." message as soon as he leaves the shuttle after the crash,
provided that the game has been saved and reloaded at least once. If the game hasn't been reloaded, some messages will be printed before the translator's charge runs out. This is normal behavior.
I have failed to find any place in the code where the value of TRANA_STAT is explicitly set to 0. I have made a WAD with a script which logs the values of the TRANA_STAT and TRANA_CHARG variables to the console every 5 tics, and it seems they are indeed reset to 0 as soon as the game is loaded. Thus, I conclude that it is an engine bug.
As I have already mentioned, I couldn't reproduce this issue in a clean environment. I made a test map with a world variable in its scripts file, and then added a library which accessed and changed this variable. But the value is preserved after reloading in all of my tests. There must be something in the Daedalus scripts which somehow breaks the normal behavior.
I am attaching the WAD with the logging script in case it might be needed for testing.
P.S. TeamTNT website seems to be down for unknown reasons but you can get the Daedalus ACS source files from the Web Archive in case you don't have them.
Link
I'm describing a specific case here, since, unfortunately, I have failed to isolate this issue so far - it doesn't manifest itself in the test maps I have built. But there is one case where it always happens - [url=http://www.doomworld.com/idgames/themes/TeamTNT/daedalus/daedalus]Daedalus[/url].
The scripts in this WAD use world variables to track some of the player's stats, for example, the state of his "aural translator". It uses two variables for this purpose: TRANA_STAT and TRANA_CHARG. Defined in D2KIncl.acs, lines 172 and 174:
[code]world int 1:TRANA_CHARG; // Aural translator charge - 20 min
...
world int 3:TRANA_STAT; // Aural translator status - 1 owned and working, 2 needs charge[/code]
At the start of the game, a script sets the value of TRANA_STAT to 1 and TRANA_CHARG to 1240. This happens in script 1 of D2KGG01.ACS (lines 97 and 98):
[code]Script 1 OPEN
{
...
trana_stat = 1;
trana_charg = 1240; // granularity is 10 seconds
...
}[/code]
However, as soon as the game is saved and reloaded, the values of these variables are reset to 0 for some reason. This triggers the following part of the code in function "msgpush" to execute in LIBMOut.acs when a new message arrives (lines 282-286):
[code]if (TranA_Stat == 0) // no translator
{
// msgNormal("Can't understand anything. Maybe you need a translator.");
print(s:"Can't understand anything. Maybe you need a translator.");
}[/code]
The player will see the "Can't understand..." message as soon as he leaves the shuttle after the crash, [i]provided that the game has been saved and reloaded at least once.[/i] If the game hasn't been reloaded, some messages will be printed before the translator's charge runs out. This is normal behavior.
I have failed to find any place in the code where the value of TRANA_STAT is explicitly set to 0. I have made a WAD with a script which logs the values of the TRANA_STAT and TRANA_CHARG variables to the console every 5 tics, and it seems they are indeed reset to 0 as soon as the game is loaded. Thus, I conclude that it is an engine bug.
As I have already mentioned, I couldn't reproduce this issue in a clean environment. I made a test map with a world variable in its scripts file, and then added a library which accessed and changed this variable. But the value is preserved after reloading in all of my tests. There must be something in the Daedalus scripts which somehow breaks the normal behavior.
I am attaching the WAD with the logging script in case it might be needed for testing.
P.S. TeamTNT website seems to be down for unknown reasons but you can get the Daedalus ACS source files from the Web Archive in case you don't have them. [url=https://web.archive.org/web/20160215165357/http://www.teamtnt.com/daedalus/Dev/dad-dev.zip]Link[/url]