Adventure Game Studio

Community => General Discussion => Topic started by: R4L on Sat 28/07/2007 23:05:29

Title: Anyone know anything about Python?
Post by: R4L on Sat 28/07/2007 23:05:29
Well, I do some modding for a game called Frets on Fire. It was made in python, and it's like Guitar Hero for Playstation 2.

I downloaded Python, and all I can say is that it looks very complicated. I would like to get some opinions from anyone who has used it before. It seems like a good alternative to regular C and BASIC.
Title: Re: Anyone know anything about Python?
Post by: voh on Sat 28/07/2007 23:22:07
Slapping rocks together is a good alternative for BASIC.

http://www.sthurlow.com/python/

Ignore the Civ IV references, it's got some good information.
Title: Re: Anyone know anything about Python?
Post by: R4L on Sun 29/07/2007 02:15:06
Holy crap Voh! Thanks for that!

By the way, do you have any experience with Python? Is it easy to get at first?
Title: Re: Anyone know anything about Python?
Post by: Gord10 on Sun 29/07/2007 03:02:20
I am currently modding for Mount&Blade and its module system uses Python, as well.

I can say it is not such a hard language, it came easy to me.
Title: Re: Anyone know anything about Python?
Post by: fred on Sun 29/07/2007 09:20:01
Good luck w/ python, I've used it for scripting before, and it's not that hard once you get used to the syntax. 

Documentation and tutorials:
http://www.python.org/doc/ (http://www.python.org/doc/)

There's also pygame, a set of free python modules for game development:
http://www.pygame.org (http://www.pygame.org)
Title: Re: Anyone know anything about Python?
Post by: SSH on Sun 29/07/2007 10:02:41
Pyhton is awesome and pygame makes it easy to write stuff. There's even an open-source point-and-click adventure written in it: http://www.pygame.org/projects/23/300/
Title: Re: Anyone know anything about Python?
Post by: tube on Sun 29/07/2007 13:17:21
Python is my scripting language of choice whenever applicable. For me it was pretty much love at first sight. :-*

Here's another great tutorial, Dive into Python (http://www.diveintopython.org/toc/index.html) by Mark Pilgrim.
Title: Re: Anyone know anything about Python?
Post by: scotch on Sun 29/07/2007 13:30:44
My favorite script language too! I'd encourage anyone to learn it, it's handy for embedding, web scripting, simple or prototype games, all sorts of stuff. And it's not horribly designed and messy like certain script languages.

I was going to recommend Dive into Python, same as tube, it's the best way to get into it if you can already code in another language (especially an OO one).

As for if it's easy... well considering it's a real language designed for real use, and primarily used by and aimed at experienced coders it's very simple to learn. It'll take longer to learn the ins and outs than when learning BASIC or PHP, simply because it supports more coding techniques and you can do more with it. But it's very clean, consistent and you should be able to write scripts very quickly.
Title: Re: Anyone know anything about Python?
Post by: R4L on Sun 29/07/2007 19:52:26
Ha, thanks for our opinions! I downloaded ActivePython and I'll look into the stuff you guys provided. I want to learn some python so I can add more features to a game I'm currently addicted to (see first post) and learn something that could get me a job. :D

In the future that is...
Title: Re: Anyone know anything about Python?
Post by: deadsuperhero on Mon 30/07/2007 03:39:08
I'm starting to get into Python. It's really simple, and is oddly like AGS in some aspects.
Title: Re: Anyone know anything about Python?
Post by: covox on Mon 30/07/2007 14:20:27
I heartily recommend learning Python. One of the quickest ways to write lovely clean working code, all the benefits of OO with voluntary encapsulation, blah blah blah everyone can see it's completely brilliant and that's that ;P

I've written a Lemmings engine (http://rebui.ld.net.au/software/tundra) in it using pygame, although it's probably not a good idea to look at the source too closely as I wrote lots of it during a crash course.
Title: Re: Anyone know anything about Python?
Post by: R4L on Mon 30/07/2007 20:10:55
Well, I opened some of the source of that game I like into Python, and it isn't much different than AGS. This is a great program! Although I need pyOpenGL, so when I get the zip and I extract to a temp folder I try to run this line:

python setup.py

It says to run this in the installation notes, but the DOS window pops up for not even a second and then nothing happens. Is this a module or something I am supposed to import, or do I install it some other way?
Title: Re: Anyone know anything about Python?
Post by: deadsuperhero on Mon 30/07/2007 20:13:25
Out of curiousity, how hard would it be to make an AGS editor using Python? It wouldn't be an exact port, nor would it be compatible with Windows AGS games, but it would allow for developers to port their games to Linux (though, they'd have to rewrite the whole damn game, most likely)
Title: Re: Anyone know anything about Python?
Post by: LGM on Mon 30/07/2007 20:23:57
Are you suggesting coconuts migrate?
Title: Re: Anyone know anything about Python?
Post by: covox on Wed 01/08/2007 04:05:50
Not at all! They could be carried.

R4L: You might be better off installing the .egg package available at http://sf.net/projects/pyopengl

Alliance: Yes, considering the new AGS editor is done in .NET, it could indeed be ported by someone mad enough under the basis of "anything .NET can do, Python can do better". The only problem is that since WinForms isn't very cross-platform, two parallel editors would have to be maintained and there might be issues with seeing the source code and everything would get quite hairy. Probably just better to use Wine (0.9.33 is the magic release which doesn't crash at all) and wait for Mono to catch up...
Title: Re: Anyone know anything about Python?
Post by: SSH on Wed 01/08/2007 10:10:02
I thought about writing a python/pygame library that parallelled all the function names etc. in existing AGS scripty, which probably wouldn't be too hard, but there's a lot more to AGS than that.


Perhaps if Chris is going to re-write the compiler, we cna get him to use python syntax ;)
Title: Re: Anyone know anything about Python?
Post by: R4L on Wed 01/08/2007 14:28:59
Hey thanks for that link! :D

print "AGS should stay the way it is IMO. We don't need another script change."
Title: Re: Anyone know anything about Python?
Post by: RickJ on Wed 01/08/2007 16:33:15
Nice IDE for python ...
http://boa-constructor.sourceforge.net/ (http://boa-constructor.sourceforge.net/)
Title: Re: Anyone know anything about Python?
Post by: R4L on Wed 01/08/2007 20:03:24
Ha thats awesome Rick. Very nice! Although I still can't install PyOpenGL.
Title: Re: Anyone know anything about Python?
Post by: scotch on Wed 01/08/2007 21:18:29
I'm not sure what your problem is, but it isn't enough just to type that in the windows Run dialog, what you should do is:

Open a command prompt by typing "cmd" in the Run dialog.
Change directory to wherever you have extracted the pyopengl files, dos style (cd c:\temp\pyopengl for example)
Type the "setup.py install" command (the majority of libraries install using this command, unless they have standalone installers)

If there are any errors at least this way the window won't close straight away, and you'll be able to say what they are.

Edit: also be aware of the dependancies listed on the installation page, you'll need those before you install.
Title: Re: Anyone know anything about Python?
Post by: R4L on Wed 01/08/2007 21:58:52
OK, I see now. However it seems that I don't need it! :)

This is great by the way! The editor is nice and clean!