An appeal to TheNamelessOne

techumseh

Deity
Joined
Mar 12, 2002
Messages
2,451
Location
BC wine country
Appeal to to the TheNamelessOne :

The Patch Project has been a godsend for ToT scenarios. But it has one serious bug. It renders the "continuous" modifier of the Macro events inactive. While I know that you would like to encourage scenarios designers to utilize LUA as a preferred alternative, many scenarios were made before this. If they have events that use the modifier "continuous", they can't be played on a Civ exe. that has been patched. Please fix this bug. Thank you.
 
Just dropping by the forum and this thread caught my eye. So I tested it using ToTPP v0.15.1 and v0.13.2 (pre-Lua), Windows 7 64-bit for a couple of simple Flag/CheckFlag->Text events in a couple of scenarios, as well as for a few more sophisticated events in my WotR scenario. The Continuous modifier worked correctly in every test, although, unlike unpatched ToT, it appears (on trying to break it) that the ToTPP strictly applies the 'modifier must never be the last parameter of a trigger or action' syntax rule from Macro.txt. Ignore the rule and the game ignores the modifier. Apart from that I don't know what may be causing it to fail on other people's systems. Perhaps it's a Windows 10 thing.
 
Just dropping by the forum and this thread caught my eye. So I tested it using ToTPP v0.15.1 and v0.13.2 (pre-Lua), Windows 7 64-bit for a couple of simple Flag/CheckFlag->Text events in a couple of scenarios, as well as for a few more sophisticated events in my WotR scenario. The Continuous modifier worked correctly in every test, although, unlike unpatched ToT, it appears (on trying to break it) that the ToTPP strictly applies the 'modifier must never be the last parameter of a trigger or action' syntax rule from Macro.txt. Ignore the rule and the game ignores the modifier. Apart from that I don't know what may be causing it to fail on other people's systems. Perhaps it's a Windows 10 thing.

That's interesting, and would explain why I didn't come across the issue when doing tests for my legacy event converter. It's not a Windows 10 thing, since @techumseh said in this thread that he plays Test of Time on an old Windows XP machine.

It also means that a Lua script can be written to detect (and even automatically fix, though I might have to learn something new) this problem.
 
I need to correct this: 'unlike unpatched ToT'. I'd assumed this was the case for reasons I can't remember. So I just tested that, too. Not true. The rule also applies to vanilla ToT.

Looking at the Sea Lion scenario mentioned in the link, there are 16 Flag events in the scenario where the Continuous modifier is in the wrong location. Unfortunately, these are doomed to fail. They are at lines 5439, 5455, 5470, 5485, 11297, 13922, 13935, 13949, 13962, 13975, 13988, 14001, 14014, 14027, 14040 and 14052. You can see that the game has failed to find the Continuous modifier in the debugging Report.txt. Note that @DEBUG was already enabled in this scenario. The events at lines 11250 and 11262 each have two instances of the Continuous modifier, however, they both should work, as one is in the right place. I place the Continuous modifier on the line immediately following Flag (the action). Avoid placing it on the last line of the action statement.
 
Thanks for looking into this, Catfish. The Sea Lion events were done before I realized that the continuous events weren't working properly. I dug into this more thoroughly when I redid the Burma events. I totally eliminated the 'continuous' events, and used give and take technology events as a form of repeating trigger. Then I added back a couple of events using the 'continuous' modifier, triggering a text message. Going back and re-reading the manual, I had noted the rule you quoted, and made sure the syntax was correct, as follows:

@IF
Turn
turn=2
@THEN
Flag
Continuous
who=Japanese
state=on
flag=11
@ENDIF

I found that the text message reappeared a varying number of times, in the range of 1-5 or so, and usually 2 or 3, and then stopped. As John says, I have
Windows XP on my computer, but also Win7 on my laptop. I get the same results with both.
 
I did a small test using TOTPP15 (I use Linux and WINE, if we end up finding that it matters). After four tries, the continuous flag lasted at least 20 turns, and I tried saving and loading twice, to no effect.

Can you please post an events file (and accompanying scenario, if appropriate) where this happens?

Here are a couple questions to try to narrow down this bug:

1. Are there flag events that are not continuous, but also set the flag in question? (I think, then, that it would be 'normal' behaviour.)

2. Has this been observed in scenarios that don't take advantage of TOTPP features, but still running in TOTPP? Maybe some data was accidentally copied to that part of the saved game or something, if it is only observed with some TOTPP feature.
 
I tried a quick experiment. I added this to the Burma events files (all 5):

;Continuous Modifier Test

@IF
ScenarioLoaded
@THEN
FLAG
Continuous
Who=Japanese
state=on
flag=20
@ENDIF

@IF
Checkflag
Who=Japanese
Flag=20
State=on
@THEN
TEXT
Flag 20 is on.
ENDTEXT
@ENDIF

First I moved the 'continuous' from the end of the event to the front, right after @THEN. It didn't trigger at all after the first turn. Then I moved it to just behind FLAG. Then it worked for the first 7 turns and then stopped. If you guys are getting better results, then perhaps is has something to do with my setup, or how my setup interacts with ToTPP, since I haven't experienced these issues prior to installing it. Or at the very least, I didn't notice.
 
If it's a ToTPP bug, one area of suspicion would be the EventHeapSize parameter under @COSMIC2, especially with very high heap values and/or dynamic event allocation enabled. At least if that were the case, older scenarios would be unaffected. My tests certainly didn't push that area. Can't test now.

Oh, and one other thing I noticed when shooting through the Sea Lion events file is that you were using the Continuous modifier when turning flags off. It's not required. Off is the default position. Once a flag has been turned off, it stays off permanently unless otherwise instructed. A flag in ToT is like a switch that you have to keep holding down (continuously) to keep an appliance on.
 
I did get the same effect as @techumseh for the Burma scenario a few days ago, but haven't had time to examine stuff since then.
 
Back
Top Bottom