Announcement

Collapse
No announcement yet.

Python - Trouble moving variables between functions

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

  • #16
    It was an indent problem - everything works fine now.

    Comment


    • #17
      Originally posted by vovan
      Trip, I might just be stupid, but... Could you explicitly say how to enable these logs you speak of? I enabled all the logging options in the ini file (changed to 1, except hidepythonexceptions which I set to 0) but nothing ever showed up in the My Games\Civ4\Logs directory. Am I looking in the wrong place? Or is it because no logs were generated, so there's nothing to look at?
      Hmmm... You set LoggingEnabled=1 in the .ini? It should create a number of logs in the logs folder every time you run the game.

      Comment


      • #18
        Originally posted by Trip
        Hmmm... You set LoggingEnabled=1 in the .ini? It should create a number of logs in the logs folder every time you run the game.
        Is that only for CivilizationIV.ini file, or is it supposed to work also if you set it in a particular mod ini file?
        XBox Live: VovanSim
        xbox.com (login required)
        Halo 3 Service Record (I fail at FPS...)
        Spore page

        Comment


        • #19
          You should only want/need it in the main CivIV.ini file.

          Comment


          • #20
            Originally posted by Trip
            You should only want/need it in the main CivIV.ini file.
            I see. Well, I only wanted logging to be enabled for this one mod I was playing around with, but when I enabled logging in that mod's ini file, no logs showed up. I haven't tried the CivIV.ini file, actually.
            XBox Live: VovanSim
            xbox.com (login required)
            Halo 3 Service Record (I fail at FPS...)
            Spore page

            Comment


            • #21
              Yeah, the Mod .INIs are special...

              Comment


              • #22
                Indenting is actually rather helpful. If you had misplaced a { or } in C++, or (worse) a ( or ) in LISP, it wouldn't have been more obvious, would it?
                You are right. I was thinkining about that from the parser point of view, and not the programmer point of view. It is much far easier for a parser to distinguish between blocks when using characters to delimit them, than by using indentation.

                That is why i prefer to work with tools like Visual Assist X that place { } ( ) " etc. automatically and indent the code accordingly.

                Comment


                • #23
                  Originally posted by stud1294
                  **snip large 'pass by reference' explanation**
                  Great explanation, even if it didn't solve the problem! Your English is excellent.

                  Comment


                  • #24
                    Originally posted by stud1294


                    You are right. I was thinkining about that from the parser point of view, and not the programmer point of view. It is much far easier for a parser to distinguish between blocks when using characters to delimit them, than by using indentation.

                    That is why i prefer to work with tools like Visual Assist X that place { } ( ) " etc. automatically and indent the code accordingly.
                    a) get a proper python ide. That does it for you

                    b) you still can use () {} in comments

                    Code:
                      if bla condition:
                        #{
                        do
                        something
                        #}

                    Comment

                    Working...
                    X