Announcement

Collapse
No announcement yet.

How to debug events.txt?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to debug events.txt?

    Hi all

    I'm in the process of creating what I think should be a good new MGE scenario on the struggle between England and France before and during the Hundred Years War.
    However, after nearing completion and starting up the scenario for playtesting, I got the message telling me that there was a problem with events.txt and that I needed to consult the manual to debug. I have no manual.
    Can anyone tell me how to debug this file without deleting it all and starting all over again??

    Grateful for any suggestions.

  • #2
    With ToT, you can write "@DEBUG" juste after "@BEGIN" in the Events file. Then, after you load your scenario, a "report.txt" file is created. If you read this file it stops when there 's a bad instruction in your Events file or at the end if there's no problem.
    I don't know if it works with mge but it's easy to test it.

    Comment


    • #3
      Unfortunately, that doesn't seem to work, unless I'm getting the wrong end of the stick. Where should the report.txt file appear? Grateful for any other suggestions!

      Comment


      • #4
        I've just made a try. It seems mge don't create a report file.
        Could you post your Events file?

        Comment


        • #5
          Here it is.
          Attached Files

          Comment


          • #6
            I'm not sure but....

            @IF
            TURN
            turn=41
            @THEN
            TEXT
            AD 1264 - Arbitrating in the dispute between the English barons and King Henry, King Louis of
            France annuls the Provisions of Oxford imposed in 1258, sparking rebellion among the restive
            barons.
            ENDTEXT
            CREATEUNIT
            unit=Knight
            owner=TRIGGERATTACKER
            veteran=yes
            homecity=NONE
            locations
            48,88
            endlocations
            @ENDIF

            You can't use triggerattacker in an event where there's no attacker. The game don't know which civilization you want to give this unit.
            I think it works with "unitkilled" for example but not with "if turn = 41"

            Comment


            • #7
              Here's the explanation of triggerattacker in the "macro.txt" file :

              TriggerAttacker This specifies the civilization that was the aggressor ("who") in the happening that triggered the trigger.

              Comment


              • #8
                Usually, in other scenarios I've made, TRIGGERATTACKER means that the AI creates a barbarian unit. This normally works without any problems and you'll notice that all of the units created by this particular events.txt are barbarians.
                Thanks for your help anyway - I may just have to go through it one by one to work out which event is causing the difficulty.

                Comment


                • #9
                  You mean that in your label.txt barbarians is "triggerattacker"?

                  Comment


                  • #10
                    Does MGE even have an events debugger? FW does. In FW, if you add the line @DEBUG, as MacGalleo described, the debugger window will pop up. Any errors will be listed in that window. ToT also has an events debugger. Same deal there only the output is in a file called report.txt, found in the scenario directory.

                    Originally posted by jamestout View Post
                    Usually, in other scenarios I've made, TRIGGERATTACKER means that the AI creates a barbarian unit.
                    I've never heard that one before. What's wrong with 'owner=Barbarians'? Anyway, your CreateUnit event on line 173 has no spawn locations.
                    Catfish's Cave - Resources for Civ2: Test of Time | Test of Time FAQ | War of the Ring scenario

                    Comment


                    • #11
                      You could try testing the events ten at a time (IE move your events file to the desktop, make a new events file in the scenario folder and copy and past events in to test them) until you find the faulty block and then go through them individually until you find the one causing the problem. It's a pity that @DEBUG does not work with MGE as it saves a lot of time and hastle. It is also very useful to know how much event space remains.
                      SCENARIO LEAGUE FORUM
                      SCENARIO LEAGUE WIKI SITE
                      SL INFORMATION THREAD
                      CIV WEBRING MULTIPLAYER FORUM

                      Comment


                      • #12
                        Originally posted by McMonkey View Post
                        It's a pity that @DEBUG does not work with MGE as it saves a lot of time and hastle. It is also very useful to know how much event space remains.
                        As far as I know, it does work with MGE! (and if it works with ToT and FW, I can't imagine it not working with MGE)

                        Curt (or anybody else ), can you confirm that?
                        Ankh-Morpork, we have an orangutan...
                        Discworld Scenario: http://apolyton.net/forums/showthrea...8&pagenumber=1
                        POMARJ Scenario:http://www.apolyton.com/forums/showt...8&pagenumber=1
                        LOST LEGIONS Scenario:http://www.apolyton.com/forums/showt...hreadid=169464

                        Comment


                        • #13
                          I'm pretty sure it doesn't work with MGE though I have no idea why not.
                          SCENARIO LEAGUE FORUM
                          SCENARIO LEAGUE WIKI SITE
                          SL INFORMATION THREAD
                          CIV WEBRING MULTIPLAYER FORUM

                          Comment


                          • #14
                            @DEBUG does not work with MGE. I did a search for "DEBUG" on the downloaded Adobe versions of both the MGE and TOT manuals. The MGE manual does not even mention debug or debugging. The TOT manual goes into some detail on both.

                            Also, IIRC, once upon a time I wasted an hour trying to make it work with MGE.
                            Excerpts from the Manual of the Civilization Fanatic :

                            Money can buy happiness, just raise the luxury rate to 50%.
                            Money is not the root of all evil, it is the root of great empires.

                            Comment


                            • #15
                              Ditto!
                              SCENARIO LEAGUE FORUM
                              SCENARIO LEAGUE WIKI SITE
                              SL INFORMATION THREAD
                              CIV WEBRING MULTIPLAYER FORUM

                              Comment

                              Working...
                              X