C Language

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • momo125
    Scout
    • May 2007
    • 42

    C Language

    I am not a programmer and have no experience. What is the easiest way to get into hacking the code. I understand how to change the edit files, but not the exe or source code
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9638

    #2
    It's best to have some game feature in mind when you start. Then if you search the source files for messages related to that, you can find where the relevant section of code is and start focusing on that. You will have to learn a bit of C at some point, but that will be easier if you have goals to understand specific bits of the game code.
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • momo125
      Scout
      • May 2007
      • 42

      #3
      I guess what I really need to know is what program to open the source.

      Comment

      • Nick
        Vanilla maintainer
        • Apr 2007
        • 9638

        #4
        If you look at the first post in this thread, it has reasonably thorough (and mildly humorous) instructions for how to set up a compile environment, download source and compile in Windows. If you use Windows, this is probably what you want. If you use linux, you can just open stuff in your favorite text editor. I'm not sure about OSX, but something called xcode rings a bell.

        Hope this helps; I (and other people) can give more info as you need it.
        One for the Dark Lord on his dark throne
        In the Land of Mordor where the Shadows lie.

        Comment

        • camlost
          Sangband 1.x Maintainer
          • Apr 2007
          • 523

          #5
          C source code files are stored as ascii text. You can open them in wordpad or notepad, but a programming editor would be vastly better suited, as they have lots of nice features for programming (including automatic coloring and/or indenting).

          Another source for learning how to compile the angband source can be found here:
          a chunk of Bronze {These look tastier than they are. !E}
          3 blank Parchments (Vellum) {No french novels please.}

          Comment

          • Daven_26d1
            Adept
            • Jun 2007
            • 211

            #6
            When I used to program on Windows, I was fond of a text editor called Editplus 2.

            It did all those neat tricks like syntax highlighting, function folding and control structure auto-completion, that us modern programmers feel naked without.
            I found it very easy to use, and the features didn't get in my way until I wanted to learn to use them. Beyond all this, it loaded in about 1/10 of the time that Word did.

            Looking about the internet, a shareware version still appears to be available for download.

            As for C programming advice, a very popular beginners guide can be found here:



            Not my cup of tea, personally; I'd rate it as OKish, but then I wasn't a beginner when I looked at it.
            Too many of my peers (who did read it when they started out with C) have raved about its value for me to ignore its potential use to you.

            To reiterate Nick's point - have a goal in mind when you start reading the sources.
            You sold a Broken Sword (1d2) (-2,-4) {average} (j) for 1 gold.
            The shopkeeper howls in agony!
            You say "Dude, the clue is in the name...".

            Comment

            • strangeintp
              Rookie
              • Jan 2008
              • 13

              #7
              Originally posted by momo125
              I am not a programmer and have no experience. What is the easiest way to get into hacking the code. I understand how to change the edit files, but not the exe or source code
              Step one: get a primer on C programming.
              Step two: learn how to program.
              Step three: hack Angband.

              Comment

              • priji
                Rookie
                • Feb 2008
                • 5

                #8
                I have no experience in the c language . i heard this language is one of the greatest computer languages. Its very powerful, simple to use and works lightning fast.C is an High level Programming language.

                Comment

                • s0be
                  Apprentice
                  • Jan 2008
                  • 96

                  #9
                  The angband source is a good place to start hacking C. The code is pretty clean, and doesn't use a lot of fancy hand waving tricks.

                  Comment

                  • K.I.L.E.R
                    Apprentice
                    • May 2007
                    • 56

                    #10
                    Does it need to? lol

                    Comment

                    • Pete Mack
                      Prophet
                      • Apr 2007
                      • 6883

                      #11
                      Originally posted by s0be
                      The angband source is a good place to start hacking C. The code is pretty clean, and doesn't use a lot of fancy hand waving tricks.
                      I confess, it uses more fancy tricks than it used to. I used C-style virtual functions to implement the event and menu UI.

                      (It's clean, but it may be a bit of a mystery for a beginning programmer.)


                      Some of the display code, and the macro code is also pretty hairy.

                      Comment

                      • s0be
                        Apprentice
                        • Jan 2008
                        • 96

                        #12
                        True, there is some hand waving magic in there (to the uninitiated), but the fortunate thing is, people who want to start hacking on the program usually don't want to hack the way the menuing works, nor do they want to revamp the event system.

                        Comment

                        Working...
                        😀
                        😂
                        🥰
                        😘
                        🤢
                        😎
                        😞
                        😡
                        👍
                        👎