MU Soapbox

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Muxify
    • Mustard

    I made a Python-with-Evennia tutorial (looking for feedback)

    MU Code
    evennia tutorial
    10
    34
    4957
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Griatch
      Griatch last edited by

      https://github.com/evennia/evennia/wiki/Python-basic-introduction

      Since many people coming to Evennia are not previously familiar with Python (or any programming in some cases) I put together a tutorial for the absolute Python beginner that just got Evennia up and running. It explores some basic Python concepts using Evennia as well as helps the budding developer start finding their way with concepts like imports, object inheritance and overriding. After previous feedback it was split in two parts since it's pretty chunky to do in one sitting.

      Obviously a short tutorial can't do more than graze the surface of Python and general programming concepts. This won't teach you Python. But it covers some of the most common questions and initial hurdles newcomers tend to ask about in a format that is, while technical, hopefully not too hard to follow when getting started.

      If you follow it and have feedback on further improvements, let me know!
      .
      Griatch

      Cobalt ThatOneDude 2 Replies Last reply Reply Quote 13
      • Cobalt
        Cobalt Tutorialist @Griatch last edited by

        @griatch THANK YOU

        1 Reply Last reply Reply Quote 1
        • ThatOneDude
          ThatOneDude @Griatch last edited by

          @griatch This is good stuff. I've been playing with Evennia and reading over all the documentation and you guys have done a great job.

          Then when it's all over and the rest of you are ready for Dead Animal Pickup, I'm gonna go balls deep into Dahl. But only because she asked me to. Sweet-like. - Riddick (2013)

          1 Reply Last reply Reply Quote 1
          • Bad at Lurking
            Bad at Lurking last edited by

            Reading that makes me foolishly optimistic about learning Python and being able to self-sufficiently run a game. So well done there!

            1 Reply Last reply Reply Quote 0
            • I
              ixokai last edited by

              The purist in me balks at describing print as a function; its a statement in Python 2 without a future import. That you can call a statement with parens around its arguments is just an accident of the fact you can put parens about nearly anything in Python. Its a function of parens are grouping syntax, and they don't make tuples-- commas do.

              Otherwise, looks good 🙂

              1 Reply Last reply Reply Quote 0
              • Griatch
                Griatch last edited by

                Thanks for the nice comments, glad to hear it could be useful to people!

                @cobaltasaurus said in I made a Python-with-Evennia tutorial (looking for feedback):

                @griatch THANK YOU

                You are welcome!

                @thatonedude said in I made a Python-with-Evennia tutorial (looking for feedback):

                @griatch This is good stuff. I've been playing with Evennia and reading over all the documentation and you guys have done a great job.

                Glad you think so. 🙂

                @bad-at-lurking said in I made a Python-with-Evennia tutorial (looking for feedback):

                Reading that makes me foolishly optimistic about learning Python and being able to self-sufficiently run a game. So well done there!

                Python is often considered one of the simpler mainstream languages to learn and we have plenty or people learning Python/programming through Evennia actually. So it's certainly doable!

                @ixokai said in I made a Python-with-Evennia tutorial (looking for feedback):

                The purist in me balks at describing print as a function; its a statement in Python 2 without a future import. That you can call a statement with parens around its arguments is just an accident of the fact you can put parens about nearly anything in Python. Its a function of parens are grouping syntax, and they don't make tuples-- commas do.

                Thanks for the feedback! This exception to print is mentioned in the immediately following paragraph but yes, calling it a 'function' is indeed technically incorrect. I didn't think this was something a complete newbie would gain much from learning out the door. I felt it better to learn calling print as a (sort-of) function from the get-go so that the concept of a function was introduced early and can be referenced later in the tutorial when a real function is created.
                .
                Griatch

                I 1 Reply Last reply Reply Quote 1
                • I
                  ixokai @Griatch last edited by

                  @ixokai said in I made a Python-with-Evennia tutorial (looking for feedback):

                  The purist in me balks at describing print as a function; its a statement in Python 2 without a future import. That you can call a statement with parens around its arguments is just an accident of the fact you can put parens about nearly anything in Python. Its a function of parens are grouping syntax, and they don't make tuples-- commas do.

                  Thanks for the feedback! This exception to print is mentioned in the immediately following paragraph but yes, calling it a 'function' is indeed technically incorrect. I didn't think this was something a complete newbie would gain much from learning out the door. I felt it better to learn calling print as a (sort-of) function from the get-go so that the concept of a function was introduced early and can be referenced later in the tutorial when a real function is created.

                  Honestly, I wonder if the first thing you'd teach is me.msg -- and only teach print in an advanced mode about debugging. Because what is the classical 'first thing' anyone learns in a programming language? How to print out a statement and see the result. In Evennia, that's not print, that's me.msg.

                  me.msg("Hello world!") is really Evennia's version of the first programming exercise for every language ever.

                  Griatch 1 Reply Last reply Reply Quote 1
                  • Griatch
                    Griatch @ixokai last edited by

                    @ixokai said in I made a Python-with-Evennia tutorial (looking for feedback):

                    @ixokai said in I made a Python-with-Evennia tutorial (looking for feedback):

                    The purist in me balks at describing print as a function; its a statement in Python 2 without a future import. That you can call a statement with parens around its arguments is just an accident of the fact you can put parens about nearly anything in Python. Its a function of parens are grouping syntax, and they don't make tuples-- commas do.

                    Thanks for the feedback! This exception to print is mentioned in the immediately following paragraph but yes, calling it a 'function' is indeed technically incorrect. I didn't think this was something a complete newbie would gain much from learning out the door. I felt it better to learn calling print as a (sort-of) function from the get-go so that the concept of a function was introduced early and can be referenced later in the tutorial when a real function is created.

                    Honestly, I wonder if the first thing you'd teach is me.msg -- and only teach print in an advanced mode about debugging. Because what is the classical 'first thing' anyone learns in a programming language? How to print out a statement and see the result. In Evennia, that's not print, that's me.msg.

                    me.msg("Hello world!") is really Evennia's version of the first programming exercise for every language ever.

                    The use of print is there because people somewhat familiar with Python will usually try it first and wonder why nothing happens. It also makes sure newcomers early learn to look at the console since that's where many errors will show up (we've found it's common for beginners to hide/close this window and not realize this source of info exists when they get errors). But yeah, the immediately visible output of me.msg() is indeed more matching the traditional Hello World! example.
                    .
                    Griatch

                    1 Reply Last reply Reply Quote 0
                    • Cobalt
                      Cobalt Tutorialist last edited by

                      Sooo.... lets say you set up Evennia with the purpose of exploring it, but then got busy for a month and forgot the name of the, erh, wizbit equivalent... How would one reset that?

                      Arkandel 1 Reply Last reply Reply Quote 0
                      • Arkandel
                        Arkandel Admin @Cobalt last edited by

                        @cobaltasaurus http://musoapbox.net/topic/2239/resetting-your-1-god-admin-password

                        • He who takes offense when not intended is a fool. He who takes offense when intended is a greater fool.
                        Cobalt 1 Reply Last reply Reply Quote 1
                        • Cobalt
                          Cobalt Tutorialist @Arkandel last edited by

                          @arkandel Thanks boo.

                          Griatch 1 Reply Last reply Reply Quote 0
                          • Griatch
                            Griatch @Cobalt last edited by Griatch

                            @cobaltasaurus If you forgot the name you used (not just the password) you could also drop into the database to see it. But if you are just starting out, you could just as well reset the database and add your account anew.

                            • Start your virtualenv (like you did in the GettingStarted instructions). Go to your game dir (mygame in all documentation).
                            • make sure Evennia is not running: evennia stop.
                            • Delete the file mygame/server/evennia.db3. This is the default database unless you changed to use something like mysql/psycopg2 (then you need to use their tools to wipe the database) (Backing up your database is otherwise just a matter of making a copy of this file).
                            • evennia migrate - this creates a new database file and sets it up.
                            • evennia start - you will be asked for your name/password again.
                            Cobalt 1 Reply Last reply Reply Quote 0
                            • Cobalt
                              Cobalt Tutorialist @Griatch last edited by

                              @griatch Apologies if I should use another thread, but I'm attempting to get Evennia set up on a DO droplet, and keep getting this error right at the beginning. :x

                              alt text

                              Ifrit 1 Reply Last reply Reply Quote 0
                              • Ifrit
                                Ifrit Banned @Cobalt last edited by

                                @cobaltasaurus Have you done a sudo apt-get update before running the apt-get install? I often don't do it and then find out half the packages are missing.

                                Cobalt 2 Replies Last reply Reply Quote 2
                                • Cobalt
                                  Cobalt Tutorialist @Ifrit last edited by

                                  @ifrit Hooray! You are the best! This seems to have worked, thank you!

                                  1 Reply Last reply Reply Quote 2
                                  • Cobalt
                                    Cobalt Tutorialist @Ifrit last edited by

                                    @ifrit @Griatch Okay now I'm having this happen:

                                    ![alt text](0_1527709129097_af6106bb-0272-47b4-8255-1ec1bf279920-image.png image url)

                                    I've tried, several times, to do the 'touch', and to copy the init.py file. Nothing seems to do anything. when I try to touch the init.py from inside my game dir it tells me no such file or folder exists, when i move to zope/interface and use it it returns nothing.

                                    1 Reply Last reply Reply Quote 0
                                    • G
                                      golgoth last edited by

                                      Ah! I think I know what the issue is. Give me a second, @Cobaltasaurus. Is DigitalOcean running Ubuntu?

                                      faraday 1 Reply Last reply Reply Quote 0
                                      • G
                                        golgoth last edited by

                                        @Cobaltasaurus are you putting it here: /pyenv/local/lib/python2.7/site-packages/zope/ inside your game directory? For instance, mine is in: ~/dsdev/pyenv/lib/python2.7/site-packages/zope$

                                        Also, I assume by the bolded init that you are doing dunder init.py (double underscore init double underscore .py)

                                        1 Reply Last reply Reply Quote 0
                                        • faraday
                                          faraday @golgoth last edited by

                                          @golgoth said in I made a Python-with-Evennia tutorial (looking for feedback):

                                          Is DigitalOcean running Ubuntu?

                                          You have a choice of OS but Ubuntu is the default.

                                          G 1 Reply Last reply Reply Quote 0
                                          • G
                                            golgoth @faraday last edited by

                                            @faraday Twisted/Zope/Evennia seems to get confused with Ubuntu.

                                            faraday 1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post